~ubuntu-branches/ubuntu/karmic/sysstat/karmic

« back to all changes in this revision

Viewing changes to sysstat.in

  • Committer: Bazaar Package Importer
  • Author(s): Robert Luberda
  • Date: 2007-10-08 23:55:13 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20071008235513-b88rmqx6aigra3zd
Tags: 8.0.1-1
New upstream version (stable).

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#
3
3
# chkconfig: 235 03 97
4
4
# @INIT_DIR@/sysstat
5
 
# (C) 2000-2007 Sebastien Godard (sysstat <at> wanadoo.fr)
 
5
# (C) 2000-2007 Sebastien Godard (sysstat <at> orange.fr)
6
6
#
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.
9
11
#
10
12
 
11
13
RETVAL=0
12
14
SYSCONFIG_DIR=@SYSCONFIG_DIR@
13
 
# Remove flag indicating that sadc was successfully launched
14
 
rm -f /tmp/sysstat.run
15
15
 
16
16
# See how we were called.
17
17
case "$1" in
18
18
  start)
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@
21
22
 
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
        else
26
29
                RETVAL=1
27
 
        else
28
 
                rm -f /tmp/sysstat.run
29
30
        fi
30
 
        echo
31
 
        ;;
 
31
        echo
 
32
        ;;
32
33
  stop|status|restart|reload)
33
 
        ;;
 
34
        ;;
34
35
  *)
35
 
        echo "Usage: sysstat {start|stop|status|restart|reload}"
36
 
        exit 1
 
36
        echo "Usage: sysstat {start|stop|status|restart|reload}"
 
37
        exit 1
37
38
esac
38
39
exit ${RETVAL}
39
40