Mapping an upstart job to a init.d script (sssd)

Petter Reinholdtsen pere at hungry.com
Thu Apr 29 18:25:01 UTC 2010


[Scott James Remnant]
> It's a great slide for a talk on how Upstart jobs are much more
> concise and easier to write and understand than init jobs ;-)

Sure, absolutely.  But by moving the initdmain() function into a
separate file, the init.d script could be reduced to this:

================ init.d/sssd ====================
### BEGIN INIT INFO
# Provides:          sssd
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: System Security Services Daemon
# Description:       Provides a set of daemons to manage access to
#                    remote directories and authentication
#                    mechanisms. It provides an NSS and PAM interface
#                    toward the system and a pluggable backend system
#                    to connect to multiple different account sources.
### END INIT INFO
. /lib/init/common-initd
DESCRIPTION="System Security Services Daemon"
NAME=sssd
OPTIONS="-D"
DAEMON=/usr/sbin/$NAME
PIDFILE=/var/run/$NAME.pid
initdmain $@
================ init.d/sssd ====================

Which I believe isn't too bad.  I have been toying with the idea of
rewriting the init.d scripts that start programs in initscripts to use
such common function, and provide it for skeleton too, to avoid all
the redundant code in the init.d scripts in Debian. :)

Happy hacking,
-- 
Petter Reinholdtsen




More information about the initscripts-ng-devel mailing list