PageRenderTime 79ms CodeModel.GetById 75ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/rc0.d/K20atop

http://github.com/brinkman83/bashrc
Shell | 64 lines | 32 code | 6 blank | 26 comment | 1 complexity | 22f7757353763d4884985edd2fd6867f MD5 | raw file
 1#! /bin/sh
 2#
 3# atop init script
 4#
 5
 6### BEGIN INIT INFO
 7# Provides:          atop
 8# Required-Start:    $syslog
 9# Required-Stop:     $syslog
10# Should-Start:      $local_fs
11# Should-Stop:       $local_fs
12# Default-Start:     2 3 4 5
13# Default-Stop:      0 1 6
14# Short-Description: Monitor for system resources and process activity
15# Description:       Atop is an ASCII full-screen performance monitor,
16#                    similar to the top command, but atop only shows
17#                    the active system-resources and processes, and
18#                    only shows the deviations since the previous
19#                    interval.
20### END INIT INFO
21
22PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
23DAEMON=/usr/bin/atop
24DARGS="-a -w /var/log/atop.log 600"
25NAME=atop
26DESC="atop system monitor"
27
28test -x $DAEMON || exit 0
29
30set -e
31
32case "$1" in
33  start)
34	echo -n "Starting $DESC: "
35	start-stop-daemon --start --background --quiet --exec $DAEMON -- $DARGS
36	echo "$NAME."
37	;;
38  stop)
39	echo -n "Stopping $DESC: "
40	start-stop-daemon --stop --quiet --retry 2 --oknodo --exec $DAEMON -- $DARGS
41	echo "$NAME."
42	;;
43  #reload)
44  restart|force-reload)
45	#
46	#	If the "reload" option is implemented, move the "force-reload"
47	#	option to the "reload" entry above. If not, "force-reload" is
48	#	just the same as "restart".
49	#
50	echo -n "Restarting $DESC: "
51	start-stop-daemon --stop --quiet --exec $DAEMON -- $DARGS
52	sleep 1
53	start-stop-daemon --start --background --quiet --exec $DAEMON -- $DARGS
54	echo "$NAME."
55	;;
56  *)
57	N=/etc/init.d/$NAME
58	# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
59	echo "Usage: $N {start|stop|restart|force-reload}" >&2
60	exit 1
61	;;
62esac
63
64exit 0