Date: Monday, November 2, 2015 @ 03:08:41 Author: svenstaro Revision: 145497
Move nodm from AUR Added: nodm/ nodm/repos/ nodm/trunk/ nodm/trunk/PKGBUILD nodm/trunk/nodm.conf nodm/trunk/nodm.service nodm/trunk/norestart.patch -----------------+ PKGBUILD | 35 +++++++++++++++++++++++++++++++ nodm.conf | 22 +++++++++++++++++++ nodm.service | 9 ++++++++ norestart.patch | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 126 insertions(+) Added: nodm/trunk/PKGBUILD =================================================================== --- nodm/trunk/PKGBUILD (rev 0) +++ nodm/trunk/PKGBUILD 2015-11-02 02:08:41 UTC (rev 145497) @@ -0,0 +1,35 @@ +# Maintainer: Sven-Hendrik Haase <[email protected]> +# Contributor: Roel Gerrits <[email protected]> +pkgname=nodm +pkgver=0.7 +pkgrel=1 +pkgdesc='X display manager for automatic logins' +arch=('i686' 'x86_64') +url='http://enricozini.org/sw/nodm/' +license=('GPL') +depends=('pam' 'xorg-xinit') +makedepends=('help2man') +backup=('etc/nodm.conf') +source=("http://enricozini.org/sw/nodm/$pkgname-$pkgver.tar.gz" + "nodm.conf" + "nodm.service" + "norestart.patch") +md5sums=('6a569e9be7baf56de5c5813483d0357c' + 'e0ba34eb1fac0b2ec3fe73fcbb3b8f6a' + 'a93a5afdb4e68643840166796fa3a6a3' + '5076b2fe19551c42e3f5cd8bf445927f') + +build() { + cd "$srcdir/$pkgname-$pkgver" + + ./configure --prefix=/usr/ + make +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + + install -Dm755 nodm $pkgdir/usr/bin/nodm + install -Dm644 ../nodm.conf $pkgdir/etc/nodm.conf + install -Dm644 ../nodm.service $pkgdir/usr/lib/systemd/system/nodm.service +} Added: nodm/trunk/nodm.conf =================================================================== --- nodm/trunk/nodm.conf (rev 0) +++ nodm/trunk/nodm.conf 2015-11-02 02:08:41 UTC (rev 145497) @@ -0,0 +1,22 @@ +# nodm configuration file + +# Controls the user that is used to automatically log in +NODM_USER='{user}' + +# Options to pass to the X server (for example: "vt7 -nolisten tcp") +NODM_X_OPTIONS='vt7 -nolisten tcp' + +# Minimum time (in seconds) that a session should last in order for nodm to +# decide that it has not quit too soon. If an X session will run for less than +# this time, nodm will wait an increasing bit of time before restarting it. +NODM_MIN_SESSION_TIME=60 + +# Restart session after it ending? +NODM_RESTART_SESSION=0 + +# Path to the xinit program +NODM_XINIT='/usr/bin/xinit' + +# Path to the X session script (useful if using xinit instead of startx). +# NOTE: This file needs to be executable! +NODM_XSESSION='/home/{user}/.xinitrc' Added: nodm/trunk/nodm.service =================================================================== --- nodm/trunk/nodm.service (rev 0) +++ nodm/trunk/nodm.service 2015-11-02 02:08:41 UTC (rev 145497) @@ -0,0 +1,9 @@ +[Unit] +Description=nodm display manager + +[Service] +EnvironmentFile=/etc/nodm.conf +ExecStart=/usr/bin/nodm + +[Install] +WantedBy=multi-user.target Added: nodm/trunk/norestart.patch =================================================================== --- nodm/trunk/norestart.patch (rev 0) +++ nodm/trunk/norestart.patch 2015-11-02 02:08:41 UTC (rev 145497) @@ -0,0 +1,60 @@ +diff -aur nodm-0.7/nodm.c nodm-0.7-new/nodm.c +--- nodm-0.7/nodm.c 2009-07-26 20:36:14.000000000 +0200 ++++ nodm-0.7-new/nodm.c 2011-03-02 15:19:23.960000382 +0100 +@@ -427,8 +427,10 @@ + * @param mst + * The minimum time (in seconds) that a session should last to be considered + * successful ++ * @param xrestart ++ * Boolean option whether to restart X or not + */ +-void run_and_restart(const char* xinit, const char* xsession, const char* xoptions, int mst) ++void run_and_restart(const char* xinit, const char* xsession, const char* xoptions, int mst, int xrestart) + { + static int retry_times[] = { 0, 0, 30, 30, 60, 60, -1 }; + int restart_count = 0; +@@ -446,8 +448,7 @@ + args[2] = command; + args[3] = 0; + +- while (1) +- { ++ do { + /* Run the X server */ + time_t begin = time(NULL); + time_t end; +@@ -470,7 +471,7 @@ + /* Sleep a bit if the session was too short */ + sleep(retry_times[restart_count]); + syslog (LOG_INFO, "Restarting session for %s", name); +- } ++ } while (xrestart); + } + + /* +@@ -525,6 +526,7 @@ + int mst; + int vt_fd = -1; + int vt_num; ++ int xrestart = 0; + + /* Parse command line options */ + while (1) +@@ -576,6 +578,8 @@ + /* Read the configuration from the environment */ + cp = getenv("NODM_MIN_SESSION_TIME"); + mst = cp ? atoi(cp) : 60; ++ cp = getenv("NODM_RESTART_SESSION"); ++ xrestart = cp ? atoi(cp) : 0; + string_from_env(xinit, "NODM_XINIT", "/usr/bin/xinit"); + string_from_env(xoptions, "NODM_X_OPTIONS", ""); + +@@ -585,7 +589,7 @@ + snprintf(xoptions1, BUFSIZ, "vt%d %s", vt_num, xoptions); + + setenv("NODM_RUN_SESSION", "1", 1); +- run_and_restart(xinit, opt_session, xoptions1, mst); ++ run_and_restart(xinit, opt_session, xoptions1, mst, xrestart); + + close(vt_fd); +
