diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-06-01 17:46:01 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-06-11 12:53:12 +0200 |
commit | c4555ad8f68a9fd0c148c46afd16a81dd5917874 (patch) | |
tree | 1fc1242ffaac7721920d502f8525cdb61f8840c6 /src/basic/unit-def.c | |
parent | 443dee9d2ebbae3b68f1065c5a48d758fb402263 (diff) | |
download | systemd-c4555ad8f68a9fd0c148c46afd16a81dd5917874.tar.gz |
core: introduce a new load state "bad-setting"
Since bb28e68477a3a39796e4999a6cbc6ac6345a9159 parsing failures of
certain unit file settings will result in load failures of units. This
introduces a new load state "bad-setting" that is entered in precisely
this case.
With this addition error messages on bad settings should be a lot more
explicit, as we don't have to show some generic "errno" error in that
case, but can explicitly say that a bad setting is at fault.
Internally this unit load state is entered as soon as any configuration
loader call returns ENOEXEC. Hence: config parser calls should return
ENOEXEC now for such essential unit file settings. Turns out, they
generally already do.
Fixes: #9107
Diffstat (limited to 'src/basic/unit-def.c')
-rw-r--r-- | src/basic/unit-def.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/unit-def.c b/src/basic/unit-def.c index 7361acb297..fd42e0a241 100644 --- a/src/basic/unit-def.c +++ b/src/basic/unit-def.c @@ -93,6 +93,7 @@ static const char* const unit_load_state_table[_UNIT_LOAD_STATE_MAX] = { [UNIT_STUB] = "stub", [UNIT_LOADED] = "loaded", [UNIT_NOT_FOUND] = "not-found", + [UNIT_BAD_SETTING] = "bad-setting", [UNIT_ERROR] = "error", [UNIT_MERGED] = "merged", [UNIT_MASKED] = "masked" |