docker-samba icon indicating copy to clipboard operation
docker-samba copied to clipboard

Exits as soon as it has started

Open jamesjwarren opened this issue 9 years ago • 8 comments

The containers exit immediately after starting with ./docker-samba launch

The log output is:

smbd version 4.3.9-Ubuntu started.
Copyright Andrew Tridgell and the Samba Team 1992-2015
STATUS=daemon 'smbd' finished starting up and ready to serve connections
nmbd version 4.3.9-Ubuntu started.
Copyright Andrew Tridgell and the Samba Team 1992-2015
STATUS=daemon 'nmbd' finished starting up and ready to serve connections
EOF on stdin
Got SIGTERM: going down...

Running the container manually not in daemon mode works docker run --rm -it -v $PWD/etc/samba:/etc/samba ewindisch/samba-nmbd $@ but this is less than ideal.

jamesjwarren avatar Aug 01 '16 21:08 jamesjwarren

+1

dmnobunaga avatar Nov 28 '16 07:11 dmnobunaga

Smbd exits when it receives an EOF,. Dockers puts EOF on the stdin when it starts a daemonized container. Use a wrapper to avoid smbd receiving EOF. CMD /usr/sbin/smbd < /dev/null

herczegzsolt avatar Jan 23 '17 20:01 herczegzsolt

@hzsolt94 great, can you make that a PR?

ewindisch avatar Jan 24 '17 14:01 ewindisch

@ewindisch Sorry, but I'm not using your code, so I can't properly test this out to make a PR. Something like that will do:

samba-smbd/Dockerfile

@@ -6,5 +6,4 @@
 expose 445
 expose 139
 expose 135
 
-entrypoint ["/usr/sbin/smbd"]
-cmd ["-F", "-S"]
+cmd /usr/sbin/smbd -FS < /dev/null

herczegzsolt avatar Jan 24 '17 19:01 herczegzsolt

aaargh

episage avatar Sep 29 '18 16:09 episage

@episage the latter works for me, took me a min to figure out wtf was going on then I realized how counter intuitive it was to comma separate parameters if you don't have to. The former wouldn't work for me

#CMD [ "/usr/sbin/smbd", "-F", "-S", "-s", "/etc/samba/smb.conf", "-d3", "<", "/dev/null"]
CMD /usr/sbin/smbd -FS -d3 < /dev/null

paigeadelethompson avatar Feb 22 '19 12:02 paigeadelethompson

Funny thing. I found myself facing exactly the same problem 3 years later haha

still doesn't work for me haha

episage avatar Jan 22 '21 09:01 episage

FYI --no-process-group solves the problem

smbd -FS --no-process-group

episage avatar Jan 22 '21 09:01 episage