summaryrefslogtreecommitdiff
path: root/src/analyze/analyze-condition.c
Commit message (Collapse)AuthorAgeFilesLines
* basic: add RuntimeScope enumLennart Poettering2023-03-101-2/+2
| | | | | | | | | | | | In various tools and services we have a per-system and per-user concept. So far we sometimes used a boolean indicating whether we are in system mode, or a reversed boolean indicating whether we are in user mode, or the LookupScope enum used by the lookup path logic. Let's address that, in introduce a common enum for this, we can use all across the board. This is mostly just search/replace, no actual code changes.
* tree-wide: use ASSERT_PTR moreDavid Tardon2022-09-131-3/+1
|
* analyze: allow verbs to return positive failureZbigniew Jędrzejewski-Szmek2022-05-191-1/+7
| | | | | | | | | No functional change is intended. The verbs where it wasn't immediately clear if the success exit status is 0 or >= 0 are changed to explicitly return 0. (I think it's better to be explicit than to rely on some call stack always returning 0 on success.) Some other functions are cleaned up to be more idiomatic.
* Rename UnitFileScope to LookupScopeZbigniew Jędrzejewski-Szmek2022-03-291-1/+1
| | | | | | | | | As suggested in https://github.com/systemd/systemd/pull/22649/commits/8b3ad3983f5440eef812b34e5ed862ca59fdf7f7#r837345892 The define is generalized and moved to path-lookup.h, where it seems to fit better. This allows a recursive include to be removed and in general makes things simpler.
* strv: make iterator in STRV_FOREACH() declaread in the loopYu Watanabe2022-03-191-2/+0
| | | | This also avoids multiple evaluations in STRV_FOREACH_BACKWARDS()
* analyze: systematically name verb entry point functions verb_xyz()Lennart Poettering2022-02-211-1/+1
| | | | | | Some of the functions so far were named do_xyz(), others dump_xyz() and even others test_xyz(). let's instead name them exactly like the verb exposed in the command line, just prefixed with verb_
* analyze: move "condition" verb into analyze-condition.[ch]Lennart Poettering2022-02-211-1/+6
|
* analyze: split out "verify" verb into own .c/.h fileLennart Poettering2022-02-211-1/+1
| | | | | | | This renames the old analyze-verify.[ch] pair → analyze-verify-util.[ch], because it's used by the test logic as well, and by keeping it separate from the verify verb logic we don't have to import the arg_xyz variables.
* mkosi: Add zsh to Arch packagesDaan De Meyer2021-09-011-8/+37
| | | | Useful for testing zsh completion changes.
* systemd-analyze: add --root option for 'verify' verb and allow path parsingMaanya Goenka2021-08-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------------- 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.
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|
* core: remove support for ConditionNull=Lennart Poettering2020-08-201-3/+1
| | | | | | | | | | The concept is flawed, and mostly useless. Let's finally remove it. It has been deprecated since 90a2ec10f2d43a8530aae856013518eb567c4039 (6 years ago) and we started to warn since 55dadc5c57ef1379dbc984938d124508a454be55 (1.5 years ago). Let's get rid of it altogether.
* analyze: rework condition testingLennart Poettering2020-08-201-77/+28
| | | | | | | Let's drop the private table and just use the generic concepts we have in place already that make the same information available. Fixes: #16781
* analyze: make testing ConditionPathExistsGlob= workLennart Poettering2020-07-141-2/+5
| | | | | Fixes: #16439 Alternative-To: #16440
* condition: add ConditionEnvironment=Lennart Poettering2020-05-151-2/+2
| | | | | | | Prompted by the discussions in #15180. This is a bit more complex than I hoped, since for PID 1 we need to pass in the synethetic environment block in we generate on demand.
* condition: add ConditionPathIsEncrypted=Lennart Poettering2020-05-151-0/+2
| | | | | | | It's easy to add, and should be pretty useful, in particular as in AssertPathIsEncrypted= as it can be used for checking that some path is encrypted before some service is invoked that might want to place secure material there.
* analyze: add 'condition' verbZbigniew Jędrzejewski-Szmek2019-06-271-0/+155
We didn't have a straightforward way to parse and evaluate those strings. Prompted by #12881.