summaryrefslogtreecommitdiff
path: root/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-04-07 15:35:01 +0200
committerLennart Poettering <lennart@poettering.net>2010-04-07 15:35:01 +0200
commit0571e0111d76cf96aa4069d9c7a6e24d97aa7e48 (patch)
tree02b645afb04187ae5bcea4026960da62342b345f /manager.c
parentac8cfcf56c5d7b3eaeec64e94f6c4659e82a2b10 (diff)
build-sys: automatically detect SysV init dirs
Diffstat (limited to 'manager.c')
-rw-r--r--manager.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/manager.c b/manager.c
index 6c73acf403..7adaa4ed0b 100644
--- a/manager.c
+++ b/manager.c
@@ -232,10 +232,24 @@ static int manager_find_paths(Manager *m) {
NULL)))
return -ENOMEM;
}
+
+ if ((e = getenv("SYSTEMD_SYSVRCND_PATH")))
+ if (!(m->sysvrcnd_path = split_path_and_make_absolute(e)))
+ return -ENOMEM;
+
+ if (strv_isempty(m->sysvrcnd_path)) {
+ strv_free(m->sysvrcnd_path);
+
+ if (!(m->sysvrcnd_path = strv_new(
+ SYSTEM_SYSVRCND_PATH, /* /etc/rcN.d/ */
+ NULL)))
+ return -ENOMEM;
+ }
}
strv_uniq(m->unit_path);
strv_uniq(m->sysvinit_path);
+ strv_uniq(m->sysvrcnd_path);
assert(!strv_isempty(m->unit_path));
if (!(t = strv_join(m->unit_path, "\n\t")))
@@ -253,6 +267,16 @@ static int manager_find_paths(Manager *m) {
} else
log_debug("Ignoring SysV init scripts.");
+ if (!strv_isempty(m->sysvrcnd_path)) {
+
+ if (!(t = strv_join(m->sysvrcnd_path, "\n\t")))
+ return -ENOMEM;
+
+ log_debug("Looking for SysV rcN.d links in:\n\t%s", t);
+ free(t);
+ } else
+ log_debug("Ignoring SysV rcN.d links.");
+
return 0;
}
@@ -363,6 +387,7 @@ void manager_free(Manager *m) {
strv_free(m->unit_path);
strv_free(m->sysvinit_path);
+ strv_free(m->sysvrcnd_path);
free(m->cgroup_controller);
free(m->cgroup_hierarchy);