diff -ruN samba-3.0.28a.orig/debian/changelog samba-3.0.28a/debian/changelog --- samba-3.0.28a.orig/debian/changelog 2008-03-18 07:33:19.000000000 +0900 +++ samba-3.0.28a/debian/changelog 2008-03-18 08:17:51.000000000 +0900 @@ -1,3 +1,10 @@ +samba (3.0.28a-0ubuntu4) hardy; urgency=low + + * debian/samba.init, debian/winbind.init: Added support for LSB status + compliance (LP: #203169), coded with Dustin Kirkland + + -- Onno Benschop Tue, 18 Mar 2008 08:17:39 +0900 + samba (3.0.28a-0ubuntu3) hardy; urgency=low * But smbpasswd-syslog does need updated for the new upstream release, diff -ruN samba-3.0.28a.orig/debian/samba.init samba-3.0.28a/debian/samba.init --- samba-3.0.28a.orig/debian/samba.init 2008-03-18 07:33:19.000000000 +0900 +++ samba-3.0.28a/debian/samba.init 2008-03-18 08:02:37.000000000 +0900 @@ -98,14 +98,31 @@ $0 start ;; status) - pidofproc -p $SMBDPID $DAEMON >/dev/null - status=$? - if [ $status -eq 0 ]; then - log_success_msg "SMBD is running" + # smbd status + status_of_proc "$DAEMON" "Samba daemon" + SMBD_STATUS=$? + + # nmbd status, only if it's not disabled + NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null` + if [ "$NMBD_DISABLED" != 'Yes' ]; then + status_of_proc "/usr/sbin/nmbd" "Netbios daemon" + NMBD_STATUS=$? + else + # we'll pretend that it's running + NMBD_STATUS=0 + fi + + if [ $SMBD_STATUS -eq 0 ] && [ $NMBD_STATUS -eq 0 ]; then + # if they're both running, then all is well + exit 0 ; else - log_failure_msg "SMBD is not running" + # otherwise return the status of the one that isn't running. + if [ $NMBD_STATUS -eq 0 ]; then + exit $SMBD_STATUS + else + exit $NMBD_STATUS + fi fi - exit $status ;; *) echo "Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload|status}" diff -ruN samba-3.0.28a.orig/debian/winbind.init samba-3.0.28a/debian/winbind.init --- samba-3.0.28a.orig/debian/winbind.init 2008-03-18 07:33:19.000000000 +0900 +++ samba-3.0.28a/debian/winbind.init 2008-03-18 07:48:43.000000000 +0900 @@ -47,8 +47,13 @@ $0 stop && sleep 2 && $0 start ;; + status) + status_of_proc "$DAEMON" "Winbind daemon" + exit $? + ;; + *) - echo "Usage: /etc/init.d/winbind {start|stop|restart|force-reload}" + echo "Usage: /etc/init.d/winbind {start|stop|restart|force-reload|status}" exit 1 ;; esac