#!/bin/sh
########################################################################
# Begin dbus
#
# Description: 	  Start elongd daemon
# 		  To make sure eloind is ready on time
# chkconfig:	  2345 90 10
#
#
########################################################################

### BEGIN INIT INFO
# Provides:            elogind
# Required-Start:      dbus
# Required-Stop:       sendsignals
# Should-Stop:
# Default-Start:       2 3 4 5
# Default-Stop:        0 1 6
# Short-Description:   Starts message elogind.
# Description:         Starts message elogind.
# X-LFS-Provided-By:   LFS
### END INIT INFO

PROG=elogind
CMD="/usr/libexec/$PROG"
PID_FILE=/var/run/$PROG.pid
. /lib/lsb/init-functions

case "$1" in
   start)
      log_info_msg "Starting the $PROG Daemon..."
      start_daemon -f $CMD -D
      evaluate_retval
      ;;

   stop)
	if [ -f $PID_FILE ] ; then
          log_info_msg "Stopping $PROG Daemon..."
          killproc -p $PID_FILE $CMD
          evaluate_retval
  	  fi
      ;;

   restart)
      $0 stop
      sleep 1
      $0 start
      ;;

    condrestart)
        pid=`cat $pidfile 2>/dev/null`
        if [ -n "${pid}"  -a -d /proc/$pid ]; then
	  $0 restart
	  fi
        ;;

   status)
      statusproc $CMD
      ;;

   *)
      echo "Usage: $0 {start|stop|restart|status}"
      exit 1
      ;;
esac

# End /etc/init.d/dbus
