3
3
# chkconfig: 235 03 97
5
# (C) 2000-2007 Sebastien Godard (sysstat <at> wanadoo.fr)
5
# (C) 2000-2007 Sebastien Godard (sysstat <at> orange.fr)
7
# Description: Insert a dummy record in current daily data file.
8
# This indicates that the counters have restarted from 0.
7
# Description: sysstat service
8
#@(#) sysstat startup script:
9
#@(#) Insert a dummy record in current daily data file.
10
#@(#) This indicates that the counters have restarted from 0.
12
14
SYSCONFIG_DIR=@SYSCONFIG_DIR@
13
# Remove flag indicating that sadc was successfully launched
14
rm -f /tmp/sysstat.run
16
16
# See how we were called.
19
echo -n "Calling the system activity data collector (sadc): "
20
@SU_C_OWNER@ @QUOTE@ @SA_LIB_DIR@/sa1 --boot && touch /tmp/sysstat.run @QUOTE@
19
exitCodeIndicator="$(mktemp /tmp/sysstat-XXXXXX)" || exit 1
20
echo -n "Calling the system activity data collector (sadc): "
21
@SU_C_OWNER@ @QUOTE@ @SA_LIB_DIR@/sa1 --boot || rm -f ${exitCodeIndicator} @QUOTE@
22
23
# Try to guess if sadc was successfully launched. The difficulty
23
24
# here is that the exit code is lost when the above command is
24
25
# run via "su foo -c ..."
25
if [ ! -f /tmp/sysstat.run ]; then
26
if [ -f "${exitCodeIndicator}" ]; then
27
rm -f ${exitCodeIndicator}
28
rm -f /tmp/sysstat.run
32
33
stop|status|restart|reload)
35
echo "Usage: sysstat {start|stop|status|restart|reload}"
36
echo "Usage: sysstat {start|stop|status|restart|reload}"