diff options
author | Maanya Goenka <t-magoenka@microsoft.com> | 2021-06-30 18:57:54 +0200 |
---|---|---|
committer | Maanya Goenka <t-magoenka@microsoft.com> | 2021-08-10 11:41:12 +0200 |
commit | 2a7cf953e1f5372ccbabed02208de989d396ae51 (patch) | |
tree | 80f00397435e88701af61bc99dcd8dd95e23f6e0 /src/analyze/analyze-verify.h | |
parent | systemd-analyze: validate root argument (diff) | |
download | systemd-2a7cf953e1f5372ccbabed02208de989d396ae51.tar.xz systemd-2a7cf953e1f5372ccbabed02208de989d396ae51.zip |
systemd-analyze: add --root option for 'verify' verb and allow path parsing
-------------------------------------------------------------------------------
Example Run:
foobar.service created below is a service unit file that has a non-existing key-value
pairing (foo = bar) and is thus, syntactically invalid.
maanya-goenka@debian:~/systemd (img-support)$ cat <<EOF>img/usr/lib/systemd/system/foobar.service
> [Unit]
> foo = bar
>
> [Service]
> ExecStart = /opt/script0.sh
> EOF
The failure to create foobar.service because of the recursive dependency searching and verification has been addressed
in a different PR: systemd-analyze: add option to return an error value when unit verification fails #20233
maanya-goenka@debian:~/systemd (img-support)$ sudo build/systemd-analyze verify --root=img/ foobar.service
/home/maanya-goenka/systemd/img/usr/lib/systemd/system/foobar.service:2: Unknown key name 'foo' in section 'Unit', ignoring.
foobar.service: Failed to create foobar.service/start: Unit sysinit.target not found.
Diffstat (limited to 'src/analyze/analyze-verify.h')
-rw-r--r-- | src/analyze/analyze-verify.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/analyze/analyze-verify.h b/src/analyze/analyze-verify.h index 43bfbcbc8c..b547ca6b8d 100644 --- a/src/analyze/analyze-verify.h +++ b/src/analyze/analyze-verify.h @@ -7,4 +7,4 @@ #include "path-lookup.h" int verify_executable(Unit *u, const ExecCommand *exec); -int verify_units(char **filenames, UnitFileScope scope, bool check_man, bool run_generators); +int verify_units(char **filenames, UnitFileScope scope, bool check_man, bool run_generators, const char *root); |