There's no need to do this within the block where logging is closed,
hence move it earlier, so that this block can be kept as small as
possible.
assert_se(IN_SET(arg_action, ACTION_RUN, ACTION_TEST));
+ /* Move out of the way, so that we won't block unmounts */
+ assert_se(chdir("/") == 0);
+
/* Close logging fds, in order not to confuse fdset below */
log_close();
setsid();
}
- /* Move out of the way, so that we won't block unmounts */
- assert_se(chdir("/") == 0);
-
/* Reset the console, but only if this is really init and we
* are freshly booted */
if (arg_system && arg_action == ACTION_RUN) {