summaryrefslogtreecommitdiff
path: root/recipes-lxde/lxdm/files/init
blob: d8bb4eb52976d955b56eaccda9b6ec6970127430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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