/rc3.d/S20atop
http://github.com/brinkman83/bashrc · Shell · 64 lines · 32 code · 6 blank · 26 comment · 1 complexity · 22f7757353763d4884985edd2fd6867f MD5 · raw file
- #! /bin/sh
- #
- # atop init script
- #
- ### BEGIN INIT INFO
- # Provides: atop
- # Required-Start: $syslog
- # Required-Stop: $syslog
- # Should-Start: $local_fs
- # Should-Stop: $local_fs
- # Default-Start: 2 3 4 5
- # Default-Stop: 0 1 6
- # Short-Description: Monitor for system resources and process activity
- # Description: Atop is an ASCII full-screen performance monitor,
- # similar to the top command, but atop only shows
- # the active system-resources and processes, and
- # only shows the deviations since the previous
- # interval.
- ### END INIT INFO
- PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
- DAEMON=/usr/bin/atop
- DARGS="-a -w /var/log/atop.log 600"
- NAME=atop
- DESC="atop system monitor"
- test -x $DAEMON || exit 0
- set -e
- case "$1" in
- start)
- echo -n "Starting $DESC: "
- start-stop-daemon --start --background --quiet --exec $DAEMON -- $DARGS
- echo "$NAME."
- ;;
- stop)
- echo -n "Stopping $DESC: "
- start-stop-daemon --stop --quiet --retry 2 --oknodo --exec $DAEMON -- $DARGS
- echo "$NAME."
- ;;
- #reload)
- restart|force-reload)
- #
- # If the "reload" option is implemented, move the "force-reload"
- # option to the "reload" entry above. If not, "force-reload" is
- # just the same as "restart".
- #
- echo -n "Restarting $DESC: "
- start-stop-daemon --stop --quiet --exec $DAEMON -- $DARGS
- sleep 1
- start-stop-daemon --start --background --quiet --exec $DAEMON -- $DARGS
- echo "$NAME."
- ;;
- *)
- N=/etc/init.d/$NAME
- # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
- echo "Usage: $N {start|stop|restart|force-reload}" >&2
- exit 1
- ;;
- esac
- exit 0