summaryrefslogtreecommitdiff
path: root/packages/xserver-kdrive-common/xserver-nodm-init
diff options
context:
space:
mode:
Diffstat (limited to 'packages/xserver-kdrive-common/xserver-nodm-init')
-rw-r--r--packages/xserver-kdrive-common/xserver-nodm-init/.mtn2git_empty0
-rwxr-xr-xpackages/xserver-kdrive-common/xserver-nodm-init/xserver-nodm49
2 files changed, 49 insertions, 0 deletions
diff --git a/packages/xserver-kdrive-common/xserver-nodm-init/.mtn2git_empty b/packages/xserver-kdrive-common/xserver-nodm-init/.mtn2git_empty
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/packages/xserver-kdrive-common/xserver-nodm-init/.mtn2git_empty
diff --git a/packages/xserver-kdrive-common/xserver-nodm-init/xserver-nodm b/packages/xserver-kdrive-common/xserver-nodm-init/xserver-nodm
new file mode 100755
index 0000000000..a56edaa15b
--- /dev/null
+++ b/packages/xserver-kdrive-common/xserver-nodm-init/xserver-nodm
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+killproc() { # kill the named process(es)
+ pid=`/bin/ps -e x |
+ /bin/grep $1 |
+ /bin/grep -v grep |
+ /bin/sed -e 's/^ *//' -e 's/ .*//'`
+ [ "$pid" != "" ] && kill $pid
+}
+
+for x in $(cat /proc/cmdline); do
+ case $x in
+ x11=false)
+ echo "X Server disabled"
+ exit 0;
+ ;;
+ esac
+done
+
+case "$1" in
+ start)
+ # We don't want this script to block the rest of the boot process
+ if [ "$2" != "background" ]; then
+ $0 $1 background &
+ else
+ . /etc/profile
+
+ echo "Starting Xserver"
+ /etc/X11/Xserver &
+ fi
+ ;;
+
+ stop)
+ echo "Stopping XServer"
+ killproc xinit
+ ;;
+
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ *)
+ echo "usage: $0 { start | stop | restart }"
+ ;;
+esac
+
+exit 0