HEX
Server: Apache/2.4.65 (Debian)
System: Linux web6 5.10.0-36-amd64 #1 SMP Debian 5.10.244-1 (2025-09-29) x86_64
User: innocamp (1028)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //etc/init.d/atopacct
#!/bin/sh
#
# atopacctd	Startup script for the atopacctd daemon 
#
# chkconfig: 2345 91 9
# description: Process accounting control
#
### BEGIN INIT INFO
# Provides:             atopacct
# Required-Start:	$local_fs $remote_fs
# Required-Stop:	$local_fs $remote_fs
# Default-Start:	2 3 4 5
# Default-Stop:		0 1 6
# Description:          This daemon switches on process accounting and
#                       transfers the process accounting records 'realtime'
#                       to small shadow files to avoid huge disk space usage
# Short-Description:    Process accounting control
### END INIT INFO

. /lib/lsb/init-functions

# Check existance of binaries 
[ -f /usr/sbin/atopacctd ] || exit 0

RETVAL=0

# See how we were called.
case "$1" in
  start)
	# Check if process accounting already in use via psacct
	#
	for PACCTFILE in /var/account/pacct /var/log/pacct /var/log/account/pacct
	do
		if [ -f "$PACCTFILE" ]	# file exists?
		then
			BEFORSIZE=$(ls -lL "$PACCTFILE" | awk '{print $5}')
			AFTERSIZE=$(ls -lL "$PACCTFILE" | awk '{print $5}')

			# verify if accounting file grows, so is in use
			#
			if [ $BEFORSIZE -lt $AFTERSIZE ]
			then
			   echo Process accounting already used by psacct! >&2
			   exit $RETVAL		# do not start atopacctd
			fi
		fi
	done


	# Check if atopacctd runs already
	#
	if ps -e | grep -q atopacctd$
	then
		:
	else
		# Start atopacctd
		rm -rf /run/pacct_shadow.d 2> /dev/null
		/usr/sbin/atopacctd
	fi

	touch /run/lock/atopacctd
	;;

  stop)
	# Check if atopacctd runs
	#
	if ps -e | grep -q atopacctd$
	then
		kill $(ps -e | grep atopacctd$ | sed 's/^ *//' | cut -d' ' -f1)
	fi
	rm -f /run/lock/atopacctd
	;;

  status)
	;;

  reload)
	;;

  restart|force-reload)
  	$0 stop
        $0 start
	;;

  *)
	echo "Usage: $0 [start|stop]"
	exit 1
esac

exit $RETVAL