Files
gentoo-zh/sys-apps/sysd/files/sysd.init
T

44 lines
830 B
Bash

#!/bin/sh
### BEGIN INIT INFO
# Provides: sysd
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts and stops sysd
# Description: System information api server.
### END INIT INFO
NAME=sysd
PIDFILE=/var/run/$NAME.pid
DAEMON=/usr/sbin/sysd
do_start () {
echo -n "Starting daemon: "$NAME
start-stop-daemon --start --quiet -m --pidfile $PIDFILE --background --exec $DAEMON
echo "."
}
do_stop () {
echo -n "Stopping daemon: "$NAME
start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
echo "."
}
case "$1" in
start)
do_start
;;
restart)
do_stop
do_start
;;
stop)
do_stop
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart}" >&2
exit 3
;;
esac