init.d template: [#CONV-960].

This commit is contained in:
Alexey Milovidov 2010-03-09 19:01:07 +00:00
parent bee9f2ea55
commit c7a73d68ca

View File

@ -79,7 +79,7 @@ stop()
if isrun; then
if [ -f "$LOCKFILE" ]; then
rm -f "$LOCKFILE"
kill -INT `cat "$PIDFILE"`
kill -TERM `cat "$PIDFILE"`
wait4done
else
echo "has been stopping already"
@ -97,6 +97,34 @@ restart()
start
}
forcestop()
{
local EXIT_STATUS
EXIT_STATUS=0
echo -n "Stop $PROGRAM service: "
if isrun; then
if [ -f "$LOCKFILE" ]; then
rm -f "$LOCKFILE"
kill -9 `cat "$PIDFILE"`
wait4done
else
echo "has been stopping already"
return 1
fi
fi
echo "DONE"
return $EXIT_STATUS
}
forcerestart()
{
forcestop
start
}
enable_cron()
{
sed -i 's/^#*//' "$CRONFILE"
@ -122,6 +150,12 @@ case "$1" in
restart)
restart && enable_cron
;;
forcestop)
disable_cron && forcestop
;;
forcerestart)
forcerestart && enable_cron
;;
reload)
restart
;;