[Pkg-samba-maint] Yet another Ubuntu patch: adding a status section to init script

Steve Langasek vorlon at debian.org
Sun Mar 30 03:42:18 UTC 2008

On Sat, Mar 15, 2008 at 01:55:17PM +0100, Christian Perrier wrote:
> Here's another patch from Ubuntu's 3.0.28a-0ubuntu1.

> It basically adds a "status" section to the init script, claiming to
> make it compliant with LSB.

> I wasn't aware of such requirement

Because the LSB init script spec doesn't apply to LSB implementors, only to
LSB packagers.  Debian packages are not LSB packages.

> but this basically doesn't really hurt, so I'm tempted to adopt this for
> 3.0.28a-2...

Yes, I agree that a 'status' option is a nice thing to have and am in favor
of including such functionality in the Debian package.

> Please note that using $DAEMON seems overzealous here.

Heh, yes, agreed.  Also, what status should it return if smbd is set to run
from inetd?

> Also, "pidofproc" doesn't seem to be available in Debian. That appear
> to be an Ubutuism.....but we could do the same with "pidof".

pidofproc is a shell function implemented by /lib/lsb/init-functions, on
both Ubuntu and Debian; so since we're already using this shell lib, we can
use pidofproc without further changes.  (Note that it's not quite the same
as 'pidof', since pidofproc() lets you specify a pid file to check against,
which is used here.)


> +		pidofproc -p $SMBDPID $DAEMON >/dev/null
> +		status=$?
> +		if [ $status -eq 0 ]; then
> +			log_success_msg "SMBD is running"
> +		else
> +			log_failure_msg "SMBD is not running"
> +		fi
> +		exit $status

Hnngh, not clean under set -e.  Ever since the LSB init script lib was
introduced to Debian, error handling in init scripts has gone downhill...

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 Developer                                    http://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org

More information about the Pkg-samba-maint mailing list