conserver/contrib/redhat-rpm/conserver.init

73 lines
1.2 KiB
Plaintext
Raw Normal View History

2001-06-16 00:44:07 +00:00
#!/bin/sh
#
# conserver -- serial-port console daemon
#
# chkconfig: 2345 92 08
# description: conserver is a serial-port console daemon
# config: /etc/conserver.cf
#
2009-09-29 22:56:23 +00:00
DAEMON=/usr/sbin/conserver
2001-06-16 00:44:07 +00:00
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
2009-09-29 22:56:23 +00:00
# Source defaults
. /etc/default/conserver
2001-06-16 00:44:07 +00:00
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
# make sure conserver is installed and executable
2009-09-29 22:56:23 +00:00
[ -x $DAEMON ] || exit 1
2001-06-16 00:44:07 +00:00
2010-11-11 22:53:37 +00:00
start()
{
echo -n "Starting conserver: "
daemon --user "${RUNAS-}" $DAEMON ${OPTIONS--d}
RETVAL=$?
[ "$RETVAL" = 0 ] && touch /var/lock/subsys/conserver
echo
}
stop()
{
echo -n "Shutting down conserver: "
killproc conserver
RETVAL=$?
[ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/conserver
echo
}
2001-06-16 00:44:07 +00:00
# See how we were called.
case "$1" in
start)
2010-11-11 22:53:37 +00:00
start
2001-06-16 00:44:07 +00:00
;;
stop)
2010-11-11 22:53:37 +00:00
stop
2001-06-16 00:44:07 +00:00
;;
status)
status conserver
;;
restart)
2010-11-11 22:53:37 +00:00
stop
start
;;
reload)
echo -n "Reloading conserver: "
2003-03-11 02:08:07 +00:00
killproc conserver -HUP
2010-11-11 22:53:37 +00:00
RETVAL=$?
2003-03-11 02:08:07 +00:00
echo
2001-06-16 00:44:07 +00:00
;;
*)
2010-11-11 22:53:37 +00:00
echo "Usage: conserver {start|stop|restart|reload|status}"
RETVAL=1
2001-06-16 00:44:07 +00:00
esac
2010-11-11 22:53:37 +00:00
exit $RETVAL