Skip to content

Instantly share code, notes, and snippets.

@michaelnoman
Created August 22, 2012 11:28
Show Gist options
  • Select an option

  • Save michaelnoman/3424636 to your computer and use it in GitHub Desktop.

Select an option

Save michaelnoman/3424636 to your computer and use it in GitHub Desktop.
init script for zabbix-server on debian squeeze
#!/bin/sh
#
# Zabbix daemon start/stop script.
#
# Copyright (C) 2000-2012 Zabbix SIA
NAME=zabbix_server
#DAEMON=/usr/local/sbin/${NAME}
DAEMON=/usr/sbin/${NAME}
OPTS="-c /opt/zabbix/etc/zabbix_server.conf"
DESC="Zabbix server daemon"
PID=/tmp/$NAME.pid
test -f $DAEMON || exit 0
case "$1" in
start)
echo "Starting $DESC: $NAME"
start-stop-daemon --start --oknodo --pidfile $PID --exec $DAEMON -- $OPTS
;;
stop)
echo "Stopping $DESC: $NAME"
start-stop-daemon --stop --quiet --pidfile $PID --retry=TERM/10/KILL/5 && return 0
start-stop-daemon --stop --oknodo --exec $DAEMON --name $NAME --retry=TERM/10/KILL/5
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment