Created
June 15, 2010 17:02
-
-
Save jaderobbins/439380 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## | |
# chkconfig: 2345 75 25 | |
# description: havege entropy daemon | |
# | |
# source function library | |
#. /etc/rc.d/init.d/functions | |
. /lib/lsb/init-functions | |
RETVAL=0 | |
prog="haveged" | |
success=0 | |
failure=1 | |
case "$1" in | |
start) | |
echo -n $"Starting $prog: " | |
/usr/local/sbin/$prog -w 1024 -v 1 && log_success_msg || failure | |
RETVAL=$? | |
[ "$RETVAL" = 0 ] && touch /var/lock/subsys/$prog | |
echo | |
;; | |
stop) | |
echo -n $"Stopping $prog: " | |
if [ -e /var/run/$prog.pid ]; then | |
kill `cat /var/run/$prog.pid` && log_success_msg || failure | |
else | |
failure | |
fi | |
RETVAL=$? | |
[ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/$prog | |
echo | |
;; | |
restart) | |
$0 stop | |
$0 start | |
;; | |
*) | |
echo "usage: $prog [start|stop|restart]" | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment