diff options
author | Koen Kooi <koen@openembedded.org> | 2007-02-15 09:52:28 +0000 |
---|---|---|
committer | Koen Kooi <koen@openembedded.org> | 2007-02-15 09:52:28 +0000 |
commit | f8f436e7215e7aa07e09d3e57545080d55312fbf (patch) | |
tree | a5bf5656a2c7764389c7e4bac33b392c46081e70 /packages/xserver-kdrive-common/xserver-nodm-init/xserver-nodm | |
parent | eea132404db91b16459c8121e7bd7381540da1c5 (diff) |
xserver-kdrive-common: merge from openmoko svn, merge in fixes from upstream xserver-common
xserver-nodm-init: merge from openmoko svn
Diffstat (limited to 'packages/xserver-kdrive-common/xserver-nodm-init/xserver-nodm')
-rwxr-xr-x | packages/xserver-kdrive-common/xserver-nodm-init/xserver-nodm | 49 |
1 files changed, 49 insertions, 0 deletions
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 |