File: sysstat.in

package info (click to toggle)
sysstat 12.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,372 kB
  • sloc: ansic: 30,491; sh: 1,082; tcl: 756; makefile: 561; perl: 257; python: 202
file content (58 lines) | stat: -rw-r--r-- 1,282 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
#
# chkconfig: 12345 01 99
# description: Reset the system activity logs
#
# @INIT_DIR@/sysstat
# (C) 2000-2018 Sebastien Godard (sysstat <at> 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
#@(#) @PACKAGE_NAME@-@PACKAGE_VERSION@ startup script:
#@(#)	 Insert a dummy record in current daily data file.
#@(#)	 This indicates that the counters have restarted from 0.

# Source functions library
[ -r @INIT_DIR@/functions ] && . @INIT_DIR@/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)... "
	@SU_C_OWNER@ @QUOTE@ @SA_LIB_DIR@/sa1 --boot @QUOTE@
	[ $? -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}