Blame | Last modification | View Log | RSS feed
#!/bin/sh## haldaemon: HAL daemon## chkconfig: 345 26 74# description: This is a daemon for collecting and maintaing information \# about hardware from several sources. \# See http://www.freedesktop.org/Software/hal## processname: hald# pidfile: /var/run/haldaemon.pid## Source function library.. /etc/rc.d/init.d/functions# so we can rearrange this easilyprocessname=haldservicename=haldaemonif [ -f /etc/sysconfig/haldaemon ]; thenHALD_ARGS=`cat /etc/sysconfig/haldaemon`fiRETVAL=0## See how we were called.#check() {# Check that we're a privileged user[ `id -u` = 0 ] || exit 4# Check if hald is executabletest -x /usr/sbin/hald || exit 5}start() {check# Check if it is already runningif [ ! -f /var/lock/subsys/$servicename ]; thenecho -n $"Starting HAL daemon: "daemon --check $servicename $processname $HALD_ARGSRETVAL=$?[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicenameechofireturn $RETVAL}stop() {checkecho -n $"Stopping HAL daemon: "killproc $servicename -TERMRETVAL=$?[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$servicenameechoif [ $RETVAL -eq 0 ]; thenrm -f /var/lock/subsys/$servicenamerm -f /var/run/haldaemon.pidfireturn $RETVAL}case "$1" instart)start;;stop)stop;;reload)echo "$0: Unimplemented feature (hald does this automatically)."RETVAL=3;;force-reload)echo "$0: Unimplemented feature."RETVAL=3;;status)status -p /var/run/haldaemon.pid -l haldaemon $processnameRETVAL=$?;;restart)stopsleep 3start;;try-restart|condrestart)if [ -f /var/lock/subsys/$servicename ]; thenstopsleep 3startfi;;*)echo $"Usage: $0 {start|stop|status|restart|condrestart}"RETVAL=2esacexit $RETVAL