You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
870 B
51 lines
870 B
13 years ago
|
#!/sbin/runscript
|
||
|
# Copyright 1999-2005 Gentoo Foundation
|
||
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
|
opts="depend checkconfig start stop reload"
|
||
|
|
||
|
depend() {
|
||
|
need net
|
||
|
use logger
|
||
|
}
|
||
|
|
||
|
|
||
|
checkconfig() {
|
||
|
if [ ! -f "$DAEMON" ] ; then
|
||
|
ewarn "Unable to find $DAEMON"
|
||
|
return 1
|
||
|
fi
|
||
|
if [ ! -f "$CONF" ] ; then
|
||
|
ewarn $CONF " does not exist."
|
||
|
return 1
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
start() {
|
||
|
checkconfig || return 1
|
||
|
|
||
|
ebegin "Starting ocsigen"
|
||
|
start-stop-daemon --start --exec $DAEMON -- \
|
||
|
--pidfile $PIDFILE \
|
||
|
--daemon \
|
||
|
$OCSIGEN_OPTS
|
||
|
eend $?
|
||
|
}
|
||
|
|
||
|
stop() {
|
||
|
ebegin "Stopping ocsigen"
|
||
|
start-stop-daemon --stop --pidfile $PIDFILE
|
||
|
eend $?
|
||
|
}
|
||
|
|
||
|
reload() {
|
||
|
if [ ! -f "$PIDFILE" ] ; then
|
||
|
ewarn "$PIDFILE not found!!"
|
||
|
ewarn "Ocsigen is not running. Not reloading."
|
||
|
return 1
|
||
|
fi
|
||
|
ebegin "Reloading ocsigen"
|
||
|
echo reload > /var/run/ocsigen_command
|
||
|
eend $?
|
||
|
}
|