[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 f88b032551861068ea698ebf9cd219ae8affef99
Author: Enrico Zini <enrico at enricozini.org>
Date:   Mon Feb 2 14:51:54 2009 +0000

    Debianised using the new system

diff --git a/Makefile b/Makefile
index 1a9e13a..a75521e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,2 +1,5 @@
 pam-helper: pam-helper.c
 	gcc -o $@ $< -lpam -lpam_misc -Wall
+
+clean:
+	rm pam-helper
diff --git a/debian/defaults/nodm b/debian/defaults/nodm
new file mode 100644
index 0000000..2528f95
--- /dev/null
+++ b/debian/defaults/nodm
@@ -0,0 +1,18 @@
+# nodm configuration
+
+# User to autologin for
+# Note: if NODM_USER is not set to any value, nodm will not start
+# NODM_USER=root
+
+# xinit program
+# NODM_XINIT=/usr/bin/xinit
+
+# X session
+# NODM_XSESSION=/etc/X11/Xsession
+
+# Options for the X server
+# NODM_X_OPTIONS=vt7 -nolisten tcp
+
+# If an X session will run for less than this time in seconds, it will be
+# considered an X configuration error and the session will not be restarted
+# NODM_MIN_SESSION_TIME=10
diff --git a/debian/nodm.init b/debian/nodm.init
index 98b73e0..ec88dbe 100644
--- a/debian/nodm.init
+++ b/debian/nodm.init
@@ -15,18 +15,22 @@ set -e
 PATH=/bin:/usr/bin:/sbin:/usr/sbin
 DESC="Automatic Display Manager"
 NAME=nodm
-PROG_XSESSION=/etc/X11/Xsession
-PROG_XINIT=/usr/bin/xinit
-X_OPTIONS="vt4 -nolisten tcp"
 PIDDIR=/var/run/
 PIDFILE=${PIDDIR}/${NAME}.pid
-USER=root
+
+if [ -f /etc/defaults/$NAME ]
+then
+	. /etc/defaults/$NAME
+	NODM_XINIT=${NODM_XINIT:-"/usr/bin/xinit"}
+	NODM_XSESSION=${NODM_XSESSION:-"/etc/X11/Xsession"}
+	export NODM_XINIT NODM_XSESSION NODM_X_OPTIONS NODM_USER NODM_MIN_SESSION_TIME
+fi
 
 # If you change the user to a non-root user, make sure you
 # set allowed_users=anybody in /etc/X11/Xwrapper.config
 
 # Gracefully exit if the package or its dependencies have been removed (but not purged).
-[ -x "$PROG_XSESSION" -a -x "$PROG_XINIT" ] || exit 0
+[ -x "$NODM_XSESSION" -a -x "$NODM_XINIT" ] || exit 0
 
 # Load the VERBOSE setting and other rcS variables
 . /lib/init/vars.sh
@@ -38,7 +42,12 @@ USER=root
 case "$1" in
     start)
         [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
-        start-stop-daemon --start --oknodo --pidfile ${PIDFILE} --make-pidfile --background --exec /bin/su -- --login --command "${PROG_XINIT} ${PROG_XSESSION} -- $X_OPTIONS" $USER
+    	if [ -z "$NODM_USER" ]
+	then
+		log_warning_msg "Not starting $NAME because NODM_USER has not been set in /etc/defaults/$NAME"
+	else
+		start-stop-daemon --start --oknodo --pidfile ${PIDFILE} --make-pidfile --background --exec /usr/sbin/nodm
+	fi
         [ "$VERBOSE" != no ] && log_end_msg $?
         ;;
     stop)
diff --git a/debian/nodm.install b/debian/nodm.install
new file mode 100644
index 0000000..874ab4a
--- /dev/null
+++ b/debian/nodm.install
@@ -0,0 +1,3 @@
+nodm		/usr/sbin/
+pam-helper	/usr/lib/nodm/
+debian/defaults/nodm /etc/defaults/
diff --git a/nodm b/nodm
index 8332886..5c25f7c 100755
--- a/nodm
+++ b/nodm
@@ -13,7 +13,7 @@ NODM_MIN_SESSION_TIME=${NODM_MIN_SESSION_TIME:-"10"}
 run()
 {
 	start=`date +%s`
-	./pam-helper
+	/usr/lib/nodm/pam-helper
 	end=`date +%s`
 	if [ `expr $end - $start` -ge $NODM_MIN_SESSION_TIME ]
 	then

-- 
Automatic Display Manager



More information about the pkg-fso-commits mailing list