diff --git a/src/core/job.c b/src/core/job.c index ff49136d70..d97cb64d38 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -990,9 +990,10 @@ int job_finish_and_invalidate(Job *j, JobResult result, bool recursive, bool alr j->result = result; - log_unit_debug(u, "Job %" PRIu32 " %s/%s finished, result=%s", j->id, u->id, job_type_to_string(t), job_result_to_string(result)); + log_unit_debug(u, "Job %" PRIu32 " %s/%s finished, result=%s", + j->id, u->id, job_type_to_string(t), job_result_to_string(result)); - /* If this job did nothing to respective unit we don't log the status message */ + /* If this job did nothing to the respective unit we don't log the status message */ if (!already) job_emit_done_status_message(u, j->id, t, result); diff --git a/src/core/target.c b/src/core/target.c index a1d1cfc38a..65affcec19 100644 --- a/src/core/target.c +++ b/src/core/target.c @@ -193,6 +193,8 @@ const UnitVTable target_vtable = { "Target\0" "Install\0", + .can_fail = true, + .load = target_load, .coldplug = target_coldplug, diff --git a/src/test/meson.build b/src/test/meson.build index 4affcd647f..132989f197 100644 --- a/src/test/meson.build +++ b/src/test/meson.build @@ -671,7 +671,8 @@ tests += [ libseccomp, libselinux, libmount, - libblkid]], + libblkid], + '', 'timeout=120'], [['src/test/test-execute.c'], [libcore, diff --git a/src/test/test-path.c b/src/test/test-path.c index 0b2b4ab554..e8844fd5ef 100644 --- a/src/test/test-path.c +++ b/src/test/test-path.c @@ -346,10 +346,8 @@ int main(int argc, char *argv[]) { NULL, }; - _cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL; _cleanup_free_ char *test_path = NULL; - const test_function_t *test = NULL; - Manager *m = NULL; + _cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL; umask(022); @@ -359,7 +357,8 @@ int main(int argc, char *argv[]) { assert_se(set_unit_path(test_path) >= 0); assert_se(runtime_dir = setup_fake_runtime_dir()); - for (test = tests; test && *test; test++) { + for (const test_function_t *test = tests; test && *test; test++) { + Manager *m = NULL; int r; /* We create a clean environment for each test */ diff --git a/units/initrd-fs.target b/units/initrd-fs.target index 1db8fb3a48..33822bde66 100644 --- a/units/initrd-fs.target +++ b/units/initrd-fs.target @@ -10,6 +10,8 @@ [Unit] Description=Initrd File Systems Documentation=man:systemd.special(7) +OnFailure=emergency.target +OnFailureJobMode=replace-irreversibly ConditionPathExists=/etc/initrd-release After=initrd-parse-etc.service DefaultDependencies=no diff --git a/units/initrd-root-device.target b/units/initrd-root-device.target index bc2743e2d5..580c666b23 100644 --- a/units/initrd-root-device.target +++ b/units/initrd-root-device.target @@ -11,5 +11,7 @@ Description=Initrd Root Device Documentation=man:systemd.special(7) ConditionPathExists=/etc/initrd-release +OnFailure=emergency.target +OnFailureJobMode=replace-irreversibly DefaultDependencies=no Conflicts=shutdown.target diff --git a/units/initrd-root-fs.target b/units/initrd-root-fs.target index 26897796af..9b955f618a 100644 --- a/units/initrd-root-fs.target +++ b/units/initrd-root-fs.target @@ -11,5 +11,7 @@ Description=Initrd Root File System Documentation=man:systemd.special(7) ConditionPathExists=/etc/initrd-release +OnFailure=emergency.target +OnFailureJobMode=replace-irreversibly DefaultDependencies=no Conflicts=shutdown.target diff --git a/units/initrd.target b/units/initrd.target index 30b3bd04d2..a74a447c91 100644 --- a/units/initrd.target +++ b/units/initrd.target @@ -10,6 +10,8 @@ [Unit] Description=Initrd Default Target Documentation=man:systemd.special(7) +OnFailure=emergency.target +OnFailureJobMode=replace-irreversibly ConditionPathExists=/etc/initrd-release Requires=basic.target Wants=initrd-root-fs.target initrd-root-device.target initrd-fs.target initrd-parse-etc.service diff --git a/units/local-fs.target b/units/local-fs.target index da3683e948..6ba4930087 100644 --- a/units/local-fs.target +++ b/units/local-fs.target @@ -13,3 +13,5 @@ Documentation=man:systemd.special(7) DefaultDependencies=no Conflicts=shutdown.target After=local-fs-pre.target +OnFailure=emergency.target +OnFailureJobMode=replace-irreversibly