diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2015-09-22 22:56:01 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2015-09-22 22:56:01 +0200 |
commit | 8ebfe0cbaad12b55fd022650a841149a548d3e60 (patch) | |
tree | ed88fa317b77ad89f4d9a7841465306edac7b90b /src/core/main.c | |
parent | 3c0fffb74ef7ea572182d9637847e950e9a3a922 (diff) |
core: fix shutdown of --user
Shutting down a user session currently fails with:
Sep 22 22:35:38 david-t2 systemd[640]: Reached target Shutdown.
Sep 22 22:35:38 david-t2 systemd[640]: Starting Exit the Session...
Sep 22 22:35:38 david-t2 systemd[640]: Received SIGRTMIN+24 from PID 659 (kill).
Sep 22 22:35:38 david-t2 systemd[640]: Shutting down.
Sep 22 22:35:38 david-t2 systemd[640]: Not executed by init (PID 1).
Sep 22 22:35:38 david-t2 systemd[640]: Critical error while doing system shutdown: Operation not permitted
This is a regression from:
commit 287419c119ef961db487a281162ab037eba70c61
Author: Alban Crequy <alban.crequy@gmail.com>
Date: Fri Sep 18 13:37:34 2015 +0200
containers: systemd exits with non-zero code
Make sure we never ever execute systemd-shutdown from within a
user-manager. Restore the previous behavior by partially reverting given
commit.
Diffstat (limited to 'src/core/main.c')
-rw-r--r-- | src/core/main.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/main.c b/src/core/main.c index 9c1f8648e7..b57f4c1b7a 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1807,6 +1807,13 @@ int main(int argc, char *argv[]) { goto finish; case MANAGER_EXIT: + if (m->running_as == MANAGER_USER) { + retval = EXIT_SUCCESS; + log_debug("Exit."); + goto finish; + } + + /* fallthrough */ case MANAGER_REBOOT: case MANAGER_POWEROFF: case MANAGER_HALT: |