rwall/rwalld.init

96 lines
1.8 KiB
Bash
Executable File

#! /bin/sh
#
# chkconfig: - 60 20
# description: The rwall protocol allows remote users to display messages \
# on all of the active terminals on a system (like local \
# users can do with the wall command).
# processname: rpc.rwalld
### BEGIN INIT INFO
# Provides: rpc.rwalld
# Required-Start: $syslog $network
# Required-Stop: $syslog $network
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: start and stop rpc.rwalld
# Description: The rwall protocol allows remote users to display messages \
# on all of the active terminals on a system (like local \
# users can do with the wall command).
### END INIT INFO
# Source function library.
. /etc/init.d/functions
# Get config.
. /etc/sysconfig/network
RETVAL=0
prog="rwalld"
start() {
if [ $UID -ne 0 ] ; then
#user had insufficient privilege
exit 4
fi
# Check that networking is up.
if [ ${NETWORKING} = "no" ] ; then
exit 6
fi
echo -n $"Starting $prog: "
daemon rpc.rwalld
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/rwalld
return $RETVAL
}
stop() {
if [ $UID -ne 0 ] ; then
#user had insufficient privilege
exit 4
fi
echo -n $"Stopping $prog: "
killproc rpc.rwalld
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/rwalld
return $RETVAL
}
restart() {
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status rpc.rwalld
RETVAL=$?
;;
condrestart)
[ -f /var/lock/subsys/rwalld ] && restart || :
;;
force-reload)
restart
;;
restart)
restart
;;
reload)
RETVAL=3
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
RETVAL=2
;;
esac
exit $RETVAL