|
Server IP : 111.118.215.156 / Your IP : 216.73.216.67 Web Server : Apache System : Linux md-in-26.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : azasoqqa ( 1858) PHP Version : 8.2.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /etc/rc3.d/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
#!/bin/bash
# description: start or stop the datacycle daemon
# chkconfig: 2345 20 10
# do not use systemctl on C7
SYSTEMCTL_SKIP_REDIRECT=1
# source function library
. /etc/rc.d/init.d/functions
PIDFILE='/var/run/datacycle.start'
if [[ -f $PIDFILE ]]; then
PID=$(cat $PIDFILE)
if [[ -d /proc/$PID ]]; then
RUNNING=1
else
RUNNING=0
fi
else
RUNNING=0
fi
case "$1" in
'start')
if [[ $RUNNING -eq 1 ]]; then
echo "datacycle already running"
exit 1
fi
echo "Starting datacycle.pl"
if [[ ! -d /proc/sys/fs/datacycle ]]; then
echo "cannot find /proc/sys/fs/datacycle, is this kernel patched?"
exit 1
fi
nohup /opt/eig_linux/datacycle.pl >/dev/null 2>&1 &
RETVAL=$?
;;
'stop')
if [[ $RUNNING -eq 0 ]]; then
echo "datacycle is not running"
exit 1
fi
echo "Stopping datacycle.pl"
kill -SIGABRT $PID
RETVAL=$?
;;
'restart')
if [[ $RUNNING -eq 0 ]]; then
echo "datacycle is not running"
else
echo "Stopping datacycle.pl"
kill -SIGINT $PID
sleep 2
fi
echo "Starting datacycle.pl"
nohup /opt/eig_linux/datacycle.pl >/dev/null 2>&1 &
RETVAL=$?
;;
'status')
status datacycle.pl
;;
*)
echo "Usage: $0 { start | stop | restart | status }"
RETVAL=1
;;
esac
exit $RETVAL