Bug#640668: samba: Updated if-up.d script to function under systemd
Hi Sam, On Tue, Sep 06, 2011 at 01:40:34PM +0100, Sam Morris wrote: When systemd is installed, the behaviour of '/etc/init.d/samba status' changes (systemd changes the LSB init functions to launch services via systemctl rather than directly) in a way that breaks the if-up.d script. I've modified the script to get it to work again; see below. Why should this not be fixed in systemd? I don't think it's appropriate for the status_of_proc() function to give different output under systemd than under sysvinit and to require a package that isn't aware of systemd at all to cope with such divergence. In Ubuntu, the Samba package currently avoids status_of_proc() entirely because we know that we will *always* be using upstart on Ubuntu, so we can just invoke the 'status' command directly. But this argument does not apply in Debian, and I would not like to see the init script in Debian have to account for differing init systems. -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developerhttp://www.debian.org/ slanga...@ubuntu.com vor...@debian.org signature.asc Description: Digital signature
Bug#640668: samba: Updated if-up.d script to function under systemd
On Mon, 2011-09-12 at 11:01 +0100, Steve Langasek wrote: Hi Sam, On Tue, Sep 06, 2011 at 01:40:34PM +0100, Sam Morris wrote: When systemd is installed, the behaviour of '/etc/init.d/samba status' changes (systemd changes the LSB init functions to launch services via systemctl rather than directly) in a way that breaks the if-up.d script. I've modified the script to get it to work again; see below. Why should this not be fixed in systemd? I don't think it's appropriate for the status_of_proc() function to give different output under systemd than under sysvinit and to require a package that isn't aware of systemd at all to cope with such divergence. I don't really care whether it's systemd or samba that has to be updated to fix the bug. I filed #640508 against systemd to make the maintainers aware that their replacement of the LSB init script functions break samba. :) AIUI, the if-up.d script is really just a bandage that deals with the case where nmbd exits because, when it's launched, there are no network interfaces that are up. Without modifying the samba package so that it ships one init script for smbd and one for nmbd, or so that it ships systemd service files, modifying the if-up.d script so that it takes account of the init script's differing behaviour under systemd seemed like the path of least resistance. -- Sam Morris s...@robots.org.uk -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#640668: samba: Updated if-up.d script to function under systemd
On Mon, 2011-09-12 at 19:56 +0100, Sam Morris wrote: AIUI, the if-up.d script is really just a bandage that deals with the case where nmbd exits because, when it's launched, there are no network interfaces that are up. Come to think of it... how does the samba package on Ubuntu handle this? Is nmbd started whenever a network interface goes up? -- Sam Morris s...@robots.org.uk -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#640668: samba: Updated if-up.d script to function under systemd
Package: samba Version: 2:3.6.0-1 Severity: normal When systemd is installed, the behaviour of '/etc/init.d/samba status' changes (systemd changes the LSB init functions to launch services via systemctl rather than directly) in a way that breaks the if-up.d script. I've modified the script to get it to work again; see below. -- System Information: Debian Release: wheezy/sid APT prefers stable APT policy: (545, 'stable'), (540, 'stable-updates'), (530, 'testing'), (520, 'unstable'), (510, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 3.0.0-1-amd64 (SMP w/2 CPU cores) Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages samba depends on: ii adduser 3.112+nmu2 add and remove users and groups ii debconf [debconf-2.0] 1.5.40 Debian configuration management sy ii libacl1 2.2.51-3 Access control list shared library ii libattr11:2.4.46-3 Extended attribute shared library ii libc6 2.13-18 Embedded GNU C Library: Shared lib ii libcap2 1:2.19-3 support for getting/setting POSIX. ii libcomerr2 1.41.12-4stable1 common error description library ii libcups21.5.0-5 Common UNIX Printing System(tm) - ii libgssapi-krb5-21.9.1+dfsg-1+b1 MIT Kerberos runtime libraries - k ii libk5crypto31.9.1+dfsg-1+b1 MIT Kerberos runtime libraries - C ii libkrb5-3 1.9.1+dfsg-1+b1 MIT Kerberos runtime libraries ii libldap-2.4-2 2.4.23-7.2 OpenLDAP libraries ii libpam-modules 1.1.1-6.1Pluggable Authentication Modules f ii libpam-runtime 1.1.1-6.1Runtime support for the PAM librar ii libpam0g1.1.1-6.1Pluggable Authentication Modules l ii libpopt01.16-1 lib for parsing cmdline parameters ii libtalloc2 2.0.6-2 hierarchical pool based memory all ii libtdb1 1.2.9-3 Trivial Database - shared library ii libwbclient02:3.6.0-1Samba winbind client library ii lsb-base3.2-28 Linux Standard Base 3.2 init scrip ii procps 1:3.2.8-11 /proc file system utilities ii samba-common2:3.6.0-1common files used by both the Samb ii update-inetd4.38+nmu1inetd configuration file updater ii zlib1g 1:1.2.3.4.dfsg-3 compression library - runtime Versions of packages samba recommends: ii logrotate 3.7.8-6Log rotation utility ii tdb-tools 1.2.9-3Trivial Database - bundled binarie Versions of packages samba suggests: pn ctdb none (no description available) pn ldb-tools none (no description available) pn openbsd-inetd | inet-superser none (no description available) pn smbldap-tools none (no description available) -- Configuration Files: /etc/network/if-up.d/samba changed: if [ $IFACE = lo ]; then exit 0 fi if [ $MODE != start ]; then exit 0 fi case $ADDRFAM in inet|inet6|NetworkManager) ;; *) exit 0 ;; esac if test -e /sys/fs/cgroup/systemd; then # systemd hijacked the output of '/etc/init.d/samba status' if systemctl status samba.service /dev/null; then if ! systemd-cgls /system/samba.service | grep -q nmbd; then systemctl restart samba.service fi fi else status=$(/etc/init.d/samba status) # Really only necessary to do anything if nmbd is not already running if echo $status | grep -q 'smbd is running' \ ! echo $status | grep -q 'nmbd is running' then /etc/init.d/samba start fi fi exit 0 -- debconf information: samba/run_mode: daemons samba/generate_smbpasswd: true samba-common/title: -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org