GithubHelp home page GithubHelp logo

nodm's Introduction

THIS REPOSITORY IS NOT MAINTAINED

I do not use nodm anymore. I do not maintain nodm anymore.

To be really functional, nodm needs to be refactored to properly be a display manager with all that it requires in 2019 to be one. It currently does not make any effort to do so, and will break in obscure way as a result.

Nobody should really need nodm anymore: lightdm's autologin now does the right thing out of the box: please use that.

If you are really attached to nodm, please consider maintaining it instead: fork it, remove this section from the README, and turn it into a well done reference implementation of a display manager without a GUI, that integrates well with modern setups like lightdm does. I would applaud you for that!

nodm

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

nodm is as small as it could be, and tries to provide the minimum amount of features needed to do a good job, following as much as possible the principle of least surprise. This is what is offered:

  • 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.
  • nodm performs VT allocation, looking for a free virtual terminal in which to run X and keeping it allocated across X restarts.
  • X is started (by default, /usr/bin/X)
  • once the X esrver is ready to accept connections, the X session is set up:
    • the DISPLAY and WINDOWPATH environment variables are set
    • the session is wrapped in a PAM session, which sets up the user environment
    • ~/.xsession-error is truncated if it exists
  • The session script is run (by default, /etc/X11/Xsession) using "sh -l"
  • If the X server or the X session exit, the other is killed and then both are restarted.
  • If a session exits too soon, nodm will wait a bit before restarting. The waiting times 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.

nodm does NOT currently fork and run in the background like a proper daemon: most distributions have tools that do that, and nodm plays just fine with them. This is not a particular design choice: quite simply, so far no one has felt the need to implement it.

Configuration

Configuration is made via these environment variables:

  • NODM_USER: Controls the user that is used to automatically log in.

  • NODM_X_OPTIONS: X server command line (for example: "vt7 -nolisten tcp"). It is expanded using wordexp, with tilde expansion, variable substitution, arithmetic expansion, wildcard expansion and quote removal, but no command substitution. If command substitution is needed, please get in touch providing a real-life use case for it.

    If the first optiom starts with '/' or '.', it is used as the X server, else "X" is used as the server.

    If the second option (or the first if the first was not recognised as a path to the X server) looks like ":", it is used as the display name, else ":0" is used.

    If the command line contains a "vt" virtual terminal indicator, automatic VT allocation is switched off. Otherwise, the appropriate vt option is appended to the X command line according to the virtual terminal that has been allocated.

  • NODM_MIN_SESSION_TIME: 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 runs for less than this time, nodm will wait an increasing amount of time before restarting it (default: 60).

  • NODM_XSESSION: X session command (default: /etc/X11/Xsession). It is run using the shell, so it can be any shell command.

  • NODM_XINIT Was used by older versions of nodm as the path to the xinit program, but it is now ignored.

  • NODM_X_TIMEOUT Timeout (in seconds) to wait for X to be ready to accept connections. If X is not ready before this timeout, it is killed and restarted.

nodm's People

Contributors

brother avatar edwardbetts avatar em- avatar hramrach avatar lamby avatar lcapello avatar niklasf avatar nomeata avatar rtandy avatar smcv avatar spanezz avatar sunweaver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodm's Issues

Replace nodm with a custom lightdm greeter

For a while I haven't been using nodm anymore and so I had no motivation for keeping it up to date with modern requirements on display managers. Anyone who would like to do that is free to carry on nodm's development.

I recently had a need for autologin again, and satisfied it with a simple custom greeter for lightdm. I would like, at some point, to polish it and make a GitHub repo for it, and in the meantime, here it is.

I find this way more sustainable in the long term, as it outsources most of the display manager development issues to lightdm, which already needs to stay on top of it.

Issue with PAM, failed to create session: Refusing activation.

Hello,

I'm using i3 wm with nodm but I'm getting an issue that sometimes my laptop won't poweroff directly. this is the main error in journalctl: 'pam_systemd(nodm:session): Failed to create session: Refusing activation, D-Bus is shutting down.' So pam won't allow nodm to poweroff but I have made a file like on the wiki in /etc/pam.d.

I've followed the arch wiki:

/etc/nodm.conf:

NODM_USER='sevaho'

NODM_X_OPTIONS='vt7 -nolisten tcp'
NODM_MIN_SESSION_TIME=600
NODM_RESTART_SESSION=0
NODM_XINIT='/usr/bin/xinit'
NODM_XSESSION='/home/sevaho/.xinitrc'

.xinitrc:
(is executable: -rwxr-xr-x)

export XDG_CURRENT DESKTOP=i3
exec i3 -V >> ~/.i3logs/i3log-$(date +'%F-%k-%M-%S') 2>&1

I enabled nodm.service in systemd

/etc/pam.d/nodm

#%PAM-1.0

auth      include  system-login
account   include  system-login
password  include  system-login
session   include  system-login

Here is my journalctl (reverse order)

Feb 01 19:42:53 sevahoLittlePc systemd[1]: nodm.service: Failed with result 'timeout'.
Feb 01 19:42:53 sevahoLittlePc systemd[1]: nodm.service: Unit entered failed state.
Feb 01 19:42:53 sevahoLittlePc systemd[1]: Stopped nodm display manager.
Feb 01 19:42:51 sevahoLittlePc systemd[1]: nodm.service: Main process exited, code=killed, status=9/KILL
Feb 01 19:42:51 sevahoLittlePc systemd[1]: nodm.service: Killing process 27034 (n/a) with signal SIGKILL.
Feb 01 19:42:51 sevahoLittlePc systemd[1]: nodm.service: Killing process 27032 (bandwidth) with signal SIGKILL.
Feb 01 19:42:51 sevahoLittlePc systemd[1]: nodm.service: Killing process 27031 (bandwidth) with signal SIGKILL.
Feb 01 19:42:51 sevahoLittlePc systemd[1]: nodm.service: Killing process 26887 (termite) with signal SIGKILL.
Feb 01 19:42:51 sevahoLittlePc systemd[1]: nodm.service: Killing process 26386 (i3blocks) with signal SIGKILL.
Feb 01 19:42:51 sevahoLittlePc systemd[1]: nodm.service: Killing process 26382 (i3bar) with signal SIGKILL.
Feb 01 19:42:51 sevahoLittlePc systemd[1]: nodm.service: Killing process 26374 (i3) with signal SIGKILL.
Feb 01 19:42:51 sevahoLittlePc systemd[1]: nodm.service: Killing process 26372 (nodm) with signal SIGKILL.
Feb 01 19:42:51 sevahoLittlePc systemd[1]: nodm.service: Killing process 26304 (Xorg) with signal SIGKILL.
Feb 01 19:42:51 sevahoLittlePc systemd[1]: nodm.service: Killing process 259 (nodm) with signal SIGKILL.
Feb 01 19:42:51 sevahoLittlePc systemd[1]: nodm.service: State 'stop-sigterm' timed out. Killing.
Feb 01 19:41:26 sevahoLittlePc systemd[1]: Stopped D-Bus System Message Bus.
Feb 01 19:41:26 sevahoLittlePc systemd[1]: Stopped Authorization Manager.
Feb 01 19:41:26 sevahoLittlePc systemd[1]: Stopping Authorization Manager...
Feb 01 19:41:26 sevahoLittlePc systemd[1]: Stopping D-Bus System Message Bus...
Feb 01 19:41:26 sevahoLittlePc systemd[1]: Stopped firewalld - dynamic firewall daemon.
Feb 01 19:41:25 sevahoLittlePc kernel: Ebtables v2.0 unregistered
ERROR -> Feb 01 19:41:25 sevahoLittlePc nodm[26372]: pam_systemd(nodm:session): Failed to create session: Refusing activation, D-Bus is shutting down.
Feb 01 19:41:25 sevahoLittlePc dbus[253]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.login1.service': Refusing activation, D-Bus is shutting do
Feb 01 19:41:25 sevahoLittlePc dbus[253]: [system] Activating via systemd: service name='org.freedesktop.login1' unit='dbus-org.freedesktop.login1.service'
Feb 01 19:41:25 sevahoLittlePc nodm[26372]: pam_unix(nodm:session): session opened for user sevaho by (uid=0)
Feb 01 19:41:25 sevahoLittlePc nodm[26372]: Successful su on ??? for sevaho by root
Feb 01 19:41:25 sevahoLittlePc nodm[26372]: Authentication failure (Ignored)
Feb 01 19:41:25 sevahoLittlePc nodm[259]: System is going down.
Feb 01 19:41:23 sevahoLittlePc nodm[259]: (==) Using system config directory "/usr/share/X11/xorg.conf.d"
Feb 01 19:41:23 sevahoLittlePc nodm[259]: (==) Using config directory: "/etc/X11/xorg.conf.d"
Feb 01 19:41:23 sevahoLittlePc nodm[259]: (==) Log file: "/var/log/Xorg.0.log", Time: Wed Feb  1 19:41:23 2017
Feb 01 19:41:23 sevahoLittlePc nodm[259]:         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
Feb 01 19:41:23 sevahoLittlePc nodm[259]:         (++) from command line, (!!) notice, (II) informational,
Feb 01 19:41:23 sevahoLittlePc nodm[259]: Markers: (--) probed, (**) from config file, (==) default setting,
Feb 01 19:41:23 sevahoLittlePc nodm[259]:         to make sure that you have the latest version.
Feb 01 19:41:23 sevahoLittlePc nodm[259]:         Before reporting problems, check [url]http://wiki.x.org[/url]
Feb 01 19:41:23 sevahoLittlePc nodm[259]: Current version of pixman: 0.34.0
Feb 01 19:41:23 sevahoLittlePc nodm[259]:
Feb 01 19:41:23 sevahoLittlePc nodm[259]: Build Date: 12 January 2017  07:11:40AM
Feb 01 19:41:23 sevahoLittlePc nodm[259]: Kernel command line: initrd=\initramfs-linux.img initrd=\intel-ucode.img root=PARTUUID=9e7311d4-298b-4ee3-8df1-1abe4ddba00f rw
Feb 01 19:41:23 sevahoLittlePc nodm[259]: Current Operating System: Linux sevahoLittlePc 4.9.6-1-ARCH #1 SMP PREEMPT Thu Jan 26 09:22:26 CET 2017 x86_64
Feb 01 19:41:23 sevahoLittlePc nodm[259]: Build Operating System: Linux 4.8.14-1-ARCH x86_64
Feb 01 19:41:23 sevahoLittlePc nodm[259]: X Protocol Version 11, Revision 0
Feb 01 19:41:23 sevahoLittlePc nodm[259]: Release Date: 2017-01-11
Feb 01 19:41:23 sevahoLittlePc nodm[259]: X.Org X Server 1.19.1
Feb 01 19:41:23 sevahoLittlePc nodm[259]: restarting session
Feb 01 19:41:23 sevahoLittlePc systemd[1]: Stopping firewalld - dynamic firewall daemon...
Feb 01 19:41:23 sevahoLittlePc systemd[1]: Stopped target Network (Pre).
Feb 01 19:41:23 sevahoLittlePc systemd[1]: Removed slice system-netctl.slice.
Feb 01 19:41:23 sevahoLittlePc nodm[259]: (II) Server terminated successfully (0). Closing log file.

Anyone know how to fix this, or tell me if I did something wrong?

Using nodm display manager

Hey ;)

I am having a general question using the nodm displaymanager and maybe you can help me. I want to start a GUI Application while startup CENTOS operating system without using KDE. For this I want to use the nodm display manager. I read that i only have to edit the nodm.conf file. I enabled it and set the user as root in this file. But when I want to start the GUI it is still showing from the terminal, that it cannot start the X-application. Maybe you can help me.. Thank you so much for reading and helping

Cheers

Detect X server exit status instead of doing timeouts

There are 3 reasons why server exited:

  1. Crash;
  2. Configuration error;
  3. User initiative (including Ctrl + Alt + Backspace).

Usually they are differentiated by exit code (it also includes signal which caused termination). That's what nodm must do correspondingly:

  1. Restart and if crashed again in short timeout exit without further restarts;
  2. Exit immediately;
  3. Restart (without timeouts) or exit depending on configuration.

So timeout should be accounted only for crash and only one time (who needs X server crashing more frequently than working).

Automated Install??

When installing on Ubuntu (Raspberry Pi) using "sudo apt-get install nodm -y" the install prompts to ask if I want to enable nodm. Is there way to disable the prompt and just install nodm??

NODM Does Not Start at Boot

I'm trying to get nodm working on the latest raspbian os running on a raspberry pi 3b+. i have this working on an older version of the os so i'm familiar with the setup.

i have nodem installed and it does work, but only if i do "systemctl start nodm" after i login. not sure what is wrong but i expect that nodm will start at boot, but that doesn't seem to be happening. what can i check to see why this isn't working?

When systemd tries to kill nodm, nodm restarts itself instead

I suppose systemd is trying to kill the wrong PID. Eventually, the kill operation times out and systemd hard-kills the process. This happens, for example, when trying to reboot or halt the computer.

Arch Linux, everything up to date.
Nodm version 0.12

Here's the systemd service file:

[Unit]
Description=nodm display manager

[Service]
EnvironmentFile=/etc/nodm.conf
ExecStart=/usr/bin/nodm

[Install]
WantedBy=multi-user.target

XDG vars not set

Hi,

When I use nodm on Arch Linux, the XDG_... variables are not set in the X session. I think this causes systemctl --user etc. to fail with "Failed to connect to bus: No such file or directory". strace shows that the error message comes from it trying to open /sys/fs/kdbus/1000-user/bus, and my kernel doesn't have kdbus. ltrace shows that it tries to read XDG_RUNTIME_DIR before accessing the kdbus path, which is not set in this situation. If I run XDG_RUNTIME_DIR=/var/run/user/1000 systemctl --user status, then the command works.

I.e.:

sudo systemctl enable sddm && reboot, start a terminal in X - XDG variables are there.
sudo systemctl disable sddm && sudo systemctl enable nodm && reboot, start a terminal in X - XDG variables are not there.

I understand that the variables are being set by pam_systemd, so it's not due to my .xinitrc.

Did I do something wrong, or..?

[SECURITY] nodm runs X server without -auth by default, allowing any user to connect

Hi, I realize this project is no longer maintained, I'm filing this mostly out of due diligence and for future readers.

I accidentally noticed that any local user can connect to DISPLAY=:0, even without access to the .Xauthority file, or XAUTHORITY environment variable, or any additional xauth / xhost configuration permitting them. In the end (with help from susi on #archlinux) this was narrowed down to nodm running Xorg without -auth.

I configured nodm according to its suggested configuration, i.e. NODM_X_OPTIONS='vt7 -nolisten tcp'.

startx does configure an auth file and place it the server's command line using -auth, so this problem does not occur when launching the X server via getty -> startx.

Suggesting adding x11-xserver-utils to minimum install instructions

I'm noting that with the Raspbian Buster Lite + xserver-xorg + nodm minimalistic installation, you're missing the xset command which is useful for adjusting things like turning off the Energy Start features.

sudo apt-get install x11-xserver-utils
xset s off
xset -dpms
xset s noblank

This might possibly be useful but then again, maybe it's not an issue. (I'm currently troubleshooting a reboot issue on a Pi4B with a display which sleeps every reboot cycle in such a way that the Pi won't continue without user intervention on the display's power button.)

NODM not Registering Long Click/Right Click

My Nodm session is recognizing a long touch or right click using a mouse. What's unique is that if I stop NODM and startx, long touch and Right Click are registering perfectly. Not sure what to do here. Any suggestions?

Specify Xserver

I am setting up a machine with multiple seats where some seats use a nonstandard X server. The X servers for all seats are working fine and will not conflict with each other, but there can only be one /usr/bin/X.

NODM_X_OPTIONS not used correctly

According to the documentation If the second option (or the first if the first was not recognised as a path to the X server) looks like ":", it is used as the display name, else ":0" is used.

However, when I run
NODM_X_OPTIONS=":1" sudo nodm

I still get the message that another x server is already running in display :0.

I would expect it to try and run an x server on display :1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.