Makefile | 1 - atop.init | 18 +++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 61d89ef..48cf41d 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,6 @@ install: atop if [ ! -d $(DESTDIR)$(CRNPATH) ]; then mkdir -p $(DESTDIR)$(CRNPATH); fi if [ ! -d $(DESTDIR)$(ROTPATH) ]; then mkdir -p $(DESTDIR)$(ROTPATH); fi cp atop $(DESTDIR)$(BINPATH)/atop - chown root $(DESTDIR)$(BINPATH)/atop chmod 04711 $(DESTDIR)$(BINPATH)/atop -rm $(DESTDIR)$(BINPATH)/atopsar ln -s atop $(DESTDIR)$(BINPATH)/atopsar diff --git a/atop.init b/atop.init index 44b7d4a..f7e20dc 100755 --- a/atop.init +++ b/atop.init @@ -2,13 +2,19 @@ # # atop This shell script takes care of initializing atop # -# chkconfig: 2345 85 15 +# chkconfig: - 85 15 # description: Atop is a system and process activity monitor # +# Do not load RH compatibility interface. +WITHOUT_RC_COMPAT=1 + # Check existance of binaries [ -f /usr/bin/atop ] || exit 0 +# Source function library. +. /etc/init.d/functions + PIDFILE=/var/run/atop.pid RETVAL=0 @@ -26,7 +32,7 @@ case "$1" in fi ;; - stop) + stop|condstop) # Check if atop runs # if [ -e $PIDFILE ] && ps -p `cat $PIDFILE` | grep 'atop$' > /dev/null @@ -40,18 +46,20 @@ case "$1" in ;; status) + status --pidfile "$PIDFILE" --expect-user root -- atop + RETVAL=$? ;; - reload) + reload|condreload) /etc/atop/atop.daily ;; - restart) + restart|condrestart) /etc/atop/atop.daily ;; *) - echo "Usage: $0 [start|stop|status|reload|restart]" + echo "Usage: $0 [start|stop|status|reload|restart|condstop|condreload|condrestart]" exit 1 esac