#!/bin/sh # # /etc/rc.d/init.d/utmpd # # utmp Starts the utmpd daemon # # chkconfig: 2345 25 55 # description: Utmpd daemon # processname: utmpd # # Source function library. . /etc/rc.d/init.d/functions # Get service config - may override defaults [ -f /etc/sysconfig/utmpd ] && . /etc/sysconfig/utmpd # See how we were called. case "$1" in start) # 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" exit 1 fi ;; stop) 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" exit 1 fi ;; reload|restart) $0 stop $0 start ;; status) status utmpd ;; *) msg_Usage "$0 {start|stop|status|restart|reload}" exit 1 esac exit $RETVAL