summaryrefslogtreecommitdiff
path: root/recipes-lxde/lxdm/files/init
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-lxde/lxdm/files/init')
-rw-r--r--recipes-lxde/lxdm/files/init41
1 files changed, 41 insertions, 0 deletions
diff --git a/recipes-lxde/lxdm/files/init b/recipes-lxde/lxdm/files/init
new file mode 100644
index 0000000..d8bb4eb
--- /dev/null
+++ b/recipes-lxde/lxdm/files/init
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+. /etc/init.d/functions
+
+DAEMON=/usr/sbin/lxdm
+PIDDIR=/var/run
+PIDFILE=$PIDDIR/lxdm.pid
+
+for x in $(cat /proc/cmdline); do
+ case $x in
+ x11=false)
+ echo "LXDM disabled"
+ exit 0;
+ ;;
+ esac
+done
+
+case "$1" in
+ start)
+ echo "Starting LXDM"
+ start-stop-daemon --start --quiet --pidfile $PIDFILE -m -b \
+ --exec $DAEMON
+ ;;
+
+ stop)
+ echo "Stopping LXDM"
+ start-stop-daemon --stop --quiet --pidfile $PIDFILE
+ ;;
+
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ *)
+ echo "usage: $0 { start | stop | restart }"
+ ;;
+esac
+
+exit 0