#
# /etc/rc.d/init.d/utmpd
#
-# Starts the utmpd daemon
+# utmp Starts the utmpd daemon
#
-# chkconfig: 2345 25 55
-# description: Utmpd daemon
-# processname: utmpd
+# chkconfig: 2345 25 55
+# description: Utmpd daemon
+# processname: utmpd
#
+
# Source function library.
. /etc/rc.d/init.d/functions
-# See how we were called.
-#
+# Get service config - may override defaults
+[ -f /etc/sysconfig/utmpd ] && . /etc/sysconfig/utmpd
+
+RETVAL=0
+# See how we were called.
case "$1" in
start)
- show Starting utmpd daemon
- daemon utmpd
- touch /var/lock/subsys/utmpd
+ # Check if the service is already running?
+ if [ ! -f /var/lock/subsys/utmpd ]; then
+ msg_starting "utmpd"
+ daemon utmpd
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/utmpd
+ else
+ msg_already_running "utmpd"
+ fi
;;
stop)
- show Stopping utmpd daemon
- killproc utmpd
- rm -f /var/lock/subsys/utmpd
+ if [ -f /var/lock/subsys/utmpd ]; then
+ msg_stopping "utmpd"
+ killproc utmpd
+ rm -f /var/lock/subsys/utmpd >/dev/null 2>&1
+ else
+ msg_not_running "utmpd"
+ fi
;;
- reload|restart)
+ restart|force-reload)
$0 stop
$0 start
+ exit $?
;;
status)
status utmpd
+ exit $?
;;
*)
- echo "Usage: $0 {start|stop|restart|reload|status}"
- exit 1
+ msg_usage "$0 {start|stop|restart|force-reload|status}"
+ exit 3
esac
-exit 0
+exit $RETVAL