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

Starting daemons in the postinst scripts



[My subscription to debian-policy is on the way, but in the meantime,
 please CC: any replies to me.  Thanks.]

I just caught this on Christian's excellent weekly report, and I'd
like to add my 0.01 Euro.

My suggestion would be that daemons should be started up according to
the runlevel the system currently is in.  Interaction in postinst script
should only be done when absolutely necessary, IMHO.

My current code in the at package does this.  It sould probably be
modified to ask the admin if it can't determine the runlevel for
some reason.

start=0
if [ -x /sbin/runlevel ]
then
        if RL=$(runlevel)
        then
                if [ -x /etc/rc${RL#??}.d/S??atd ]
                then
                        /etc/rc${RL#??}.d/S??atd start
                fi
        else
                start=1
        fi
else
        start=1
fi

if [ "$start" = 1 ]
then
        echo "Can't determine current runlevel" 1>&2
        /etc/init.d/atd start
fi
-- 
Thomas Koenig, Thomas.Koenig@ciw.uni-karlsruhe.de, ig25@dkauni2.bitnet.
The joy of engineering is to find a straight line on a double
logarithmic diagram.


Reply to: