#!/bin/sh
########################################################################
# Begin elogind
#
# Description : Start elogind daemon
#
# Author      : Joe Locash - jlocash@gmail.com
#
# Version     : BLFS 11.0
#
########################################################################

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

. /lib/lsb/init-functions

#$LastChangedBy$
#$Date$

pidfile=/run/elogind.pid

case "$1" in
   start)
      log_info_msg "Starting Elogind..."
      /usr/lib/elogind/elogind --daemon
      evaluate_retval
      ;;
   stop)
      log_info_msg "Stopping Elogind..."
      killproc /usr/lib/elogind/elogind
      evaluate_retval
      ;;
   reload)
      log_info_msg "Reloading Elogind..."
      killproc /usr/lib/elogind/elogind -HUP
      evaluate_retval
      ;;
   restart)
      log_info_msg "Restarting Elogind..."
      # Send elogind SIGINT so seats and sessions are left in place.
      killproc /usr/lib/elogind/elogind -INT
      sleep .5
      /usr/lib/elogind/elogind --daemon
      evaluate_retval
      ;;
   status)
      statusproc /usr/lib/elogind/elogind
      ;; 
   *)
      echo "Usage: $0 {start|stop|reload|restart|status}"
      exit 1
      ;;
esac

# End /etc/init.d/elogind
