Merge pull request #16542 from keszybz/make-targets-fail-again

Make targets fail again
This commit is contained in:
Lennart Poettering 2020-07-23 08:37:47 +02:00 committed by GitHub
commit 00b868e857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 20 additions and 7 deletions

View File

@ -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);

View File

@ -193,6 +193,8 @@ const UnitVTable target_vtable = {
"Target\0"
"Install\0",
.can_fail = true,
.load = target_load,
.coldplug = target_coldplug,

View File

@ -671,7 +671,8 @@ tests += [
libseccomp,
libselinux,
libmount,
libblkid]],
libblkid],
'', 'timeout=120'],
[['src/test/test-execute.c'],
[libcore,

View File

@ -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 */

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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