chiark / gitweb /
Remove SysV compat
authorAndy Wingo <wingo@pobox.com>
Wed, 8 Apr 2015 06:45:34 +0000 (08:45 +0200)
committerAndy Wingo <wingo@pobox.com>
Wed, 8 Apr 2015 06:45:34 +0000 (08:45 +0200)
Makefile-man.am
Makefile.am
configure.ac
src/core/load-fragment.c
src/core/main.c
src/fsck/fsck.c
src/quotacheck/quotacheck.c
src/shared/build.h
src/shared/path-lookup.c
src/shared/path-lookup.h
src/systemctl/systemctl.c

index 2f3e5f227194f5ac36f24c0a5620190ef12cbdf6..9f9ba7715f5d57dda222bf587c74d76e6f15c801 100644 (file)
@@ -1625,32 +1625,6 @@ MANPAGES_ALIAS += \
 
 endif
 
-if HAVE_SYSV_COMPAT
-MANPAGES += \
-       man/systemd-sysv-generator.8
-MANPAGES_ALIAS += \
-       #
-
-
-endif
-
-if HAVE_UTMP
-MANPAGES += \
-       man/runlevel.8 \
-       man/systemd-update-utmp.service.8
-MANPAGES_ALIAS += \
-       man/systemd-update-utmp-runlevel.service.8 \
-       man/systemd-update-utmp.8
-man/systemd-update-utmp-runlevel.service.8: man/systemd-update-utmp.service.8
-man/systemd-update-utmp.8: man/systemd-update-utmp.service.8
-man/systemd-update-utmp-runlevel.service.html: man/systemd-update-utmp.service.html
-       $(html-alias)
-
-man/systemd-update-utmp.html: man/systemd-update-utmp.service.html
-       $(html-alias)
-
-endif
-
 # Really, do not edit this file.
 
 EXTRA_DIST += \
index 11a8d3c33ece5bd641350f9e411816d3979a58e9..135e7b35c25aaeb9cd9849e5cb1dd0077e30b26a 100644 (file)
@@ -605,16 +605,6 @@ EXTRA_DIST += \
        units/systemd-nspawn@.service.in \
        units/systemd-update-done.service.in
 
-if HAVE_SYSV_COMPAT
-nodist_systemunit_DATA += \
-       units/rc-local.service \
-       units/halt-local.service
-
-systemgenerator_PROGRAMS += \
-       systemd-sysv-generator \
-       systemd-rc-local-generator
-endif
-
 EXTRA_DIST += \
        units/rc-local.service.in \
        units/halt-local.service.in
@@ -2187,11 +2177,6 @@ dist_tmpfiles_DATA = \
        tmpfiles.d/x11.conf \
        tmpfiles.d/var.conf
 
-if HAVE_SYSV_COMPAT
-dist_tmpfiles_DATA += \
-       tmpfiles.d/legacy.conf
-endif
-
 SYSINIT_TARGET_WANTS += \
        systemd-tmpfiles-setup-dev.service \
        systemd-tmpfiles-setup.service
@@ -3865,11 +3850,6 @@ TESTS += \
        test/rule-syntax-check.py \
        $(NULL)
 
-if HAVE_SYSV_COMPAT
-TESTS += \
-       test/sysv-generator-test.py \
-       $(NULL)
-endif
 endif
 
 manual_tests += \
@@ -6527,24 +6507,6 @@ EXTRA_DIST += \
        man/custom-man.xsl
 
 # ------------------------------------------------------------------------------
-if HAVE_SYSV_COMPAT
-sysvinit_DATA = \
-       docs/sysvinit/README
-
-varlog_DATA = \
-       docs/var-log/README
-
-docs/sysvinit/README: docs/sysvinit/README.in
-       $(SED_PROCESS)
-
-docs/var-log/README: docs/var-log/README.in
-       $(SED_PROCESS)
-
-CLEANFILES += \
-       docs/sysvinit/README \
-       docs/var-log/README
-endif
-
 EXTRA_DIST += \
        docs/sysvinit/README.in \
        docs/var-log/README.in
@@ -6574,17 +6536,6 @@ SYSINIT_TARGET_WANTS += \
        systemd-sysctl.service \
        systemd-ask-password-console.path
 
-if HAVE_SYSV_COMPAT
-SYSTEM_UNIT_ALIASES += \
-       poweroff.target runlevel0.target \
-       rescue.target runlevel1.target \
-       multi-user.target runlevel2.target \
-       multi-user.target runlevel3.target \
-       multi-user.target runlevel4.target \
-       graphical.target runlevel5.target \
-       reboot.target runlevel6.target
-endif
-
 SYSTEM_UNIT_ALIASES += \
        graphical.target default.target \
        reboot.target ctrl-alt-del.target \
@@ -6611,15 +6562,6 @@ GENERAL_ALIASES += \
        $(pkgsysconfdir)/user $(sysconfdir)/xdg/systemd/user \
        $(dbussystemservicedir)/org.freedesktop.systemd1.service $(dbussessionservicedir)/org.freedesktop.systemd1.service
 
-if HAVE_SYSV_COMPAT
-INSTALL_DIRS += \
-       $(systemunitdir)/runlevel1.target.wants \
-       $(systemunitdir)/runlevel2.target.wants \
-       $(systemunitdir)/runlevel3.target.wants \
-       $(systemunitdir)/runlevel4.target.wants \
-       $(systemunitdir)/runlevel5.target.wants
-endif
-
 INSTALL_DIRS += \
        $(prefix)/lib/modules-load.d \
        $(sysconfdir)/modules-load.d \
@@ -6668,15 +6610,9 @@ DISTCHECK_CONFIGURE_FLAGS = \
        --enable-kdbus \
        --enable-compat-libs
 
-if HAVE_SYSV_COMPAT
-DISTCHECK_CONFIGURE_FLAGS += \
-       --with-sysvinit-path=$$dc_install_base/$(sysvinitdir) \
-       --with-sysvrcnd-path=$$dc_install_base/$(sysvrcnddir)
-else
 DISTCHECK_CONFIGURE_FLAGS += \
        --with-sysvinit-path= \
        --with-sysvrcnd-path=
-endif
 
 if HAVE_PYTHON
 DISTCHECK_CONFIGURE_FLAGS += \
index 204b3e00cf40e5fec34e1942b84550d48c4c8cec..8144bdb34c321a9f35cddd56e6260fdc68ff632e 100644 (file)
@@ -1325,39 +1325,8 @@ AC_ARG_ENABLE(ldconfig,
        enable_ldconfig=$enableval, enable_ldconfig=yes)
 AM_CONDITIONAL(ENABLE_LDCONFIG, [test x$enable_ldconfig = xyes])
 
-# ------------------------------------------------------------------------------
-# Location of the init scripts as mandated by LSB
-SYSTEM_SYSVINIT_PATH=/etc/init.d
-SYSTEM_SYSVRCND_PATH=/etc/rc.d
-
-AC_ARG_WITH([sysvinit-path],
-        [AS_HELP_STRING([--with-sysvinit-path=PATH],
-                [Specify the path to where the SysV init scripts are located])],
-        [SYSTEM_SYSVINIT_PATH="$withval"],
-        [])
-
-AC_ARG_WITH([sysvrcnd-path],
-        [AS_HELP_STRING([--with-sysvrcnd-path=PATH],
-                [Specify the path to the base directory for the SysV rcN.d directories])],
-        [SYSTEM_SYSVRCND_PATH="$withval"],
-        [])
-
-if test "x${SYSTEM_SYSVINIT_PATH}" != "x" -a "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
-        AC_DEFINE(HAVE_SYSV_COMPAT, [], [SysV init scripts and rcN.d links are supported.])
-        SYSTEM_SYSV_COMPAT="yes"
-        M4_DEFINES="$M4_DEFINES -DHAVE_SYSV_COMPAT"
-elif test "x${SYSTEM_SYSVINIT_PATH}" != "x" -o "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
-        AC_MSG_ERROR([*** You need both --with-sysvinit-path=PATH and --with-sysvrcnd-path=PATH to enable SysV compatibility support, or both empty to disable it.])
-else
-        SYSTEM_SYSV_COMPAT="no"
-fi
-
-AC_SUBST(SYSTEM_SYSVINIT_PATH)
-AC_SUBST(SYSTEM_SYSVRCND_PATH)
 AC_SUBST(M4_DEFINES)
 
-AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
-
 AC_ARG_WITH([tty-gid],
         [AS_HELP_STRING([--with-tty-gid=GID],
                 [Specify the numeric GID of the 'tty' group])],
index 07384d3668d056219bfa98b428c7f186db2739f1..1553f8cdae585e39dc3ed3f65a3ad51e062b54c8 100644 (file)
@@ -1107,38 +1107,6 @@ int config_parse_limit(const char *unit,
         return 0;
 }
 
-#ifdef HAVE_SYSV_COMPAT
-int config_parse_sysv_priority(const char *unit,
-                               const char *filename,
-                               unsigned line,
-                               const char *section,
-                               unsigned section_line,
-                               const char *lvalue,
-                               int ltype,
-                               const char *rvalue,
-                               void *data,
-                               void *userdata) {
-
-        int *priority = data;
-        int i, r;
-
-        assert(filename);
-        assert(lvalue);
-        assert(rvalue);
-        assert(data);
-
-        r = safe_atoi(rvalue, &i);
-        if (r < 0 || i < 0) {
-                log_syntax(unit, LOG_ERR, filename, line, -r,
-                           "Failed to parse SysV start priority, ignoring: %s", rvalue);
-                return 0;
-        }
-
-        *priority = (int) i;
-        return 0;
-}
-#endif
-
 DEFINE_CONFIG_PARSE_ENUM(config_parse_kill_mode, kill_mode, KillMode, "Failed to parse kill mode");
 
 int config_parse_kill_signal(const char *unit,
@@ -3684,9 +3652,7 @@ void unit_dump_config_items(FILE *f) {
                 const ConfigParserCallback callback;
                 const char *rvalue;
         } table[] = {
-#if !defined(HAVE_SYSV_COMPAT) || !defined(HAVE_SECCOMP) || !defined(HAVE_PAM) || !defined(HAVE_SELINUX) || !defined(HAVE_SMACK) || !defined(HAVE_APPARMOR)
                 { config_parse_warn_compat,           "NOTSUPPORTED" },
-#endif
                 { config_parse_int,                   "INTEGER" },
                 { config_parse_unsigned,              "UNSIGNED" },
                 { config_parse_iec_size,              "SIZE" },
@@ -3718,9 +3684,6 @@ void unit_dump_config_items(FILE *f) {
                 { config_parse_exec,                  "PATH [ARGUMENT [...]]" },
                 { config_parse_service_type,          "SERVICETYPE" },
                 { config_parse_service_restart,       "SERVICERESTART" },
-#ifdef HAVE_SYSV_COMPAT
-                { config_parse_sysv_priority,         "SYSVPRIORITY" },
-#endif
                 { config_parse_kill_mode,             "KILLMODE" },
                 { config_parse_kill_signal,           "SIGNAL" },
                 { config_parse_socket_listen,         "SOCKET [...]" },
index dd8b65083bf9bfd3844d20d492cdf074800463b3..4fe0b7380bfe4f34ba2f02ea51fa1792c482ff0c 100644 (file)
@@ -1226,18 +1226,6 @@ int main(int argc, char *argv[]) {
         struct rlimit saved_rlimit_nofile = RLIMIT_MAKE_CONST(0);
         const char *error_message = NULL;
 
-#ifdef HAVE_SYSV_COMPAT
-        if (getpid() != 1 && strstr(program_invocation_short_name, "init")) {
-                /* This is compatibility support for SysV, where
-                 * calling init as a user is identical to telinit. */
-
-                errno = -ENOENT;
-                execv(SYSTEMCTL_BINARY_PATH, argv);
-                log_error_errno(errno, "Failed to exec " SYSTEMCTL_BINARY_PATH ": %m");
-                return 1;
-        }
-#endif
-
         dual_timestamp_from_monotonic(&kernel_timestamp, 0);
         dual_timestamp_get(&userspace_timestamp);
 
index 7eaf902e75b37533c5f201db006e8ec34c7635ca..d0316b3afda60eb0e05582ffcf450b7d362aa586 100644 (file)
@@ -100,34 +100,11 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
                         log_warning("Invalid fsck.repair= parameter '%s'. Ignoring.", value);
         }
 
-#ifdef HAVE_SYSV_COMPAT
-        else if (streq(key, "fastboot") && !value) {
-                log_warning("Please pass 'fsck.mode=skip' rather than 'fastboot' on the kernel command line.");
-                arg_skip = true;
-
-        } else if (streq(key, "forcefsck") && !value) {
-                log_warning("Please pass 'fsck.mode=force' rather than 'forcefsck' on the kernel command line.");
-                arg_force = true;
-        }
-#endif
-
         return 0;
 }
 
 static void test_files(void) {
 
-#ifdef HAVE_SYSV_COMPAT
-        if (access("/fastboot", F_OK) >= 0) {
-                log_error("Please pass 'fsck.mode=skip' on the kernel command line rather than creating /fastboot on the root file system.");
-                arg_skip = true;
-        }
-
-        if (access("/forcefsck", F_OK) >= 0) {
-                log_error("Please pass 'fsck.mode=force' on the kernel command line rather than creating /forcefsck on the root file system.");
-                arg_force = true;
-        }
-#endif
-
 }
 
 static int process_progress(int fd, pid_t fsck_pid, dev_t device_num) {
index 819706a72f6b825d07c32e6756f3c8bf92643bdb..a7e47dd32fefaa7d902e707b0981f7cf693956f2 100644 (file)
@@ -43,24 +43,10 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
                         log_warning("Invalid quotacheck.mode= parameter '%s'. Ignoring.", value);
         }
 
-#ifdef HAVE_SYSV_COMPAT
-        else if (streq(key, "forcequotacheck") && !value) {
-                log_warning("Please use 'quotacheck.mode=force' rather than 'forcequotacheck' on the kernel command line.");
-                arg_force = true;
-        }
-#endif
-
         return 0;
 }
 
 static void test_files(void) {
-
-#ifdef HAVE_SYSV_COMPAT
-        if (access("/forcequotacheck", F_OK) >= 0) {
-                log_error("Please pass 'quotacheck.mode=force' on the kernel command line rather than creating /forcequotacheck on the root file system.");
-                arg_force = true;
-        }
-#endif
 }
 
 int main(int argc, char *argv[]) {
index 8b82ede2904a191f686d4706f710fd0c7e1a1be4..b0a5a724679e82c1a70b45f4991ac465bc079751 100644 (file)
 #define _SMACK_FEATURE_ "-SMACK"
 #endif
 
-#ifdef HAVE_SYSV_COMPAT
-#define _SYSVINIT_FEATURE_ "+SYSVINIT"
-#else
-#define _SYSVINIT_FEATURE_ "-SYSVINIT"
-#endif
-
 #ifdef HAVE_LIBCRYPTSETUP
 #define _LIBCRYPTSETUP_FEATURE_ "+LIBCRYPTSETUP"
 #else
index fb2c2c233a0d86c7c0814368762ae3e3f41708a5..83abf53faa9256d0bf5a05cfd7b537f50d84df6c 100644 (file)
@@ -338,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;
@@ -419,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,
index f1925eef69c17a7a8538f6d8d46f6a12c185b4cf..2e0d3f7bdae2a7ee56b01ac2a71746e761a7beab 100644 (file)
@@ -27,10 +27,6 @@ typedef enum UnitFileScope UnitFileScope;
 
 typedef struct LookupPaths {
         char **unit_path;
-#ifdef HAVE_SYSV_COMPAT
-        char **sysvinit_path;
-        char **sysvrcnd_path;
-#endif
 } LookupPaths;
 
 typedef enum SystemdRunningAs {
index 3158a3800137843482ef78812548aab55110f99c..30dffecd387a8bed6bf0c922bbff25f4d5047d60 100644 (file)
@@ -5038,126 +5038,6 @@ static int import_environment(sd_bus *bus, char **args) {
 static int enable_sysv_units(const char *verb, char **args) {
         int r = 0;
 
-#if defined(HAVE_SYSV_COMPAT) && defined(HAVE_CHKCONFIG)
-        unsigned f = 0;
-        _cleanup_lookup_paths_free_ LookupPaths paths = {};
-
-        if (arg_scope != UNIT_FILE_SYSTEM)
-                return 0;
-
-        if (!streq(verb, "enable") &&
-            !streq(verb, "disable") &&
-            !streq(verb, "is-enabled"))
-                return 0;
-
-        /* Processes all SysV units, and reshuffles the array so that
-         * afterwards only the native units remain */
-
-        r = lookup_paths_init(&paths, SYSTEMD_SYSTEM, false, arg_root, NULL, NULL, NULL);
-        if (r < 0)
-                return r;
-
-        r = 0;
-        while (args[f]) {
-                const char *name;
-                _cleanup_free_ char *p = NULL, *q = NULL, *l = NULL;
-                bool found_native = false, found_sysv;
-                unsigned c = 1;
-                const char *argv[6] = { "/sbin/chkconfig", NULL, NULL, NULL, NULL };
-                char **k;
-                int j;
-                pid_t pid;
-                siginfo_t status;
-
-                name = args[f++];
-
-                if (!endswith(name, ".service"))
-                        continue;
-
-                if (path_is_absolute(name))
-                        continue;
-
-                STRV_FOREACH(k, paths.unit_path) {
-                        _cleanup_free_ char *path = NULL;
-
-                        path = path_join(arg_root, *k, name);
-                        if (!path)
-                                return log_oom();
-
-                        found_native = access(path, F_OK) >= 0;
-                        if (found_native)
-                                break;
-                }
-
-                if (found_native)
-                        continue;
-
-                p = path_join(arg_root, SYSTEM_SYSVINIT_PATH, name);
-                if (!p)
-                        return log_oom();
-
-                p[strlen(p) - strlen(".service")] = 0;
-                found_sysv = access(p, F_OK) >= 0;
-                if (!found_sysv)
-                        continue;
-
-                log_info("%s is not a native service, redirecting to /sbin/chkconfig.", name);
-
-                if (!isempty(arg_root))
-                        argv[c++] = q = strappend("--root=", arg_root);
-
-                argv[c++] = basename(p);
-                argv[c++] =
-                        streq(verb, "enable") ? "on" :
-                        streq(verb, "disable") ? "off" : "--level=5";
-                argv[c] = NULL;
-
-                l = strv_join((char**)argv, " ");
-                if (!l)
-                        return log_oom();
-
-                log_info("Executing %s", l);
-
-                pid = fork();
-                if (pid < 0)
-                        return log_error_errno(errno, "Failed to fork: %m");
-                else if (pid == 0) {
-                        /* Child */
-
-                        execv(argv[0], (char**) argv);
-                        _exit(EXIT_FAILURE);
-                }
-
-                j = wait_for_terminate(pid, &status);
-                if (j < 0) {
-                        log_error_errno(r, "Failed to wait for child: %m");
-                        return j;
-                }
-
-                if (status.si_code == CLD_EXITED) {
-                        if (streq(verb, "is-enabled")) {
-                                if (status.si_status == 0) {
-                                        if (!arg_quiet)
-                                                puts("enabled");
-                                        r = 1;
-                                } else {
-                                        if (!arg_quiet)
-                                                puts("disabled");
-                                }
-
-                        } else if (status.si_status != 0)
-                                return -EINVAL;
-                } else
-                        return -EPROTO;
-
-                /* Remove this entry, so that we don't try enabling it as native unit */
-                assert(f > 0);
-                f--;
-                assert(args[f] == name);
-                strv_remove(args, name);
-        }
-
-#endif
         return r;
 }