chiark / gitweb /
Remove SysV compat
[elogind.git] / src / shared / path-lookup.c
index 291a2f4054e1a084242f3ba1d053eecd35f31542..83abf53faa9256d0bf5a05cfd7b537f50d84df6c 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <unistd.h>
 #include <errno.h>
 
 #include "util.h"
-#include "mkdir.h"
 #include "strv.h"
 #include "path-util.h"
 #include "path-lookup.h"
+#include "install.h"
 
 int user_config_home(char **config_home) {
         const char *e;
@@ -340,77 +338,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;
@@ -421,12 +349,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,