-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shutdown -h h:m broken, shuts down the system immediately #1120
Comments
|
@jsynacek this is probably for you |
|
Works for me on Fedora Rawhide: Is the action blocked by AppArmor? Is there anything interesting in the logs? Maybe polkit is blocking the action? |
|
AppArmor is not enabled. As for polkit: I issued that command as root, so I don't think it should have any effect. |
Why does a failed wall message trigger an immediate shutdown? That sounds wrong. |
|
fwiw, this is from a minimal chroot, no desktop session or polkit agent running. |
|
I'm also seeing this in the journal, when that happens: |
|
and the backtrace |
|
@jsynacek I'm able to reproduce the problem in a fedora rawhide VM with systemd v225 as well. |
|
Confirming as well on Ubuntu with systemd v225 (225-1ubuntu1) where systemd-logind segfault when you shutdown at any giving time as soon as the wall message prints. |
|
I can reproduce this as well, the important part is that there is no polkit installed. |
|
@poettering I applied both patches, but they didn't help. Assertion 's' failed at src/basic/util.c:1520, function cescape(). Aborting. I don't know why, but, at least on my machine, after SetWallMessage is called over dbus, the method_set_wall_message() handler in logind-dbus.c calls "sd_bus_message_read(message, "sb", &wall_message, &enable_wall_messages);", which for some reason passes but leaves wall_message undefined. Any idea why that might happen? |
|
This should fix it: diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 7cc68d4..beae75e 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -1796,9 +1796,11 @@ static int update_schedule_file(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to create shutdown subdirectory: %m");
- t = cescape(m->wall_message);
- if (!t)
- return log_oom();
+ if (!isempty(m->wall_message)) {
+ t = cescape(m->wall_message);
+ if (!t)
+ return log_oom();
+ }
r = fopen_temporary("/run/systemd/shutdown/scheduled", &f, &temp_path);
if (r < 0) |
|
Btw., this is a regression from: |
We treat an empty wall-message equal to a NULL wall-message since:
commit 5744f59
Author: Lennart Poettering <lennart@poettering.net>
Date: Fri Sep 4 10:34:47 2015 +0200
logind: treat an empty wall message like a NULL one
Fix the shutdown scheduler to not deref a NULL pointer, but properly
check for an empty wall-message.
Fixes: systemd#1120
|
@dvdhrm confirmed fixed with those patches applied, thanks! Closing the bug report. |
|
@dvdhrm Thanks for fixing this! |
We treat an empty wall-message equal to a NULL wall-message since:
commit 5744f59
Author: Lennart Poettering <lennart@poettering.net>
Date: Fri Sep 4 10:34:47 2015 +0200
logind: treat an empty wall message like a NULL one
Fix the shutdown scheduler to not deref a NULL pointer, but properly
check for an empty wall-message.
Fixes: systemd#1120
|
Still broken or reverted: Not sure how this is possible. |
|
This is fixed with commit 0671d7f. This will be part of the next release. In the meantime, could you try the current git head, or ask your distribution to cherry-pick the commit, please? |
Version: 225
Bug-Debian: http://bugs.debian.org/797763
After upgrading systemd from 224-2 to 225-1 shutdown at a scheduled time (shutdown h:m) shuts down the system immediately, not at
the scheduled time.
Using systemd 224-2 it works correctly, shutting down at the scheduled time according to /var/run/systemd/shutdown/scheduled.
A git bisect shows 9ef1502 as the faulty commit and reverting that indeed fixes the issue.
The text was updated successfully, but these errors were encountered: