-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitscript
More file actions
executable file
·50 lines (46 loc) · 1.07 KB
/
initscript
File metadata and controls
executable file
·50 lines (46 loc) · 1.07 KB
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
42
43
44
45
46
47
48
49
50
#!/bin/sh
#/etc/init.d/rdm
### BEGIN INIT INFO
# Provides: rdm
# Should-Start: rdm
# Required-Start: $local_fs $remote_fs x11-common
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Ruby Display Manager
# Description: Debian init script for the Ruby Display Manager
### END INIT INFO
#
# Author: Sam Betts <sam@code-smash.net>
#
DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
touch /var/lock/rdm
case "$1" in
start)
if [ "$(cat $DEFAULT_DISPLAY_MANAGER_FILE)" != "/usr/local/bin/rdm" ]; then
echo "RDM not default display manager!"
else
echo "Starting RDM"
/usr/local/bin/rdm &
rdm=$!
echo $rdm > /var/run/rdm.pid
fi
;;
stop)
echo "Stopping RDM..."
/usr/local/bin/rdm --close
sleep 1
if ps ax | grep "`cat /var/run/rdm.pid`" | grep -v grep > /dev/null
then
echo "Stopping RDM Failed..."
else
echo "RDM Killed!"
rm /var/run/rdm.pid
fi
;;
*)
echo "Usage: /etc/init.d/rdm {start|stop}"
exit 1
;;
esac
exit 0