Commit Graph

4 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 2e09fa8906 sd-path: handle case of missing runtime dir in test
Also document it in the man page.
2020-03-27 20:12:45 +01:00
Zbigniew Jędrzejewski-Szmek f1bb691a5a sd-path: export "systemd-network-path"
Inspired by https://lists.freedesktop.org/archives/systemd-devel/2020-March/044169.html.
2020-03-27 20:12:45 +01:00
Zbigniew Jędrzejewski-Szmek 9c5bb2033d path: show various systemd directories and search paths too
So far we had various ad hoc APIs to query search paths:
systemd-analyze unit-paths, lookup_paths_log(), the pkgconfig file,
debug logs emitted by systemd-analyze cat-config.
But answering a simple question "what is the search path for tmpfiles,
sysusers, .network files, ..." is surprisingly hard.

I think we should have an api that makes it easy to query this. Pkgconfig is
not bad, but it is primarily a development tool, so it's not available in many
context. Also it can't provide support for paths which are influenced by
environment variables, and I'd like to be able to answer the question "what is
the search path for ..., assuming that VAR_FOO=... is set?".

Extending sd-path to support more of our internal paths seems to be most
flexible solution. We already have systemd-path which provides a nice
way to query, and we can add stuff like optional descriptions later on.
We we essentially get a nice programmatic and commmandline apis for the price
of one.
2020-03-27 20:12:45 +01:00
Zbigniew Jędrzejewski-Szmek b35ed5530b man: add sd_path_lookup(3) 2020-03-27 20:12:44 +01:00