[Pkg-sysvinit-devel] Make init.d/skeleton a very simple init.d script?

Henrique de Moraes Holschuh hmh at debian.org
Mon Feb 3 23:35:23 UTC 2014


On Mon, 03 Feb 2014, Petter Reinholdtsen wrote:
> > We could also avoid the need to override start/stop when no pidfile
> > support is available, by doing the right thing when PIDFILE is not
> > set, something like this:
> > 
> > start-stop-daemon --start --quiet ${PIDFILE:+--pidfile ${PIDFILE}} --exec $DAEMON --test >/dev/null
> 
> Not really, as PIDFILE always is set, and can't be overriden at the
> moment.  I am open to suggestions on how to override it with the
> current structure of the code.

IMO, we must allow everything to be overriden:
NAME=${NAME:=$(basename $DAEMON)}

(or the usual if [ -z "$NAME" ] ; then NAME=$(basename $DAEMON) ; fi)

However, we cannot use this:
PIDFILE=${PIDFILE:=/var/run/$NAME.pid}

because that leaves no way for the skeleton to request no PIDFILE, unless
we special-case some value of PIDFILE that, when found, unsets PIDFILE (e.g.
PIDFILE=/dev/null).

It is probably best if we leave PIDFILE to be set by the skeleton, since it
is something that needs to be also passed to the daemon as well (or, when it
is not configurable, it has to be changed to match what the daemon wants).

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh



More information about the Pkg-sysvinit-devel mailing list