nodm
nodm copied to clipboard
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
same with me, sometime i have to press on power button to turnoff the laptop
This should be solved by https://github.com/spanezz/nodm/commit/ede6a3ff5249932963fdce5d337c3cfbdf0ef01a.
Feel free to reopen, if not.
Doesn't look like it is.
Not fixed for me either with version 0.13-1.3.
As far as I can tell, not fixed.
@sunweaver can you please reopen the issue? It seems that it is still relevant
@r-darwish: Ack. Reopened. Patches are welcome!
Could this line be what cause this issue? It seems like once the session lasted longer than NODM_MIN_SESSION_TIME
, it shouldn't be restarted if it ends. Changing it to something like return E_SUCCESS;
should do the trick.
Also, I tried and failed to get my build of nodm working on my computer to test this change. I don't want to submit a completely untested pull request.
I just found this old bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=531869 You think it's somehow related?
This is very annoying. Any idea whats going on? Anyone working on it? I think nodm is ignoring system run levels. It shouldn't restart itself when system is moving into restart/shutdown levels
Actually, it's probably systemd killing the wrong PID.
Quoting Félix Sanz (2017-08-02 22:22:30)
This is very annoying. Any idea whats going on? Anyone working on it? I think nodm is ignoring system run levels. It shouldn't restart itself when system is moving into restart/shutdown levels
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/spanezz/nodm/issues/5#issuecomment-319802619
This sounds pretty similar to my Debian bug report: https://bugs.debian.org/785592
It's probably the same problem. I reported this here because the Arch maintainer told me to.
On Fri, Aug 04, 2017 at 05:31:23PM +0000, Ryan Tandy wrote:
This sounds pretty similar to my Debian bug report: https://bugs.debian.org/785592
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/spanezz/nodm/issues/5#issuecomment-320307792
-- Michishige Kaito
BOFH excuse #106:
The electrician didn't know what the yellow cable was so he yanked the ethernet out.
I'm also experiencing this issue, though it doesn't seem to be deterministic, sometimes it shuts down cleanly. My guess based on the logs and a look at the code:
- session is killed by systemd
- nodm_display_manager_wait has E_SESSION_DIED
- before shutdown_quit_notification is called nodm receives SIGTERM, interrupt sets quit_signal_caught
- nodm_display_manager_wait returns E_SESSION_DIED
- nodm_display_manager_wait_restart_loop restarts the session, loops around reentering nodm_display_manager_wait, which clears quit_signal_caught
Is there a reason the signal is not acted on immediately by exiting in the handler?
This fixes for me.
Hi,
On So 27 Aug 2017 07:55:53 CEST, slashblog wrote:
This fixes for
me.
Please file a PR, add proper "Fixes
message of the above commit.
Thanks! Mike
DAS-NETZWERKTEAM mike gabriel, herweg 7, 24357 fleckeby mobile: +49 (1520) 1976 148 landline: +49 (4354) 8390 139
GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22 0782 9AF4 6B30 2577 1B31 mail: [email protected], http://das-netzwerkteam.de
I have created the following pull request: it works for me. The following describes the issue:
The issue is that shutdown_quit_notification blocks signals. In nodm_display_manager_wait function there is waitpid call. This returns -1 if signal was received before session (dm->session.pid) was closed by systemctl. This is the happy scenario.
However, if session gets closed before signal was sent to the process. The waitpid returns dm->session.pid and the call to shutdown_quit_notification blocks SIGTERM. Due to this, catch_signals is never called and nodm proceeds to restarting display manager.
I have removed function shutdown_quit_notification altogether, as I don't see any need for it, since IMO there is no need to block these signals.
I wonder if there's any need for the custom signal handling at all in the parent process. My solution was to remove it all and let the kernel exit/clean up. It works for my use case but I'm probably missing something.
This bug is open since years ago! Almost two years! Seriously? I have to develop it myself?!
@aario you just better spend time with math subtracting. 2018 - 2016 = 2
@aario dgw's pull request fixes the bug, so you don't actually have to develop anything yourself. Just merge the pull request into your repo. Nodm seems unmaintained though.
See #8, seems it needs a new maintainer, or it will "die".
@aario you just better spend time with math subtracting. 2018 - 2016 = 2
Fixed my comment. (That was midnight! ;-) )
@aario dgw's pull request fixes the bug, so you don't actually have to develop anything yourself. Just merge the pull request into your repo. Nodm seems unmaintained though.
Thanks for pointing me to right direction.
I'm using nodm on a mac mini without a keyboard/mouse. Nodm logs me in, .xinitrc startx i3 and synergy It maybe dead but it does the job in my case.
This may not the best way to handle this but it works for me I've added this to /usr/lib/systemd/system/nodm.service
ExecStop=killall -9 nodm
shuts down every time
The bug is still here in Debian testing (bullseye)
For me, ExecStop=killall -9 nodm
in /lib/systemd/system/nodm.service
fix the bug in Debian testing.
Nodm doesn't restart my session when .xinitrc
run systemctl poweroff
.
Howewer, when I service nodm stop
, the display doesn't back to "tty1".