]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/main.c
systemd-analyze: add --root option for 'verify' verb and allow path parsing
authorMaanya Goenka <t-magoenka@microsoft.com>
Wed, 30 Jun 2021 16:57:54 +0000 (09:57 -0700)
committerMaanya Goenka <t-magoenka@microsoft.com>
Tue, 10 Aug 2021 09:41:12 +0000 (02:41 -0700)
commit2a7cf953e1f5372ccbabed02208de989d396ae51
tree80f00397435e88701af61bc99dcd8dd95e23f6e0
parent782671bc8f580835a917ac712fe6dc0d17205bd5
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.
21 files changed:
man/systemd-analyze.xml
shell-completion/bash/systemd-analyze
shell-completion/zsh/_systemd-analyze
src/analyze/analyze-condition.c
src/analyze/analyze-verify.c
src/analyze/analyze-verify.h
src/analyze/analyze.c
src/core/main.c
src/core/manager.c
src/core/manager.h
src/test/test-bpf-firewall.c
src/test/test-bpf-foreign-programs.c
src/test/test-cgroup-mask.c
src/test/test-cgroup-unit-default.c
src/test/test-engine.c
src/test/test-execute.c
src/test/test-load-fragment.c
src/test/test-path.c
src/test/test-sched-prio.c
src/test/test-socket-bind.c
src/test/test-watch-pid.c