1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
#!/bin/sh
#
# eb_server_linux_kernel - Entropy broker linux_kernel source
# SVN: $Revision$
#
# chkconfig: 2345 27 84
# description: This daemon manages entropy sources and distributes entropy
# to clients.
#
# processname: eb_server_linux_kernel
# pidfile: /usr/local/entropybroker/var/run/server_linux_kernel.pid
### BEGIN INIT INFO
# Provides: eb_server_linux_kernel
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop linux_kernel entropy server
# Description: eb_server_linux_kernel is a daemon for collecting entropy from EGD.
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
exec="/usr/local/entropybroker/bin/eb_server_linux_kernel"
prog=$(basename $exec)
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
lockfile=/var/lock/subsys/$prog
start() {
echo -n $"Starting $prog: "
$exec $OPTIONS
retval=$?
[ $retval -ne 0 ] && failure
[ $retval -eq 0 ] && success && touch $lockfile
echo
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
case "$1" in
start|stop|restart)
$1
;;
force-reload)
restart
;;
status)
status $prog
;;
try-restart|condrestart)
if status $prog >/dev/null ; then
restart
fi
;;
reload)
# If config can be reloaded without restarting, implement it here,
# remove the "exit", and add "reload" to the usage message below.
# For example:
# status $prog >/dev/null || exit 7
killproc $prog -HUP
#action $"Service ${0##*/} does not support the reload action: " /bin/false
exit 3
;;
*)
echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}"
exit 2
esac
|