Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 327105 - nodm new package, (an automatic display manager)
Summary: nodm new package, (an automatic display manager)
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Default Assignee for New Packages
URL: http://www.enricozini.org/sw/nodm/
Whiteboard: sunrise-suggested
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2010-07-06 09:03 UTC by BT
Modified: 2014-04-30 05:37 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
nodm-0.7 ebuild (nodm-0.7.ebuild,1.03 KB, text/plain)
2010-07-06 09:04 UTC, BT
Details
nodm init.d (nodm.initd,414 bytes, text/plain)
2010-07-06 09:06 UTC, BT
Details
nodm conf.d (nodm.confd,587 bytes, text/plain)
2010-07-06 09:07 UTC, BT
Details
nodm-0.7 ebuild (nodm-0.7.ebuild,1.03 KB, text/plain)
2010-07-31 04:42 UTC, BT
Details
xdm support for nodm (xdm.patch,555 bytes, patch)
2011-02-24 23:47 UTC, BT
Details | Diff
nodm-0.11 ebuild (nodm-0.11.ebuild,1.21 KB, text/plain)
2012-03-06 23:42 UTC, BT
Details
nodm conf.d (nodm.confd,592 bytes, text/plain)
2012-04-12 06:35 UTC, BT
Details
nodm init.d (nodm.initd,423 bytes, text/plain)
2012-04-12 06:36 UTC, BT
Details
nodm-0.11 ebuild (nodm-0.11.ebuild,1.20 KB, text/plain)
2012-04-12 06:42 UTC, BT
Details
xdm support for nodm (xdm.patch,549 bytes, patch)
2012-04-12 06:44 UTC, BT
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BT 2010-07-06 09:03:19 UTC
* Description

nodm is a minimal display manager that simply logs in as a given user and starts an X session, without asking for username or password.

On a normal computer, using nodm is a big security issue because it would give anyone access to the computer.

However, there are cases where automatic login is needed: for example in an embedded system such as a mobile phone, or in a kiosk setup, or in a control panel for industrial machinery.  For those cases, nodm is simple to setup, lightweight, and it should do exactly the right thing.

* Features

 - Automatic login with a fixed user, doing all that needs to be done like
   setting up the session via PAM, updating lastlog, logging to syslog.
 - X is started via /usr/bin/xinit and a standard X session script (by default,
   /etc/X11/Xsession).
 - The session is restarted when it exits.
 - If a session exits too soon, nodm will wait a bit before restarting.  The
   waiting time go as follow:
    - The first time the session exits too soon, restart immediately
    - The second and third time, wait 30 seconds
    - All remaining times, wait 1 minute.
   Once a session lasts long enough, the waiting time goes back to zero.
Comment 1 BT 2010-07-06 09:04:41 UTC
Created attachment 237689 [details]
nodm-0.7 ebuild

I need help with working out all the dependencies. I've had a look at the Debian package and it lists xinit, x11-common and x11-xserver-utils as dependencies.

I've listed xinit in RDEPEND but I'm not sure what the other two packages translate to in Gentoo. So don't be surprised if your running some sort of minimal X setup and nodm doesn't work.
Comment 2 BT 2010-07-06 09:06:15 UTC
Created attachment 237693 [details]
nodm init.d

nodm uses it's own init.d script, you'll first need to stop the xdm script and then remove it from any runlevels.

I need help with working out a correct depend() for the init.d script. Currently it just depends on local which isn't very good. This will not be an issue if I successfully get nodm to start via the default xdm script just like kdm or gdm.
Comment 3 BT 2010-07-06 09:07:26 UTC
Created attachment 237695 [details]
nodm conf.d

There are six conf.d variables available but you mostly likely only need to set 'NODM_USER' and 'NODM_XSESSION'. These set the user to auto login and the X session to start respectively.

The 'NODM_MIN_SESSION_TIME' variable is also useful as it sets the minimum time that a session should last to be considered successful. nodm will restart the session if it lasts less than this time. The default is 60 but I've currently set it to 0 to restart immediately if the session (XBMC in my case) crashes or exits.
Comment 4 Michael Weber (RETIRED) gentoo-dev 2010-07-06 14:36:13 UTC
Hello, The Gentoo Team would like to firstly thank you for your ebuild 
submission. We also apologize for not being able to accommodate you in a timely
manner. There are simply too many new packages.

Allow me to use this opportunity to introduce you to Gentoo Sunrise. The 
sunrise overlay[1] is a overlay for Gentoo which we allow trusted users to 
commit to and all users can have ebuilds reviewed by Gentoo devs for entry 
into the overlay. So, the sunrise team is suggesting that you look into this 
and submit your ebuild to the overlay where even *you* can commit to. =)

Thanks,
On behalf of the Gentoo Sunrise Team,
Michael Weber.

[1]: http://www.gentoo.org/proj/en/sunrise/
[2]: http://overlays.gentoo.org/proj/sunrise/wiki/SunriseFaq
Comment 5 BT 2010-07-31 04:42:39 UTC
Created attachment 240769 [details]
nodm-0.7 ebuild

Minor update to pkg_postinst message.
Comment 6 Greg Dziegielewski 2011-02-22 19:30:18 UTC
Hi. I'm using nodm on my HTPC for some time. I've made my own ebuild for it because i wasn't aware of this one (or even it wasn't here since then).

I have a question: why do you want to use another init script for that?
Why we cannot use original init.d/xdm?

We just need to set DISPLAYMANAGER="nodm" in xdm and voila!

Ok, for making it working ootb we need to wrap it into some kind of launcher (nodm cannot fork into background).

My idea is to make kind of nodm-wrapper which will source /etc/nodm.conf file with all needed variables set there:

# nodm.conf
NODM_USER=nobody
NODM_X_OPTIONS="vt7 -nolisten tcp"

and

#!/bin/sh
source /etc/nodm.conf
/usr/sbin/nodm &
Comment 7 BT 2011-02-22 22:01:01 UTC
(In reply to comment #6)
> I have a question: why do you want to use another init script for that?
> Why we cannot use original init.d/xdm?

I'm aware that using the xdm script works, but I didn't know how to integrate it with the nodm environment variables.

> My idea is to make kind of nodm-wrapper which will source /etc/nodm.conf file
> with all needed variables set there:

Seems like a great idea. I will try it and report my findings.
Comment 8 BT 2011-02-24 00:55:03 UTC
Greg,

I tested your idea and I can get nodm to start an X session, but not without some problems.

- Since we use a wrapper, the xdm script doesn't know the pid of nodm and is then unable to stop or restart it.
- It's unintuitive for users to set DISPLAYMANAGER to 'nodm-wrapper'. It needs to be set to 'nodm'.

I think some progress has been made, but we need to sort out these issues.
Comment 9 Greg Dziegielewski 2011-02-24 07:45:08 UTC
(In reply to comment #8)
> - Since we use a wrapper, the xdm script doesn't know the pid of nodm and is
> then unable to stop or restart it.
Probably doing:

exec nodm

instead of

nodm &

Will do the job :) exec replaces current process (our nodm-wrapper script) with new one (the nodm), so pid stays the same and we are able to stop it.

> - It's unintuitive for users to set DISPLAYMANAGER to 'nodm-wrapper'. It needs
> to be set to 'nodm'.
Yep :( One thing comes to my mind: put original nodm somewhere in /usr/libexec, and put our wrapper script in /usr/bin/nodm

> I think some progress has been made, but we need to sort out these issues.
Yeah! 
Comment 10 Greg Dziegielewski 2011-02-24 07:47:05 UTC
(In reply to comment #9)

But the best thing is to make changes (forking and config loading) inside nodm and (eventually) ask author to apply them.
Comment 11 BT 2011-02-24 22:38:38 UTC
(In reply to comment #9)
Using exec also doesn't work since it then leaves the process in the foreground. We would also need to create the pid file ourselves since nodm doesn't.
Comment 12 BT 2011-02-24 22:40:39 UTC
(In reply to comment #10)
> But the best thing is to make changes (forking and config loading) inside nodm
> and (eventually) ask author to apply them.

I agree. It would be too much of a hack to get it to work as it is.
Comment 13 BT 2011-02-24 23:47:26 UTC
Created attachment 263731 [details, diff]
xdm support for nodm

I got it to work without a wrapper script, but with modifications to the xdm script.

I think we have a better chance of getting nodm support into Gentoo's xdm script, than getting the changes we need from upstream. I will contact the Gentoo dev responsible and see if I can get there feedback.
Comment 14 Greg Dziegielewski 2011-02-25 07:01:27 UTC
(In reply to comment #13)
> Created an attachment (id=263731) [details]
> xdm support for nodm
> 
> I got it to work without a wrapper script, but with modifications to the xdm
> script.
> 
> I think we have a better chance of getting nodm support into Gentoo's xdm
> script, than getting the changes we need from upstream. I will contact the
> Gentoo dev responsible and see if I can get there feedback.
> 
And I'll try to hack nodm sourcecode during the weekend to add forking ability ;) It should be trivial thing.
Comment 15 BT 2012-03-06 23:42:22 UTC
Created attachment 304487 [details]
nodm-0.11 ebuild

Version bump
- New SRC_URI
- Removed -Werror from CFLAGS
Comment 16 Michael Weber (RETIRED) gentoo-dev 2012-03-10 10:40:16 UTC
<rant>

Were's the benefit over adding

'x:3:respawn:/bin/su -c "cd ~; /usr/bin/startx" - <username>'

to /etc/inittab

</rant>

On a personal note, find additional starting X woodoo at 

http://git.overlays.gentoo.org/gitweb/?p=dev/xmw.git;a=tree;f=x11-misc/trivdm/files;hb=HEAD
Comment 17 BT 2012-04-11 03:12:53 UTC
(In reply to comment #16)
I find it much simpler. I just need to set the user to login with and X session to start.

For my setup I also need to have the boot and X startup messages completely hidden which I can't do with inittab and startx.
Comment 18 BT 2012-04-12 06:35:43 UTC
Created attachment 308617 [details]
nodm conf.d
Comment 19 BT 2012-04-12 06:36:08 UTC
Created attachment 308619 [details]
nodm init.d
Comment 20 BT 2012-04-12 06:42:48 UTC
Created attachment 308621 [details]
nodm-0.11 ebuild

Changes:
- Upstream dropped xinit dependency.
- Use system-local-login for pam instead of system-auth. This is useful when the consolekit is installed and session is launched with ck-launch-session. The session will now be marked as local and active.
Comment 21 BT 2012-04-12 06:44:37 UTC
Created attachment 308623 [details, diff]
xdm support for nodm