Comments (3)
Hi sounds like you have avahi on your host and didn't mount the avahi services into the container - right?
If not, it might be that the pid is not removed on container restarts - if you recreate the container it should work - doesn't it?
If not I have to add some cleanup stuff to the container
I'm happy if you share your compose file -> feel free to remove user and share configuration :)
from samba.
Avahi is not running on the host, and the container uses a different IP anyway, it's avahi getting stuck with a stale pidfile. It thinks it's already running but it's actually samba running on that pid not avahi.
I'm running it with it's own network interface using this in the compose file:
networks:
physical:
ipv4_address: 192.168.44.42
A network conflict would be an error about not being able to bind to the interface, not the pid file, as the docker instance can't see the PID namespace of the host anyway.
Recreating the container does indeed resolve the problem every time, because the pidfile is removed.
Sometimes you can reproduce the condition by doing docker kill samba, docker start samba.. I think it's a race condition between samba and avahi when you have a previous pidfile.
For example see here in the logs (I was trying to reproduce it) where it sometimes starts on Pid 12 and sometimes resolves itself when the process dies.:
################################################################################
You'll find this container sourcecode here:
https://github.com/ServerContainers/samba
The container repository will be updated regularly.
################################################################################
>> CONTAINER: already initialized - direct start of samba
>> CMD: exec docker CMD
runsvdir -P /container/config/runit
+ exec avahi-daemon --no-rlimits
+ sleep 2
+ sleep 10
Process 16 died: No such process; trying to remove PID file. (/run/avahi-daemon//pid)
Found user 'avahi' (UID 86) and group 'avahi' (GID 86).
Successfully dropped root privileges.
avahi-daemon 0.8 starting up.
WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
Successfully called chroot().
Successfully dropped remaining capabilities.
Loading service file /services/samba.service.
Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.44.42.
New relevant interface eth0.IPv4 for mDNS.
Joining mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.
New relevant interface lo.IPv4 for mDNS.
Network interface enumeration completed.
Registering new address record for 192.168.44.42 on eth0.IPv4.
Registering new address record for 127.0.0.1 on lo.IPv4.
Server startup complete. Host name is Box.local. Local service cookie is 1266449242.
Service "Box" (/services/samba.service) successfully established.
+ exec smbd --foreground
[2023/04/11 08:09:38.601561, 0] ../../source3/smbd/server.c:1741(main)
smbd version 4.16.10 started.
Copyright Andrew Tridgell and the Samba Team 1992-2022
[2023/04/11 08:09:38.608606, 1] ../../source3/profile/profile_dummy.c:30(set_profile_level)
INFO: Profiling support unavailable in this build.
+ exec /usr/sbin/wsdd2
cannot read additional dns hostnames from testparm
cannot read netbios aliases from testparm
starting.
open_ep: SO_RCVBUFFORCE: Operation not permitted
################################################################################
Welcome to the ghcr.io/servercontainers/samba
################################################################################
You'll find this container sourcecode here:
https://github.com/ServerContainers/samba
The container repository will be updated regularly.
################################################################################
>> CONTAINER: already initialized - direct start of samba
>> CMD: exec docker CMD
runsvdir -P /container/config/runit
+ + sleep 10
sleep 2
+ exec avahi-daemon --no-rlimits
Daemon already running on PID 12
+ exec avahi-daemon --no-rlimits
Daemon already running on PID 12
+ exec smbd --foreground
+ exec avahi-daemon --no-rlimits
Daemon already running on PID 12
[2023/04/11 08:10:09.433281, 0] ../../source3/smbd/server.c:1741(main)
smbd version 4.16.10 started.
Copyright Andrew Tridgell and the Samba Team 1992-2022
[2023/04/11 08:10:09.439229, 1] ../../source3/profile/profile_dummy.c:30(set_profile_level)
INFO: Profiling support unavailable in this build.
+ exec avahi-daemon --no-rlimits
Daemon already running on PID 12
+ exec avahi-daemon --no-rlimits
Daemon already running on PID 12
+ exec avahi-daemon --no-rlimits
Daemon already running on PID 12
+ exec avahi-daemon --no-rlimits
Daemon already running on PID 12
+ exec avahi-daemon --no-rlimits
Daemon already running on PID 12
+ exec avahi-daemon --no-rlimits
Daemon already running on PID 12
+ exec avahi-daemon --no-rlimits
Daemon already running on PID 12
+ exec /usr/sbin/wsdd2
cannot read additional dns hostnames from testparm
+ exec avahi-daemon --no-rlimits
Process 12 died: No such process; trying to remove PID file. (/run/avahi-daemon//pid)
Found user 'avahi' (UID 86) and group 'avahi' (GID 86).
Successfully dropped root privileges.
avahi-daemon 0.8 starting up.
WARNING: No NSS support for mDNS detected, consider installing nss-mdns!
Successfully called chroot().
Successfully dropped remaining capabilities.
Loading service file /services/samba.service.
Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.44.42.
New relevant interface eth0.IPv4 for mDNS.
Joining mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.
New relevant interface lo.IPv4 for mDNS.
Network interface enumeration completed.
Registering new address record for 192.168.44.42 on eth0.IPv4.
Registering new address record for 127.0.0.1 on lo.IPv4.
cannot read netbios aliases from testparm
starting.
open_ep: SO_RCVBUFFORCE: Operation not permitted
Server startup complete. Host name is Box.local. Local service cookie is 1285967680.
Service "Box" (/services/samba.service) successfully established.`
from samba.
thanks for the clearification - I'll take a deeper look
from samba.
Related Issues (20)
- Unknown socket option TCP_NODELAY IPTOS_LOWDELAY HOT 1
- samba:smbd-only-latest remains unhealty, everything works though HOT 4
- Remove network_mode: host from docker-compose.yml HOT 1
- Image builds broken HOT 3
- /etc/avahi/services/samba.service HOT 1
- users group always with the id 100 whatever HOT 2
- adduser not possible if gid = uid HOT 1
- Error loading shared library HOT 3
- No access to shared folder HOT 5
- Read-only shared folders HOT 2
- Question: Which version of Samba (v1/v2/v3/v4) is being used, and can it be changed for best performance? HOT 5
- force user = %U with timemachine HOT 5
- Why does turning on time machine modify my read and write permissions HOT 4
- Samba Server not visible HOT 5
- `disable netbios = yes` disregards `$NETBIOS_DISABLE` HOT 1
- Multiline not working HOT 3
- Cannot use UID and GID of a host user HOT 1
- differnce to dperson/samba HOT 1
- How to set the Time Machine share max size differently for different users HOT 6
- tdb(/var/lib/samba/registry.tdb): tdb_open_ex: could not open file /var/lib/samba/registry.tdb: No such file or directory HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from samba.