X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fpath-lookup.c;h=3d16e37d0232342849979c01f514e78fadca18b2;hb=30ab6a0fc1bb950c4dcd90dcd3dfe00a810c7fc1;hp=fb2c2c233a0d86c7c0814368762ae3e3f41708a5;hpb=a8ffe6fbcbfdba39aef8dce8b298b3e0cb377c0e;p=elogind.git diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c index fb2c2c233..3d16e37d0 100644 --- a/src/shared/path-lookup.c +++ b/src/shared/path-lookup.c @@ -218,21 +218,6 @@ static char** user_dirs( return tmp; } -char **generator_paths(SystemdRunningAs running_as) { - if (running_as == SYSTEMD_USER) - return strv_new("/run/systemd/user-generators", - "/etc/systemd/user-generators", - "/usr/local/lib/systemd/user-generators", - USER_GENERATOR_PATH, - NULL); - else - return strv_new("/run/systemd/system-generators", - "/etc/systemd/system-generators", - "/usr/local/lib/systemd/system-generators", - SYSTEM_GENERATOR_PATH, - NULL); -} - int lookup_paths_init( LookupPaths *p, SystemdRunningAs running_as, @@ -338,77 +323,7 @@ int lookup_paths_init( } if (running_as == SYSTEMD_SYSTEM) { -#ifdef HAVE_SYSV_COMPAT - /* /etc/init.d/ compatibility does not matter to users */ - - e = getenv("SYSTEMD_SYSVINIT_PATH"); - if (e) { - p->sysvinit_path = path_split_and_make_absolute(e); - if (!p->sysvinit_path) - return -ENOMEM; - } else - p->sysvinit_path = NULL; - - if (strv_isempty(p->sysvinit_path)) { - strv_free(p->sysvinit_path); - - p->sysvinit_path = strv_new( - SYSTEM_SYSVINIT_PATH, /* /etc/init.d/ */ - NULL); - if (!p->sysvinit_path) - return -ENOMEM; - } - - e = getenv("SYSTEMD_SYSVRCND_PATH"); - if (e) { - p->sysvrcnd_path = path_split_and_make_absolute(e); - if (!p->sysvrcnd_path) - return -ENOMEM; - } else - p->sysvrcnd_path = NULL; - - if (strv_isempty(p->sysvrcnd_path)) { - strv_free(p->sysvrcnd_path); - - p->sysvrcnd_path = strv_new( - SYSTEM_SYSVRCND_PATH, /* /etc/rcN.d/ */ - NULL); - if (!p->sysvrcnd_path) - return -ENOMEM; - } - - if (!path_strv_resolve_uniq(p->sysvinit_path, root_dir)) - return -ENOMEM; - - if (!path_strv_resolve_uniq(p->sysvrcnd_path, root_dir)) - return -ENOMEM; - - if (!strv_isempty(p->sysvinit_path)) { - _cleanup_free_ char *t = strv_join(p->sysvinit_path, "\n\t"); - if (!t) - return -ENOMEM; - log_debug("Looking for SysV init scripts in:\n\t%s", t); - } else { - log_debug("Ignoring SysV init scripts."); - strv_free(p->sysvinit_path); - p->sysvinit_path = NULL; - } - - if (!strv_isempty(p->sysvrcnd_path)) { - _cleanup_free_ char *t = - strv_join(p->sysvrcnd_path, "\n\t"); - if (!t) - return -ENOMEM; - - log_debug("Looking for SysV rcN.d links in:\n\t%s", t); - } else { - log_debug("Ignoring SysV rcN.d links."); - strv_free(p->sysvrcnd_path); - p->sysvrcnd_path = NULL; - } -#else log_debug("SysV init scripts and rcN.d links support disabled"); -#endif } return 0; @@ -419,12 +334,6 @@ void lookup_paths_free(LookupPaths *p) { strv_free(p->unit_path); p->unit_path = NULL; - -#ifdef HAVE_SYSV_COMPAT - strv_free(p->sysvinit_path); - strv_free(p->sysvrcnd_path); - p->sysvinit_path = p->sysvrcnd_path = NULL; -#endif } int lookup_paths_init_from_scope(LookupPaths *paths,