debian/lxdm.upstart: Add upstart script.
authorJulien Lavergne <julien.lavergne@gmail.com>
Sat, 22 May 2010 19:06:07 +0000 (21:06 +0200)
committerJulien Lavergne <julien.lavergne@gmail.com>
Sat, 22 May 2010 19:06:07 +0000 (21:06 +0200)
debian/changelog
debian/lxdm.upstart [new file with mode: 0644]

index 72f4f14..da15af3 100644 (file)
@@ -19,7 +19,7 @@ lxdm (0.2.0-3) UNRELEASED; urgency=low
    - 15-path-replace.patch : don't let lxdm replace PATH. (LP: #524761)
    - 17-follow-symlink.patch: Follow symlink instead of saving the
      configuration file on a symlink.
-  
+  * debian/lxdm.upstart: Add upstart script.
 
  -- Julien Lavergne <gilir@ubuntu.com>  Sat, 22 May 2010 18:40:10 +0200
 
diff --git a/debian/lxdm.upstart b/debian/lxdm.upstart
new file mode 100644 (file)
index 0000000..36a8c3c
--- /dev/null
@@ -0,0 +1,54 @@
+# lxdm - LXDE Display Manager
+#
+# The display manager service manages the X servers running on the
+# system, providing login and auto-login services
+# Based on gdm upstart script
+
+description    "GNOME Display Manager"
+author         "William Jon McCann <mccann@jhu.edu>"
+
+start on (filesystem
+          and started dbus
+          and (graphics-device-added fb0 PRIMARY_DEVICE_FOR_DISPLAY=1
+               or drm-device-added card0 PRIMARY_DEVICE_FOR_DISPLAY=1
+               or stopped udevtrigger))
+stop on runlevel [016]
+
+emits starting-dm
+
+env XORGCONFIG=/etc/X11/xorg.conf
+
+script
+    if [ -n "$UPSTART_EVENTS" ]
+    then
+       [ ! -f /etc/X11/default-display-manager -o "$(cat /etc/X11/default-display-manager 2>/dev/null)" = "/usr/sbin/lxdm" ] || { stop; exit 0; }
+
+       # Check kernel command-line for inhibitors
+       for ARG in $(cat /proc/cmdline)
+       do
+           case "${ARG}" in
+               text|-s|s|S|single)
+                   exit 0
+                   ;;
+           esac
+       done
+    fi
+
+    if [ -r /etc/default/locale ]; then
+       . /etc/default/locale
+       export LANG LANGUAGE
+    elif [ -r /etc/environment ]; then
+       . /etc/environment
+       export LANG LANGUAGE
+    fi
+
+    #Export PATH from /etc/environment
+    if [ -r /etc/environment ]; then
+       . /etc/environment
+       export PATH
+    fi
+
+    export XORGCONFIG
+
+    exec lxdm-binary $* $CONFIG_FILE
+end script