For both branches of the if check it's the first line, hence let's just
do it before.
log_set_upgrade_syslog_to_journal(true);
if (getpid_cached() == 1) {
+ /* When we run as PID 1 force system mode */
+ arg_system = true;
+
/* Disable the umask logic */
umask(0);
if (detect_container() <= 0) {
/* Running outside of a container as PID 1 */
- arg_system = true;
log_set_target(LOG_TARGET_KMSG);
log_open();
} else {
/* Running inside a container, as PID 1 */
- arg_system = true;
log_set_target(LOG_TARGET_CONSOLE);
log_open();