xdm: install startup script
authorYegor Yefremov <yegorslists@googlemail.com>
Mon, 10 Oct 2011 09:22:00 +0000 (11:22 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Wed, 7 Dec 2011 20:31:22 +0000 (21:31 +0100)
install S99xdm to /etc/init.d to start XDM automatically

[Peter: Small cleanups]
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/x11r7/xapp_xdm/S99xdm [new file with mode: 0644]
package/x11r7/xapp_xdm/xapp_xdm.mk

diff --git a/package/x11r7/xapp_xdm/S99xdm b/package/x11r7/xapp_xdm/S99xdm
new file mode 100644 (file)
index 0000000..4dd1cd8
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+XDM_BIN=/usr/bin/xdm
+
+case "$1" in
+    start)
+        echo -n "Starting XDM: "
+        $XDM_BIN
+        echo "done"
+        ;;
+    stop)
+       echo "Stopping XDM"
+        killall -q xdm
+        ;;
+    restart)
+       $0 stop
+       $0 start
+        ;;
+    *)
+        echo "Usage: $0 {start|stop|restart}"
+        exit 1
+        ;;
+esac
+
+exit 0
index ce385033166cf3af52a2626585116ef748a15e2a..7268d5d381d9e85403507e69fca358320aa69333 100644 (file)
@@ -12,4 +12,11 @@ XAPP_XDM_DEPENDENCIES = xapp_xinit xapp_sessreg xapp_xrdb xlib_libX11 xlib_libXa
 XAPP_XDM_CONF_OPT = --with-utmp-file=/var/adm/utmpx \
                    --with-wtmp-file=/var/adm/wtmpx
 
+define XAPP_XDM_INSTALL_STARTUP_SCRIPT
+       $(INSTALL) -m 0755 -D package/x11r7/xapp_xdm/S99xdm \
+               $(TARGET_DIR)/etc/init.d/S99xdm
+endef
+
+XAPP_XDM_POST_INSTALL_TARGET_HOOKS += XAPP_XDM_INSTALL_STARTUP_SCRIPT
+
 $(eval $(call AUTOTARGETS))