[pkg-fso-commits] [SCM] Automatic Display Manager branch, master, updated. debian/0.1-52-g76526e2

Enrico Zini enrico at enricozini.org
Mon Feb 23 18:02:45 UTC 2009


The following commit has been merged in the master branch:
commit 2c1f2f8f7d94ba43cc2296a4e9e3e32779d9cd5a
Author: Enrico Zini <enrico at enricozini.org>
Date:   Mon Feb 2 13:50:52 2009 +0000

    Added nodm script with restart logic

diff --git a/nodm b/nodm
new file mode 100755
index 0000000..8332886
--- /dev/null
+++ b/nodm
@@ -0,0 +1,34 @@
+#!/bin/sh -ue
+
+# Configuration values are taken from the environment, and if they are missing
+# default values are used
+NODM_XINIT=${NODM_XINIT:-"/usr/bin/xinit"}
+NODM_XSESSION=${NODM_XSESSION:-"/etc/X11/Xsession"}
+NODM_X_OPTIONS=${NODM_X_OPTIONS:-"vt7 -nolisten tcp"}
+NODM_USER=${NODM_USER:-"root"}
+NODM_MIN_SESSION_TIME=${NODM_MIN_SESSION_TIME:-"10"}
+
+# Run an X session, returning success if it lasted at least
+# $NODM_MIN_SESSION_TIME
+run()
+{
+	start=`date +%s`
+	./pam-helper
+	end=`date +%s`
+	if [ `expr $end - $start` -ge $NODM_MIN_SESSION_TIME ]
+	then
+		return 0
+	else
+		return 1
+	fi
+}
+
+while :
+do
+	if ! run
+	then
+		exit 1
+	fi
+done
+
+exit 0

-- 
Automatic Display Manager



More information about the pkg-fso-commits mailing list