/etc/init.d/captagent is in captagent 6.1.0.20-3build1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | #! /bin/sh
#
### BEGIN INIT INFO
# Provides: captagent
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Required-Start: $local_fs $network
# Required-Stop:
# Short-Description: captagent - the Open Source Homer Capture Agent
# Description: Homer captagent is an Open Source Capture Programm released
# under GPLv3, able to handle thousands of call setups per second.
### END INIT INFO
cap=/usr/bin/captagent
prog=captagent
pidfile=/var/run/$prog.pid
lockfile=/var/lock/$prog
RETVAL=0
start() {
if [ -e $pidfile ]; then
echo "[FAILED] Captagent is already running with PID: `cat $pidfile`"
else
echo -n "Starting $prog: "
# there is something at end of this output which is needed to
# report proper [ OK ] status in CentOS scripts
start-stop-daemon --start --quiet --pidfile $pidfile --exec $cap -- $OPTIONS || echo "Failed"
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch $lockfile
fi
}
stop() {
echo -n "Stopping $prog: "
#killproc $cap
if [ -e $pidfile ]; then
start-stop-daemon --oknodo --stop --quiet --pidfile $pidfile --signal 9 || echo "Failed"
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f $lockfile $pidfile
else
RETVAL=1
echo
[ $RETVAL = 1 ] && rm -f $lockfile $pidfile
echo "[FAILED] Captagent is not running"
fi
}
status() {
RETVAL=0
if [ -e $pidfile ]; then
echo "[OK] Captagent is running with PID: `cat $pidfile`"
else
echo "[FAILED] Captagent is not running"
RETVAL=1
fi
return $RETVAL
}
[ -z "$CONFIG" ] && CONFIG=/etc/captagent/captagent.xml
OPTIONS="-d -f $CONFIG"
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status
;;
restart)
stop
start
;;
condrestart)
if [ -f $pidfile ] ; then
stop
start
fi
;;
*)
echo $"Usage: $prog {start|stop|restart|condrestart|status|help}"
exit 1
esac
exit $RETVAL
|