summaryrefslogtreecommitdiff
path: root/src/path
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-03-24 16:04:50 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-03-27 20:12:45 +0100
commit9c5bb2033db0c0927593b929ff760b69295a9f70 (patch)
tree0580eaaf44600f2562bdabd53c8ee981879fef95 /src/path
parentce7eb6aa84b24d411ede7ed570faba78ee084493 (diff)
downloadsystemd-9c5bb2033db0c0927593b929ff760b69295a9f70.tar.gz
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.
Diffstat (limited to 'src/path')
-rw-r--r--src/path/path.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/path/path.c b/src/path/path.c
index 26252948c5..aefdae1d51 100644
--- a/src/path/path.c
+++ b/src/path/path.c
@@ -58,6 +58,29 @@ static const char* const path_table[_SD_PATH_MAX] = {
[SD_PATH_SEARCH_CONFIGURATION_FACTORY] = "search-configuration-factory",
[SD_PATH_SEARCH_STATE_FACTORY] = "search-state-factory",
[SD_PATH_SEARCH_CONFIGURATION] = "search-configuration",
+
+ [SD_PATH_SYSTEMD_UTIL_DIR] = "systemd-util-dir",
+ [SD_PATH_SYSTEMD_SYSTEM_UNIT_DIR] = "systemd-system-unit-dir",
+ [SD_PATH_SYSTEMD_SYSTEM_PRESET_DIR] = "systemd-system-preset-dir",
+ [SD_PATH_SYSTEMD_USER_UNIT_DIR] = "systemd-user-unit-dir",
+ [SD_PATH_SYSTEMD_USER_PRESET_DIR] = "systemd-user-preset-dir",
+ [SD_PATH_SYSTEMD_SYSTEM_CONF_DIR] = "systemd-system-conf-dir",
+ [SD_PATH_SYSTEMD_USER_CONF_DIR] = "systemd-user-conf-dir",
+ [SD_PATH_SYSTEMD_SYSTEM_UNIT_PATH] = "systemd-system-unit-path",
+ [SD_PATH_SYSTEMD_USER_UNIT_PATH] = "systemd-user-unit-path",
+ [SD_PATH_SYSTEMD_SYSTEM_GENERATOR_DIR] = "systemd-system-generator-dir",
+ [SD_PATH_SYSTEMD_USER_GENERATOR_DIR] = "systemd-user-generator-dir",
+ [SD_PATH_SYSTEMD_SYSTEM_GENERATOR_PATH] = "systemd-system-generator-path",
+ [SD_PATH_SYSTEMD_USER_GENERATOR_PATH] = "systemd-user-generator-path",
+ [SD_PATH_SYSTEMD_SLEEP_DIR] = "systemd-sleep-dir",
+ [SD_PATH_SYSTEMD_SHUTDOWN_DIR] = "systemd-shutdown-dir",
+
+ [SD_PATH_TMPFILES_DIR] = "tmpfiles-dir",
+ [SD_PATH_SYSUSERS_DIR] = "sysusers-dir",
+ [SD_PATH_SYSCTL_DIR] = "sysctl-dir",
+ [SD_PATH_BINFMT_DIR] = "binfmt-dir",
+ [SD_PATH_MODULES_LOAD_DIR] = "modules-load-dir",
+ [SD_PATH_CATALOG_DIR] = "catalog-dir",
};
static int list_homes(void) {