You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

74 lines
1.8 KiB

  1. #!/bin/sh
  2. # Largely adapted from xdm's init script:
  3. # Copyright 1998-2002, 2004, 2005 Branden Robinson <branden@debian.org>.
  4. # Copyright 2006 Eugene Konev <ejka@imfi.kspu.ru>
  5. ### BEGIN INIT INFO
  6. # Provides: slim
  7. # Required-Start: dbus $local_fs $remote_fs
  8. # Required-Stop: $local_fs $remote_fs
  9. # Should-Start: xfs $named slapd
  10. # Should-Stop: xfs $named slapd
  11. # Default-Start: 2 3 4 5
  12. # Default-Stop: 0 1 6
  13. # Short-Description: Start daemon at boot time
  14. # Description: Debian init script for the SLiM.
  15. ### END INIT INFO
  16. test -z "$HEED_DEFAULT_DISPLAY_MANAGER" && HEED_DEFAULT_DISPLAY_MANAGER=true
  17. DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
  18. NAME="slim"
  19. DESC="X display manager"
  20. DAEMON=/usr/bin/slim
  21. PIDFILE=/var/run/slim.lock
  22. SSD_START_ARGS="--pidfile $PIDFILE --name $(basename $DAEMON) --startas $DAEMON -- -d"
  23. SSD_STOP_ARGS="--pidfile $PIDFILE --name $(basename $DAEMON) --retry TERM/5/TERM/5"
  24. test -x $DAEMON || exit 0
  25. . /lib/lsb/init-functions
  26. case $1 in
  27. start)
  28. if [ "$HEED_DEFAULT_DISPLAY_MANAGER" = "true" ] &&
  29. [ -e $DEFAULT_DISPLAY_MANAGER_FILE ] &&
  30. [ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" != "$DAEMON" ]; then
  31. log_daemon_msg "Not starting $DESC ($NAME); it is not the default display manager." "$NAME"
  32. else
  33. log_daemon_msg "Starting $NAME" "$NAME"
  34. start-stop-daemon --start --quiet $SSD_START_ARGS
  35. log_end_msg $?
  36. fi
  37. ;;
  38. stop)
  39. log_daemon_msg "Stopping $DESC" "$NAME"
  40. start-stop-daemon --stop --quiet $SSD_STOP_ARGS
  41. log_end_msg $?
  42. rm -f $PIDFILE
  43. ;;
  44. restart)
  45. $0 stop
  46. sleep 2
  47. $0 start
  48. ;;
  49. force-reload)
  50. /etc/init.d/slim restart
  51. ;;
  52. status)
  53. status_of_proc /usr/bin/$NAME $NAME
  54. ;;
  55. *)
  56. echo "Usage: /etc/init.d/slim {start|stop|restart|force-reload|status}"
  57. exit 1
  58. ;;
  59. esac
  60. # End of file