;;
start)
if status > /dev/null; then
echo "$DESC is already running. Use restart."
exit 0
fi
echo -n "Starting $DESC: "
if [ "$RUNASTSAFE" != "yes" ];then
# TODO: what if we cought the wrapper just as its asterisk
# was killed? status should check for the wrapper if we're in
# "safe mode"
if status > /dev/null; then
echo "$DESC is already running. Use restart."
exit 0
fi
start-stop-daemon --start --group $GROUP --pidfile "$PIDFILE" \
--exec $REALDAEMON -- $PARAMS
else
start-stop-daemon --start --group $GROUP --make-pidfile \
--pidfile "$ASTSAFE_PIDFILE" \
--exec $REALDAEMON -- $PARAMS
fi
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
if [ "$RUNASTSAFE" = "yes" ];then
# hopefully this will work. Untested