#!/bin/sh ### BEGIN INIT INFO # Provides: ahn # Required-Start: ahn daemon # Required-Stop: ahn daemon # chkconfig: 2345 91 60 # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Adhearsion daemon # Description: This is a Adhearsion daemon init script ### END INIT SCRIPT # Source function library. [ -e /etc/rc.d/init.d/functions ] && . /etc/rc.d/init.d/functions NAME=Adhearsion AHN=/usr/bin/ahn APP_PATH=/var// pid="$(pidof ahn)" case "$1" in start) $AHN daemon $APP_PATH ;; stop) $AHN stop $APP_PATH ;; restart) $AHN restart $APP_PATH ;; rotate) [ -n "$pid" ] && (kill -1 $pid ; echo "Sent rotation signal" ) || echo "Adhearsion not running" ;; trace) [ -n "$pid" ] && (kill -14 $pid ; echo "Toggeled trace signal" ) || echo "Adhearsion not running" ;; status) echo -n "Adhearsion is " [ -n "$pid" ] && echo "running" || echo "not running" ;; *) echo "Usage: ahn {start|stop|restart|rotate|trace|status}" exit 1 esac