Merge pull request #16542 from keszybz/make-targets-fail-again
Make targets fail again
This commit is contained in:
commit
00b868e857
|
@ -990,9 +990,10 @@ int job_finish_and_invalidate(Job *j, JobResult result, bool recursive, bool alr
|
||||||
|
|
||||||
j->result = result;
|
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)
|
if (!already)
|
||||||
job_emit_done_status_message(u, j->id, t, result);
|
job_emit_done_status_message(u, j->id, t, result);
|
||||||
|
|
||||||
|
|
|
@ -193,6 +193,8 @@ const UnitVTable target_vtable = {
|
||||||
"Target\0"
|
"Target\0"
|
||||||
"Install\0",
|
"Install\0",
|
||||||
|
|
||||||
|
.can_fail = true,
|
||||||
|
|
||||||
.load = target_load,
|
.load = target_load,
|
||||||
.coldplug = target_coldplug,
|
.coldplug = target_coldplug,
|
||||||
|
|
||||||
|
|
|
@ -671,7 +671,8 @@ tests += [
|
||||||
libseccomp,
|
libseccomp,
|
||||||
libselinux,
|
libselinux,
|
||||||
libmount,
|
libmount,
|
||||||
libblkid]],
|
libblkid],
|
||||||
|
'', 'timeout=120'],
|
||||||
|
|
||||||
[['src/test/test-execute.c'],
|
[['src/test/test-execute.c'],
|
||||||
[libcore,
|
[libcore,
|
||||||
|
|
|
@ -346,10 +346,8 @@ int main(int argc, char *argv[]) {
|
||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
_cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL;
|
|
||||||
_cleanup_free_ char *test_path = NULL;
|
_cleanup_free_ char *test_path = NULL;
|
||||||
const test_function_t *test = NULL;
|
_cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL;
|
||||||
Manager *m = NULL;
|
|
||||||
|
|
||||||
umask(022);
|
umask(022);
|
||||||
|
|
||||||
|
@ -359,7 +357,8 @@ int main(int argc, char *argv[]) {
|
||||||
assert_se(set_unit_path(test_path) >= 0);
|
assert_se(set_unit_path(test_path) >= 0);
|
||||||
assert_se(runtime_dir = setup_fake_runtime_dir());
|
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;
|
int r;
|
||||||
|
|
||||||
/* We create a clean environment for each test */
|
/* We create a clean environment for each test */
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Initrd File Systems
|
Description=Initrd File Systems
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
|
OnFailure=emergency.target
|
||||||
|
OnFailureJobMode=replace-irreversibly
|
||||||
ConditionPathExists=/etc/initrd-release
|
ConditionPathExists=/etc/initrd-release
|
||||||
After=initrd-parse-etc.service
|
After=initrd-parse-etc.service
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
|
|
|
@ -11,5 +11,7 @@
|
||||||
Description=Initrd Root Device
|
Description=Initrd Root Device
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
ConditionPathExists=/etc/initrd-release
|
ConditionPathExists=/etc/initrd-release
|
||||||
|
OnFailure=emergency.target
|
||||||
|
OnFailureJobMode=replace-irreversibly
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Conflicts=shutdown.target
|
Conflicts=shutdown.target
|
||||||
|
|
|
@ -11,5 +11,7 @@
|
||||||
Description=Initrd Root File System
|
Description=Initrd Root File System
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
ConditionPathExists=/etc/initrd-release
|
ConditionPathExists=/etc/initrd-release
|
||||||
|
OnFailure=emergency.target
|
||||||
|
OnFailureJobMode=replace-irreversibly
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Conflicts=shutdown.target
|
Conflicts=shutdown.target
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Initrd Default Target
|
Description=Initrd Default Target
|
||||||
Documentation=man:systemd.special(7)
|
Documentation=man:systemd.special(7)
|
||||||
|
OnFailure=emergency.target
|
||||||
|
OnFailureJobMode=replace-irreversibly
|
||||||
ConditionPathExists=/etc/initrd-release
|
ConditionPathExists=/etc/initrd-release
|
||||||
Requires=basic.target
|
Requires=basic.target
|
||||||
Wants=initrd-root-fs.target initrd-root-device.target initrd-fs.target initrd-parse-etc.service
|
Wants=initrd-root-fs.target initrd-root-device.target initrd-fs.target initrd-parse-etc.service
|
||||||
|
|
|
@ -13,3 +13,5 @@ Documentation=man:systemd.special(7)
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
Conflicts=shutdown.target
|
Conflicts=shutdown.target
|
||||||
After=local-fs-pre.target
|
After=local-fs-pre.target
|
||||||
|
OnFailure=emergency.target
|
||||||
|
OnFailureJobMode=replace-irreversibly
|
||||||
|
|
Loading…
Reference in a new issue