diff -Nru samba-3.4.5~dfsg/debian/changelog samba-3.4.5~dfsg/debian/changelog --- samba-3.4.5~dfsg/debian/changelog 2010-02-16 18:22:14.000000000 -0800 +++ samba-3.4.5~dfsg/debian/changelog 2010-02-18 04:51:46.000000000 -0800 @@ -1,3 +1,11 @@ +samba (2:3.4.5~dfsg-2ubuntu2) lucid; urgency=low + + * Switch smbd and nmbd over to upstart jobs, to ensure nmbd starts reliably + after the network is up. LP: #462169. + * Remove /etc/network/if-up.d/samba on upgrade, superseded by the above. + + -- Steve Langasek Thu, 18 Feb 2010 12:51:45 +0000 + samba (2:3.4.5~dfsg-2ubuntu1) lucid; urgency=low * Merge from debian unstable. Remaining changes: diff -Nru samba-3.4.5~dfsg/debian/rules samba-3.4.5~dfsg/debian/rules --- samba-3.4.5~dfsg/debian/rules 2010-02-16 18:22:14.000000000 -0800 +++ samba-3.4.5~dfsg/debian/rules 2010-02-18 04:47:51.000000000 -0800 @@ -235,7 +235,8 @@ dh_installexamples dh_installlogrotate dh_installlogcheck - DH_OPTIONS= dh_installinit -psamba -- "defaults 20 19" + DH_OPTIONS= dh_installinit -psamba --upstart-only --name smbd + DH_OPTIONS= dh_installinit -psamba --upstart-only --name nmbd DH_OPTIONS= dh_installinit -pwinbind dh_installcron dh_lintian diff -Nru samba-3.4.5~dfsg/debian/samba.nmbd.upstart samba-3.4.5~dfsg/debian/samba.nmbd.upstart --- samba-3.4.5~dfsg/debian/samba.nmbd.upstart 1969-12-31 16:00:00.000000000 -0800 +++ samba-3.4.5~dfsg/debian/samba.nmbd.upstart 2010-02-18 04:55:08.000000000 -0800 @@ -0,0 +1,18 @@ +description "NetBIOS name server" +author "Steve Langasek " + +start on (local-filesystems and net-device-up IFACE!=lo) +stop on runlevel [!2345] + +expect fork +respawn + +pre-start script + NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null` + + [ "x$NMBD_DISABLED" = xYes ] && { stop; exit 0; } + + install -o root -g root -m 755 -d /var/run/samba +end script + +exec nmbd -D diff -Nru samba-3.4.5~dfsg/debian/samba.preinst samba-3.4.5~dfsg/debian/samba.preinst --- samba-3.4.5~dfsg/debian/samba.preinst 1969-12-31 16:00:00.000000000 -0800 +++ samba-3.4.5~dfsg/debian/samba.preinst 2010-02-18 04:48:25.000000000 -0800 @@ -0,0 +1,31 @@ +#!/bin/sh + +set -e + +# Remove a no-longer used conffile (from http://wiki.debian.org/DpkgConffileHandling) +rm_conffile() { + PKGNAME="$1" + CONFFILE="$2" + if [ -e "$CONFFILE" ]; then + md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" + old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\'^ $CONFFILE[[:space:]]'{s/ obsolete$//;s/.* //p}\"`" + if [ "$md5sum" != "$old_md5sum" ]; then + echo "Obsolete conffile $CONFFILE has been modified by you." + echo "Saving as $CONFFILE.dpkg-bak ..." + mv -f "$CONFFILE" "$CONFFILE".dpkg-bak + else + echo "Removing obsolete conffile $CONFFILE ..." + rm -f "$CONFFILE" + fi + fi +} + +# remove the obsolete init script (replaced by an upstart job) +if dpkg --compare-versions "$2" lt-nl 2:3.4.5~dfsg-2ubuntu2 +then + rm_conffile samba /etc/network/if-up.d/samba + rm_conffile samba /etc/init.d/samba + update-rc.d samba remove +fi + +#DEBHELPER# diff -Nru samba-3.4.5~dfsg/debian/samba.smbd.upstart samba-3.4.5~dfsg/debian/samba.smbd.upstart --- samba-3.4.5~dfsg/debian/samba.smbd.upstart 1969-12-31 16:00:00.000000000 -0800 +++ samba-3.4.5~dfsg/debian/samba.smbd.upstart 2010-02-18 04:47:51.000000000 -0800 @@ -0,0 +1,20 @@ +description "SMB/CIFS File Server" +author "Steve Langasek " + +start on local-filesystems +stop on runlevel [!2345] + +expect daemon +respawn + +pre-start script + RUN_MODE="daemons" + + [ -r /etc/default/samba ] && . /etc/default/samba + + [ "$RUN_MODE" = inetd ] && { stop; exit 0; } + + install -o root -g root -m 755 -d /var/run/samba +end script + +exec smbd -D