#!/bin/bash # # /etc/rc.d/init.d/stone # # Starts the stone daemon # # chkconfig: 345 95 5 # description: repeat daemon stone. It's used for making ssl tunneling # # processname: stone # # Source function library. . /etc/init.d/functions test -x /usr/local/sbin/stone || exit 0 PATH="/sbin:/usr/sbin:/bin:/usr/bin" RETVAL=0 # # See how we were called. # prog="/usr/local/sbin/stone" stone_conf="/usr/local/stone/etc/zabbix_ssl.conf" start() { # Check if stone is already running if [ ! -f /var/lock/subsys/stone ]; then echo -n $"Starting ${prog}: " daemon ${prog} -C ${stone_conf} RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/stone echo fi return $RETVAL } stop() { echo -n $"Stopping $prog: " killproc ${prog} RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/stone echo return $RETVAL } restart() { stop start } reload() { restart } status_at() { status /usr/local/sbin/stone } case "$1" in start) start ;; stop) stop ;; reload|restart) restart ;; condrestart) if [ -f /var/lock/subsys/stone ]; then restart fi ;; status) status_at ;; *) echo $"Usage: $0 {start|stop|restart|condrestart|status}" exit 1 esac exit $? exit $RETVAL