Created
September 8, 2012 14:19
-
-
Save weivall/3675345 to your computer and use it in GitHub Desktop.
stargazer init.d for CentOS 6
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 | |
# | |
# processname: stargazer | |
# config: /etc/stargazer/stargazer.conf | |
# pidfile: /var/run/stargazer.pid | |
# Source function library. | |
. /etc/rc.d/init.d/functions | |
# Source networking configuration. | |
. /etc/sysconfig/network | |
# Source stargazer configureation. | |
DAEMON=yes | |
QUEUE=1h | |
# Check that networking is up. | |
[ ${NETWORKING} = "no" ] && exit 0 | |
RETVAL=0 | |
prog="stargazer" | |
start() { | |
# Start daemons. | |
echo -n $"Starting $prog: " | |
/etc/stargazer/first 2> /dev/null | |
daemon /usr/sbin/stargazer | |
RETVAL=$? | |
/etc/stargazer/last 2> /dev/null | |
echo | |
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/stargazer | |
return $RETVAL | |
} | |
stop() { | |
# Stop daemons. | |
echo -n $"Shutting down $prog: " | |
killproc stargazer | |
RETVAL=$? | |
echo | |
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/stargazer | |
return $RETVAL | |
} | |
# See how we were called. | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart|reload) | |
stop | |
start | |
RETVAL=$? | |
;; | |
status) | |
status stargazer | |
RETVAL=$? | |
;; | |
*) | |
echo $"Usage: $0 {start|stop|restart|status}" | |
exit 1 | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment