From a7f6ac73894cfd0b37708c06d097310b269c40cf Mon Sep 17 00:00:00 2001 From: Tom Mortensen Date: Wed, 10 Jul 2024 23:01:09 -0700 Subject: [PATCH] maybe needed in future --- etc/rc.d/rc.sysstat | 58 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 etc/rc.d/rc.sysstat diff --git a/etc/rc.d/rc.sysstat b/etc/rc.d/rc.sysstat new file mode 100644 index 000000000..9f78e1774 --- /dev/null +++ b/etc/rc.d/rc.sysstat @@ -0,0 +1,58 @@ +#!/bin/sh +# +# chkconfig: 12345 01 99 +# description: Reset the system activity logs +# +# /etc/rc.d/rc.sysstat +# (C) 2000-2024 Sebastien Godard (sysstat orange.fr) +# +### BEGIN INIT INFO +# Provides: sysstat +# Required-Start: +# Required-Stop: +# Default-Start: 1 2 3 4 5 +# Default-Stop: 0 6 +# Description: Reset the system activity logs +# Short-Description: Reset the system activity logs +### END INIT INFO +#@(#) sysstat-12.7.6 startup script: +#@(#) Insert a dummy record in current daily data file. +#@(#) This indicates that the counters have restarted from 0. + +# Source functions library +[ -r /etc/rc.d/init.d/functions ] && . /etc/rc.d/init.d/functions + +RETVAL=0 +PIDFILE=/var/run/sysstat.pid +[ -z "$UID" ] && UID=`id -u` + +# See how we were called. +case "$1" in + start) + [ $UID -eq 0 ] || exit 4 + echo $$ > $PIDFILE || exit 1 + echo -n "Calling the system activity data collector (sadc)... " + /usr/lib64/sa/sa1 --boot + [ $? -eq 0 ] || RETVAL=1 + rm -f $PIDFILE + echo + ;; + + status) + [ -f $PIDFILE ] || RETVAL=3 + ;; + + stop) + [ $UID -eq 0 ] || exit 4 + ;; + + restart|reload|force-reload|condrestart|try-restart) + ;; + + *) + echo "Usage: sysstat {start|stop|status|restart|reload|force-reload|condrestart|try-restart}" + RETVAL=2 +esac + +exit ${RETVAL} +