[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Your mon / s-p-u upload



On Sun, 2010-07-18 at 17:33 +0200, Dario Minnucci wrote:
> On 06/19/2010 11:51 AM, Adam D. Barratt wrote:
> > I've been reviewing the few remaining packages in s-p-u in
> > preparation for the upcoming point release and had a couple of
> > comments / queries on your "mon" upload.
[...]
> As suggested, I'm sending this email to debian-release with the
> debdiff attached.
> 
> The script seems to be Policy compliant now.

Sorry for not getting back to you sooner; I seem to have managed to
misfile your mail.

> +case "$1" in
> +  start)
> +       if [ -f $PIDFILE ] ; then
> +               echo "$NAME daemon is already running." 
> +       else
> +               start_deamon
> +       fi

The short-circuit case should be removed here; the existence of the
pidfile does not imply that the daemon is (still) running and your
start-stop-daemon call in start_daemon() already handles exiting
successfully if the daemon is in fact running.

>    restart)
[...]
> +       if [ -f $PIDFILE ] ; then
> +               stop_daemon
> +               sleep 1
> +               start_deamon
> +       else
> +               echo "$NAME daemon is not running."     
> +               start_deamon
> +       fi

Similarly here.  If the daemon is not running, then stop_daemon() will
successfully fail to stop it with no ill effects.  Admittedly, if the
pidfile doesn't exist then stop_daemon() is basically a no-op, but not
simply calling stop_daemon() followed by start_daemon() in all cases
doesn't really provide any benefit.

Regards,

Adam


Reply to: