Skip to content

Instantly share code, notes, and snippets.

@moosh3
Created March 7, 2019 22:31
Show Gist options
  • Save moosh3/693ce627a573e704ef739f8a6fbe8778 to your computer and use it in GitHub Desktop.
Save moosh3/693ce627a573e704ef739f8a6fbe8778 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# chkconfig: 345 85 15 - start or stop process definition within the boot process
# description: Rackspace Monitoring Agent
# processname: rackspace-monitoring-agent
# pidfile: /var/run/rackspace-monitoring-agent.pid
NAME=rackspace-monitoring-agent
DAEMON=/usr/bin/rackspace-monitoring-agent
PIDFILE=/var/run/rackspace-monitoring-agent.pid
LOG=/var/log/rackspace-monitoring-agent.log
export TMPDIR=/var/lib
# Source function library. This creates the operating environment for the process to be started
. /etc/init.d/functions
case "$1" in
start)
echo -n "Starting $DAEMON: "
daemon $DAEMON -D -p $PIDFILE -l $LOG --production --restart-sysv-on-upgrade
echo
touch /var/lock/subsys/process-name
;;
stop)
echo -n "Shutting down $DAEMON: "
killproc $DAEMON
echo
rm -f $PIDFILE
;;
status)
status $DAEMON
;;
restart)
$0 stop
$0 start
;;
reload)
echo -n "Reloading $DAEMON: "
killproc $DAEMON -HUP
echo
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment