Coder Social home page Coder Social logo

Comments (3)

MarvAmBass avatar MarvAmBass commented on June 8, 2024

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.

noaho avatar noaho commented on June 8, 2024

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.

MarvAmBass avatar MarvAmBass commented on June 8, 2024

thanks for the clearification - I'll take a deeper look

from samba.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.