Serious problem with /lib/lsb/init-dunctions.d/01-upstart-lsb

Bug #1415651 reported by C. Jeffery Small
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
New
Undecided
Unassigned

Bug Description

Ubuntu server 14.10 with xfce4 desktop

Any attempt to halt samba with either "service samba stop" or "/etc/init.d/samba stop" fails with the following message:

stop: Unknown instance:

Examining /etc/init.d/samba shows that stop issues:

stop)
        /etc/init.d/samba-ad-dc stop
        /etc/init.d/smbd stop
        /etc/init.d/nmbd stop

Running "/etc/init.d/smbd stop" and "/etc/init.d/nmbd stop" manually work properly.

Running "/etc/init.d/samba-ad-dc stop" produces the error message above and no processes are haulted. However, I did notice that if I move into the /etc/init.d directory and issue either "samba-ad-dc stop" or "./samba-ad-dc stop" then the script works and the samba process is indeed haulted.

I added "set -x" to the stop of the samba-ad-dc script and observed the following:

# samba-ad-dc stop
+ PIDDIR=/var/run/samba
+ SAMBAPID=/var/run/samba/samba.pid
+ unset TMPDIR
+ test -x /usr/sbin/samba -a -r /etc/samba/smb.conf
+ . /lib/lsb/init-functions
+ run-parts --lsbsysinit --list /lib/lsb/init-functions.d
+ [ -r /lib/lsb/init-functions.d/01-upstart-lsb ]
+ . /lib/lsb/init-functions.d/01-upstart-lsb
+ unset UPSTART_SESSION
+ _RC_SCRIPT=samba-ad-dc
+ [ -r /etc/init/samba-ad-dc.conf ]
+ which initctl
+ initctl version
+ grep -q upstart
+ exit 0

I restarted samba and then tried the following:

#/etc/init.d/samba-ad-dc stop
+ PIDDIR=/var/run/samba
+ SAMBAPID=/var/run/samba/samba.pid
+ unset TMPDIR
+ test -x /usr/sbin/samba -a -r /etc/samba/smb.conf
+ . /lib/lsb/init-functions
+ run-parts --lsbsysinit --list /lib/lsb/init-functions.d
+ [ -r /lib/lsb/init-functions.d/01-upstart-lsb ]
+ . /lib/lsb/init-functions.d/01-upstart-lsb
+ unset UPSTART_SESSION
+ _RC_SCRIPT=/etc/init.d/samba-ad-dc
+ [ -r /etc/init//etc/init.d/samba-ad-dc.conf ]
+ _UPSTART_JOB=samba-ad-dc
+ [ -r /etc/init/samba-ad-dc.conf ]
+ which initctl
+ initctl version
+ grep -q upstart
+ initctl status samba-ad-dc
+ exec stop samba-ad-dc
stop: Unknown instance:

Note that the functions in /lib/lsb/init-functions are loaded and then /lib/lsb/init-functions.d/01-upstart-lsb is run. Check out the next couple of lines. When the fully qualified path /etc/init/samba-ad-dc is used, this function fails to first properly strip it to its basename before readding the etc/init/ path component. This causes the subsequent line:

if [ -r "/etc/init/${_RC_SCRIPT}.conf" ] && which initctl >/dev/null \
   && initctl version 2>/dev/null | grep -q upstart

to fail. The "unknown instance" message must be issued from /sbin/initctl.

More investigation needs to be done. I will report any additional information I discover. I see a lot of different bug reports related to this "stop: Unknown instance:" message, and I wonder if they are not all related.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1415651/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
affects: ubuntu → samba (Ubuntu)
tags: added: utopic
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.