chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
unit: save description/slice of transient units to /run
[elogind.git]
/
src
/
core
/
main.c
diff --git
a/src/core/main.c
b/src/core/main.c
index 8b8e110f249877a1a447c622a70a7b7df56efd78..efc5791bbc9ff12893e4a60b3117254cd5e030e7 100644
(file)
--- a/
src/core/main.c
+++ b/
src/core/main.c
@@
-1055,15
+1055,16
@@
static int prepare_reexecute(Manager *m, FILE **_f, FDSet **_fds, bool switching
assert(_f);
assert(_fds);
assert(_f);
assert(_fds);
- /* Make sure nothing is really destructed when we shut down */
- m->n_reloading ++;
-
r = manager_open_serialization(m, &f);
if (r < 0) {
log_error("Failed to create serialization file: %s", strerror(-r));
goto fail;
}
r = manager_open_serialization(m, &f);
if (r < 0) {
log_error("Failed to create serialization file: %s", strerror(-r));
goto fail;
}
+ /* Make sure nothing is really destructed when we shut down */
+ m->n_reloading ++;
+ bus_broadcast_reloading(m, true);
+
fds = fdset_new();
if (!fds) {
r = -ENOMEM;
fds = fdset_new();
if (!fds) {
r = -ENOMEM;
@@
-1613,7
+1614,7
@@
int main(int argc, char *argv[]) {
if (arg_running_as == SYSTEMD_SYSTEM)
bump_rlimit_nofile(&saved_rlimit_nofile);
if (arg_running_as == SYSTEMD_SYSTEM)
bump_rlimit_nofile(&saved_rlimit_nofile);
- r = manager_new(arg_running_as, &m);
+ r = manager_new(arg_running_as,
!!serialization,
&m);
if (r < 0) {
log_error("Failed to allocate manager object: %s", strerror(-r));
goto finish;
if (r < 0) {
log_error("Failed to allocate manager object: %s", strerror(-r));
goto finish;
@@
-1942,6
+1943,10
@@
finish:
watchdog_close(true);
}
watchdog_close(true);
}
+ /* avoid the creation of new processes forked by the kernel; at this
+ * point, we will not listen to the signals anyway */
+ cg_uninstall_release_agent(SYSTEMD_CGROUP_CONTROLLER);
+
execve(SYSTEMD_SHUTDOWN_BINARY_PATH, (char **) command_line, env_block);
free(env_block);
log_error("Failed to execute shutdown binary, freezing: %m");
execve(SYSTEMD_SHUTDOWN_BINARY_PATH, (char **) command_line, env_block);
free(env_block);
log_error("Failed to execute shutdown binary, freezing: %m");