Activity log for bug #1321369

Date Who What changed Old value New value Message
2014-05-20 16:47:47 Paul Kilgo bug added bug
2014-05-20 16:49:26 Paul Kilgo description The /etc/init.d/samba script appears to try and start smbd/nmbd improperly. If a user types "service samba restart" here is the behavior: root@cups:~# service samba restart root@cups:~# echo $? 1 I tried to track down the problem a bit by putting "set -x" on the init script: root@cups:~# service samba start + /etc/init.d/nmbd start So the nmbd init script appears to be exiting improperly without any output. After putting set -x on /etc/init.d/nmbd: root@cups:~# service samba start + /etc/init.d/nmbd start + PIDDIR=/var/run/samba + NMBDPID=/var/run/samba/nmbd.pid + unset TMPDIR + test -x /usr/sbin/nmbd + . /lib/lsb/init-functions + run-parts --lsbsysinit --list /lib/lsb/init-functions.d + [ -r /lib/lsb/init-functions.d/20-left-info-blocks ] + . /lib/lsb/init-functions.d/20-left-info-blocks + [ -r /lib/lsb/init-functions.d/50-ubuntu-logging ] + . /lib/lsb/init-functions.d/50-ubuntu-logging + LOG_DAEMON_MSG= + FANCYTTY= + [ -e /etc/lsb-base-logging.sh ] + true + init_is_upstart + [ -x /sbin/initctl ] + /bin/grep -q upstart + /sbin/initctl version + return 0 + exit 1 Looking at /etc/init.d/nmbd: 24 case $1 in 25 start) 26 if init_is_upstart; then 27 exit 1 28 fi And if we look at how /etc/init.d/samba start nmbd we can see why it exits at this point: 16 case $1 in 17 start) 18 /etc/init.d/nmbd start 19 /etc/init.d/smbd start 20 /etc/init.d/samba-ad-dc start Please note /etc/init.d/smbd also has a similar call to init_is_upstart. Here's the behavior of all the init scripts in question when both smbd and nmbd are stopped initially: root@cups:~# /etc/init.d/nmbd start; echo $? 1 root@cups:~# /etc/init.d/smbd start; echo $? 1 root@cups:~# /etc/init.d/nmbd start; echo $? 1 root@cups:~# /etc/init.d/smbd start; echo $? 1 root@cups:~# /etc/init.d/samba start; echo $? 1 root@cups:~# service nmbd start; echo $? nmbd start/running, process 32731 0 root@cups:~# service smbd start; echo $? smbd start/running, process 32741 0 root@cups:~# service smbd stop; echo $? smbd stop/waiting 0 root@cups:~# service nmbd stop; echo $? nmbd stop/waiting 0 root@cups:~# service samba start; echo $? 1 Expected behavior: Calling "/etc/init.d/{smbd,nmbd} start" exits 1 and prints a short message to stderr explaining that the user should be using "service {smbd,nmbd} start". Calling "service samba start" exits 0 and successfully starts smbd and nmbd. ProblemType: Bug DistroRelease: Ubuntu 14.04 Package: samba 2:4.1.6+dfsg-1ubuntu2.14.04.1 ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9 Uname: Linux 3.13.0-24-generic x86_64 ApportVersion: 2.14.1-0ubuntu3 Architecture: amd64 Date: Tue May 20 12:20:34 2014 InstallationDate: Installed on 2014-05-16 (3 days ago) InstallationMedia: Ubuntu-Server 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.2) OtherFailedConnect: Yes ProcEnviron: TERM=xterm PATH=(custom, no user) XDG_RUNTIME_DIR=<set> LANG=en_US.UTF-8 SHELL=/bin/bash SambaServerRegression: No SmbConfIncluded: No SourcePackage: samba UpgradeStatus: No upgrade log present (probably fresh install) modified.conffile..etc.init.d.nmbd: [modified] modified.conffile..etc.init.d.samba: [modified] mtime.conffile..etc.init.d.nmbd: 2014-05-20T12:11:20.828235 mtime.conffile..etc.init.d.samba: 2014-05-20T12:11:08.484234 The /etc/init.d/samba script appears to try and start smbd/nmbd improperly. If a user types "service samba restart" here is the behavior: root@cups:~# service samba restart root@cups:~# echo $? 1 I tried to track down the problem a bit by putting "set -x" on the init script: root@cups:~# service samba start + /etc/init.d/nmbd start So the nmbd init script appears to be exiting improperly without any output. After putting set -x on /etc/init.d/nmbd: root@cups:~# service samba start + /etc/init.d/nmbd start + PIDDIR=/var/run/samba + NMBDPID=/var/run/samba/nmbd.pid + unset TMPDIR + test -x /usr/sbin/nmbd + . /lib/lsb/init-functions + run-parts --lsbsysinit --list /lib/lsb/init-functions.d + [ -r /lib/lsb/init-functions.d/20-left-info-blocks ] + . /lib/lsb/init-functions.d/20-left-info-blocks + [ -r /lib/lsb/init-functions.d/50-ubuntu-logging ] + . /lib/lsb/init-functions.d/50-ubuntu-logging + LOG_DAEMON_MSG= + FANCYTTY= + [ -e /etc/lsb-base-logging.sh ] + true + init_is_upstart + [ -x /sbin/initctl ] + /bin/grep -q upstart + /sbin/initctl version + return 0 + exit 1 Looking at /etc/init.d/nmbd:  24 case $1 in  25 start)  26 if init_is_upstart; then  27 exit 1  28 fi And if we look at how /etc/init.d/samba start nmbd we can see why it exits at this point:  16 case $1 in  17 start)  18 /etc/init.d/nmbd start  19 /etc/init.d/smbd start  20 /etc/init.d/samba-ad-dc start Please note /etc/init.d/smbd also has a similar call to init_is_upstart. Here's the behavior of all the init scripts in question when both smbd and nmbd are stopped initially: root@cups:~# /etc/init.d/nmbd start; echo $? 1 root@cups:~# /etc/init.d/smbd start; echo $? 1 root@cups:~# /etc/init.d/samba start; echo $? 1 root@cups:~# service nmbd start; echo $? nmbd start/running, process 32731 0 root@cups:~# service smbd start; echo $? smbd start/running, process 32741 0 root@cups:~# service smbd stop; echo $? smbd stop/waiting 0 root@cups:~# service nmbd stop; echo $? nmbd stop/waiting 0 root@cups:~# service samba start; echo $? 1 Expected behavior: Calling "/etc/init.d/{smbd,nmbd} start" exits 1 and prints a short message to stderr explaining that the user should be using "service {smbd,nmbd} start". Calling "service samba start" exits 0 and successfully starts smbd and nmbd. ProblemType: Bug DistroRelease: Ubuntu 14.04 Package: samba 2:4.1.6+dfsg-1ubuntu2.14.04.1 ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9 Uname: Linux 3.13.0-24-generic x86_64 ApportVersion: 2.14.1-0ubuntu3 Architecture: amd64 Date: Tue May 20 12:20:34 2014 InstallationDate: Installed on 2014-05-16 (3 days ago) InstallationMedia: Ubuntu-Server 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.2) OtherFailedConnect: Yes ProcEnviron:  TERM=xterm  PATH=(custom, no user)  XDG_RUNTIME_DIR=<set>  LANG=en_US.UTF-8  SHELL=/bin/bash SambaServerRegression: No SmbConfIncluded: No SourcePackage: samba UpgradeStatus: No upgrade log present (probably fresh install) modified.conffile..etc.init.d.nmbd: [modified] modified.conffile..etc.init.d.samba: [modified] mtime.conffile..etc.init.d.nmbd: 2014-05-20T12:11:20.828235 mtime.conffile..etc.init.d.samba: 2014-05-20T12:11:08.484234
2014-05-26 20:22:23 Launchpad Janitor samba (Ubuntu): status New Confirmed
2014-05-26 20:22:38 Robie Basak samba (Ubuntu): importance Undecided Medium
2014-05-29 11:27:21 Robie Basak summary /etc/init.d/samba starts smbd/nmbd improperly Unexpected interactions between init.d, upstart, "service" and "samba", "smbd" and "nmbd"
2014-06-12 01:16:34 Ted Chen bug added subscriber Ted Chen
2015-06-26 10:57:15 Juris Sitcs bug added subscriber Juris Sitcs
2015-06-29 14:48:02 Abner Freitas attachment added Patch https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1321369/+attachment/4421968/+files/samba
2016-10-11 13:56:26 Mantas Kriaučiūnas bug added subscriber Baltix GNU/Linux system developers
2016-10-11 13:56:33 Mantas Kriaučiūnas bug added subscriber Mantas Kriaučiūnas