]> granicus.if.org Git - sysstat/blob - sysstat.in
First use of git system. Based on a complete sysstat 9.1.5 version.
[sysstat] / sysstat.in
1 #!/bin/sh
2 #
3 # chkconfig: 12345 01 99
4 # @INIT_DIR@/sysstat
5 # (C) 2000-2010 Sebastien Godard (sysstat <at> orange.fr)
6 #
7 ### BEGIN INIT INFO
8 # Provides:             sysstat
9 # Required-Start:
10 # Required-Stop:
11 # Default-Stop:
12 # Description: Reset the system activity logs
13 # Short-Description: Reset the system activity logs
14 ### END INIT INFO
15 #@(#) @PACKAGE_NAME@-@PACKAGE_VERSION@ startup script:
16 #@(#)    Insert a dummy record in current daily data file.
17 #@(#)    This indicates that the counters have restarted from 0.
18
19 RETVAL=0
20 SYSCONFIG_DIR=@SYSCONFIG_DIR@
21 #SADC_OPTIONS="-S DISK"
22 SADC_OPTIONS=""
23
24 # See how we were called.
25 case "$1" in
26   start)
27         exitCodeIndicator="$(mktemp /tmp/sysstat-XXXXXX)" || exit 1
28         echo -n "Calling the system activity data collector (sadc): "
29         @SU_C_OWNER@ @QUOTE@ @SA_LIB_DIR@/sa1 --boot ${SADC_OPTIONS} || rm -f ${exitCodeIndicator} @QUOTE@
30
31         # Try to guess if sadc was successfully launched. The difficulty
32         # here is that the exit code is lost when the above command is
33         # run via "su foo -c ..."
34         if [ -f "${exitCodeIndicator}" ]; then
35                 rm -f ${exitCodeIndicator}
36         else
37                 RETVAL=2
38         fi
39         echo
40         ;;
41   stop|status|restart|reload|force-reload|condrestart|try-restart)
42         ;;
43   *)
44         echo "Usage: sysstat {start|stop|status|restart|reload|force-reload|condrestart|try-restart}"
45         exit 2
46 esac
47 exit ${RETVAL}
48