MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 3.138.135.4
Web Server : Apache
System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : ppcad7no ( 715)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /etc/datacycle/../sasl2/../rc2.d/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //etc/datacycle/../sasl2/../rc2.d/S20datacycle
#!/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

MMCT - 2023