]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Drop support for SysV rc-local script support
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 6 Jan 2026 18:00:18 +0000 (03:00 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 Jan 2026 13:56:28 +0000 (22:56 +0900)
As already announced for several years.

19 files changed:
.github/labeler.yml
docs/DISTRO_PORTING.md
man/custom-entities.ent.in
man/rules/meson.build
man/systemd-rc-local-generator.xml [deleted file]
man/systemd.generator.xml
meson.build
meson_options.txt
mkosi/mkosi.conf.d/opensuse/mkosi.conf.d/debug.conf
mkosi/mkosi.images/build/mkosi.conf.d/opensuse/mkosi.build.chroot
src/rc-local-generator/meson.build [deleted file]
src/rc-local-generator/rc-local-generator.c [deleted file]
test/units/TEST-23-UNIT-FILE.verify-unit-files.sh
units/console-getty.service.in
units/container-getty@.service.in
units/getty@.service.in
units/meson.build
units/rc-local.service.in [deleted file]
units/serial-getty@.service.in

index 0d2549240c22dd161ba168395b979510d03a408d..65ac9750252146c2b22027b73b925138734548d9 100644 (file)
@@ -172,9 +172,6 @@ pstore:
 random-seed:
   - changed-files:
     - any-glob-to-any-file: '**/*random-seed*'
-rc-local-generator:
-  - changed-files:
-    - any-glob-to-any-file: 'src/rc-local-generator/*'
 remount-fs:
   - changed-files:
     - any-glob-to-any-file: '**/*remount-fs*'
index fc25d91d70c9b49408e3d1b844a4825908dfe7aa..159cdd13b4603f60d3e0b990bb1a16b615570c14 100644 (file)
@@ -13,7 +13,6 @@ You need to make the follow changes to adapt systemd to your distribution:
 
 1. Find the right configure parameters for:
 
-   * `-Drc-local=`
    * `-Dloadkeys-path=`
    * `-Dsetfont-path=`
    * `-Dtty-gid=`
index 1f3ecefe61416f4890198fcd350e04b9960c1f40..6c2738d9080e40dcc589c71d837e4541c2079927 100644 (file)
@@ -12,7 +12,6 @@
 <!ENTITY KILL_USER_PROCESSES "{{ 'yes' if KILL_USER_PROCESSES else 'no' }}">
 <!ENTITY JOURNAL_STORAGE_DEFAULT "{{JOURNAL_STORAGE_DEFAULT}}">
 <!ENTITY DEBUGTTY "{{DEBUGTTY}}">
-<!ENTITY SYSTEM_SYSVRCLOCAL_PATH "{{SYSTEM_SYSVRCLOCAL_PATH}}">
 <!ENTITY HIGH_RLIMIT_NOFILE "{{HIGH_RLIMIT_NOFILE}}">
 <!ENTITY DEFAULT_DNSSEC_MODE "{{DEFAULT_DNSSEC_MODE_STR}}">
 <!ENTITY DEFAULT_DNS_OVER_TLS_MODE "{{DEFAULT_DNS_OVER_TLS_MODE_STR}}">
index 4868a227090f7af1809aca647f5b1b446c47f2e0..d062187d6ba3090352673e49f9c411349c0f72c3 100644 (file)
@@ -1130,10 +1130,6 @@ manpages = [
   '8',
   ['systemd-random-seed'],
   'ENABLE_RANDOMSEED'],
- ['systemd-rc-local-generator',
-  '8',
-  ['rc-local.service'],
-  'HAVE_SYSV_RC_LOCAL'],
  ['systemd-remount-fs.service', '8', ['systemd-remount-fs'], ''],
  ['systemd-repart', '8', ['systemd-repart.service'], 'ENABLE_REPART'],
  ['systemd-resolved.service', '8', ['systemd-resolved'], 'ENABLE_RESOLVE'],
diff --git a/man/systemd-rc-local-generator.xml b/man/systemd-rc-local-generator.xml
deleted file mode 100644 (file)
index a2ea8a9..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version='1.0'?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY % entities SYSTEM "custom-entities.ent" >
-%entities;
-]>
-<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
-
-<refentry id="systemd-rc-local-generator" conditional='HAVE_SYSV_RC_LOCAL'>
-  <refentryinfo>
-    <title>systemd-rc-local-generator</title>
-    <productname>systemd</productname>
-  </refentryinfo>
-
-  <refmeta>
-    <refentrytitle>systemd-rc-local-generator</refentrytitle>
-    <manvolnum>8</manvolnum>
-  </refmeta>
-
-  <refnamediv>
-    <refname>systemd-rc-local-generator</refname>
-    <refname>rc-local.service</refname>
-    <refpurpose>Compatibility generator and service to start <filename>&SYSTEM_SYSVRCLOCAL_PATH;</filename> during boot</refpurpose>
-  </refnamediv>
-
-  <refsynopsisdiv>
-    <para><filename>/usr/lib/systemd/system-generators/systemd-rc-local-generator</filename></para>
-    <para><filename>rc-local.service</filename></para>
-  </refsynopsisdiv>
-
-  <refsect1>
-    <title>Description</title>
-
-    <para><command>systemd-rc-local-generator</command> is a generator that checks whether
-    <filename>&SYSTEM_SYSVRCLOCAL_PATH;</filename> exists and is executable, and if it is, pulls the
-    <filename>rc-local.service</filename> unit into the boot process. This unit is responsible for running
-    this script during late boot. The script is run after <filename>network.target</filename>, but in
-    parallel with most other regular system services.</para>
-
-    <para>Note that <filename>rc-local.service</filename> runs with slightly different semantics than the
-    original System V version, which was executed "last" in the boot process, which is a concept that does
-    not translate to systemd.</para>
-
-    <para>Also note that <filename>rc-local.service</filename> is ordered after
-    <filename>network.target</filename>, which does not mean that the network is functional, see
-    <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
-    If the script requires a configured network connection, it may be desirable to pull in and order it after
-    <filename>network-online.target</filename> with a drop-in:</para>
-
-    <programlisting># /etc/systemd/system/rc-local.service.d/network.conf
-[Unit]
-Wants=network-online.target
-After=network-online.target
-</programlisting>
-
-    <para>Support for <filename>&SYSTEM_SYSVRCLOCAL_PATH;</filename> is provided for compatibility with specific
-    System V systems only. However, it is strongly recommended to avoid using this script today, and instead
-    provide proper unit files with appropriate dependencies for any scripts to run during the boot process.
-    Note that the path to the script is set at compile time and varies between distributions.</para>
-
-    <para><filename>systemd-rc-local-generator</filename> implements
-    <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
-  </refsect1>
-
-  <refsect1>
-    <title>Notes</title>
-
-    <para>On systems with SELinux, when creating the file, make sure to set the appropriate context, e.g.
-    with "<command>sudo restorecon -v &SYSTEM_SYSVRCLOCAL_PATH;</command>".
-    </para>
-  </refsect1>
-
-  <refsect1>
-    <title>See Also</title>
-    <para><simplelist type="inline">
-      <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
-      <member><citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
-    </simplelist></para>
-  </refsect1>
-</refentry>
index 47bb970a5502d8637fd15c7d1ef693b7a1460a0f..f39c07337836c03c1d89c5b9e16966c286ad6fe2 100644 (file)
@@ -405,7 +405,6 @@ find $dir</programlisting>
       <member><citerefentry><refentrytitle>systemd-getty-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
       <member><citerefentry><refentrytitle>systemd-gpt-auto-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
       <member><citerefentry><refentrytitle>systemd-hibernate-resume-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
-      <member><citerefentry><refentrytitle>systemd-rc-local-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
       <member><citerefentry><refentrytitle>systemd-system-update-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
       <member><citerefentry><refentrytitle>systemd-xdg-autostart-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
       <member><citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
index 22e469aa4ba744bfa2187fe516750f12e2c99afa..da7b01f0a790e6ca5be662b44c9e4f2df19bd2f5 100644 (file)
@@ -90,8 +90,6 @@ conf.set10('HAVE_SPLIT_BIN', split_bin,
 
 have_standalone_binaries = get_option('standalone-binaries')
 
-sysvrclocal_path = get_option('rc-local')
-conf.set10('HAVE_SYSV_RC_LOCAL', sysvrclocal_path != '')
 conf.set10('CREATE_LOG_DIRS', get_option('create-log-dirs'))
 
 if get_option('hibernate') and not get_option('initrd')
@@ -299,7 +297,6 @@ conf.set_quoted('SYSTEM_GENERATOR_DIR',                       systemgeneratordir
 conf.set_quoted('SYSTEM_PRESET_DIR',                          systempresetdir)
 conf.set_quoted('SYSTEM_SHUTDOWN_PATH',                       systemshutdowndir)
 conf.set_quoted('SYSTEM_SLEEP_PATH',                          systemsleepdir)
-conf.set_quoted('SYSTEM_SYSVRCLOCAL_PATH',                    sysvrclocal_path)
 conf.set_quoted('SYSUSERS_DIR',                               sysusersdir)
 conf.set_quoted('TMPFILES_DIR',                               tmpfilesdir)
 conf.set_quoted('USER_TMPFILES_DIR',                          usertmpfilesdir)
@@ -2401,7 +2398,6 @@ subdir('src/pstore')
 subdir('src/ptyfwd')
 subdir('src/quotacheck')
 subdir('src/random-seed')
-subdir('src/rc-local-generator')
 subdir('src/remount-fs')
 subdir('src/repart')
 subdir('src/reply-password')
@@ -3022,7 +3018,6 @@ summary({
         'sysconf directory'                         : sysconfdir,
         'include directory'                         : includedir,
         'lib directory'                             : libdir,
-        'SysV rc.local script'                      : sysvrclocal_path,
         'PAM modules directory'                     : pamlibdir,
         'PAM configuration directory'               : pamconfdir,
         'ssh server configuration directory'        : sshdconfdir,
index c555b9ebdc4f0d9f63f7254d933f4280f5490ff4..21d3e7902804389dd45ee42be8c47c2161509b4c 100644 (file)
@@ -45,7 +45,7 @@ option('sysvinit-path', type : 'string', value : '/etc/init.d', deprecated : tru
        description : 'This option is deprecated and will be removed in a future release')
 option('sysvrcnd-path', type : 'string', value : '/etc/rc.d', deprecated : true,
        description : 'This option is deprecated and will be removed in a future release')
-option('rc-local', type : 'string', value : '/etc/rc.local',
+option('rc-local', type : 'string', value : '/etc/rc.local', deprecated : true,
        description : 'path to SysV rc.local script')
 option('initrd', type : 'boolean',
        description : 'install services for use when running systemd in initrd')
index 4614ea06a2adc52ea0722d98dcbdf831b445b547..860319a6108c7a673d790e2ea9e00cdb254b5a2d 100644 (file)
@@ -16,6 +16,5 @@ VolatilePackages=
         systemd-networkd-debuginfo
         systemd-portable-debuginfo
         systemd-resolved-debuginfo
-        systemd-sysvcompat-debuginfo
         systemd-testsuite-debuginfo
         udev-debuginfo
index 6adec4ce72ce7369478d03425aa5e0a6103c580b..e14c8884a081acdd8e5f08d817987e2f3ae297fa 100755 (executable)
@@ -27,6 +27,7 @@ while read -r filelist; do
         -e '/(initctl|runlevel|telinit)/ d' \
         -e 's/systemd-quotacheck.service.8/systemd-quotacheck@.service.8/' \
         -e '/systemd-sysv-generator/d' \
+        -e '/rc-local/d' \
         "$filelist" >"/tmp/$(basename "$filelist")"
     mount --bind "/tmp/$(basename "$filelist")" "$filelist"
 done < <(find "pkg/$PKG_SUBDIR${GIT_SUBDIR:+/$GIT_SUBDIR}" -name "files.*")
diff --git a/src/rc-local-generator/meson.build b/src/rc-local-generator/meson.build
deleted file mode 100644 (file)
index b3a7311..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-
-executables += [
-        generator_template + {
-                'name' : 'systemd-rc-local-generator',
-                'sources' : files('rc-local-generator.c'),
-                'conditions' : [
-                        'HAVE_SYSV_RC_LOCAL',
-                ],
-        },
-]
diff --git a/src/rc-local-generator/rc-local-generator.c b/src/rc-local-generator/rc-local-generator.c
deleted file mode 100644 (file)
index 8b1b75f..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/* SPDX-License-Identifier: LGPL-2.1-or-later */
-
-#include <unistd.h>
-
-#include "generator.h"
-#include "initrd-util.h"
-#include "log.h"
-#include "mkdir-label.h"
-#include "string-util.h"
-
-static const char *arg_dest = NULL;
-
-/* So you are reading this, and might wonder: why is this implemented as a generator rather than as a plain, statically
- * enabled service that carries appropriate ConditionFileIsExecutable= lines? The answer is this: conditions bypass
- * execution of a service's binary, but they have no influence on unit dependencies. Thus, a service that is
- * conditioned out will still act as synchronization point in the dependency tree, and we'd rather not have that for
- * these two legacy scripts. */
-
-static int add_symlink(const char *service, const char *where) {
-        const char *from, *to;
-
-        assert(service);
-        assert(where);
-
-        from = strjoina(SYSTEM_DATA_UNIT_DIR "/", service);
-        to = strjoina(arg_dest, "/", where, ".wants/", service);
-
-        (void) mkdir_parents_label(to, 0755);
-
-        if (symlink(from, to) < 0) {
-                if (errno == EEXIST)
-                        return 0;
-
-                return log_error_errno(errno, "Failed to create symlink %s: %m", to);
-        }
-
-        return 1;
-}
-
-static int check_executable(const char *path) {
-        assert(path);
-
-        if (access(path, X_OK) < 0) {
-                if (errno == ENOENT)
-                        return log_debug_errno(errno, "%s does not exist, skipping.", path);
-                if (errno == EACCES)
-                        return log_info_errno(errno, "%s is not marked executable, skipping.", path);
-
-                return log_warning_errno(errno, "Couldn't determine if %s exists and is executable, skipping: %m", path);
-        }
-
-        return 0;
-}
-
-static int run(const char *dest, const char *dest_early, const char *dest_late) {
-        int r = 0, k = 0;
-
-        assert_se(arg_dest = dest);
-
-        if (in_initrd()) {
-                log_debug("Skipping generator, running in the initrd.");
-                return EXIT_SUCCESS;
-        }
-
-        if (check_executable(SYSTEM_SYSVRCLOCAL_PATH) >= 0) {
-                log_debug("Automatically adding rc-local.service.");
-
-                r = add_symlink("rc-local.service", "multi-user.target");
-        }
-
-        return r < 0 ? r : k;
-}
-
-DEFINE_MAIN_GENERATOR_FUNCTION(run);
index 200e7582bddbb65c1c68a67d583ab9cb8c2964e9..b94e486b7ad5545f62c95d799d11121481d50f86 100755 (executable)
@@ -29,8 +29,7 @@ fi
 for unit_file in "${UNIT_FILES[@]}"; do
     # Skip the check for a couple of units, namely:
     #   - syslog.socket: the corresponding syslog.service might not be installed
-    #   - rc-local.service: compat API, /etc/rc.d/rc.local most likely won't be present
-    if [[ "$unit_file" =~ /(syslog.socket|rc-local.service)$ ]]; then
+    if [[ "$unit_file" =~ /syslog.socket$ ]]; then
         continue
     fi
 
index aecb8f09481cd6467ab070e22463c6595d9da75c..d28fddbc03953c8a3ff9cff6bffe3b2de3613ca1 100644 (file)
@@ -11,9 +11,6 @@
 Description=Console Getty
 Documentation=man:agetty(8) man:systemd-getty-generator(8)
 After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target
-{% if HAVE_SYSV_RC_LOCAL %}
-After=rc-local.service
-{% endif %}
 Before=getty.target
 
 # OCI containers may be run without a console
index 6e0e59d396fac52a6e5a2360878b303125d9c029..839a76c73f8d45aa799a97e921cd871175207a6b 100644 (file)
@@ -12,9 +12,6 @@ Description=Container Getty on /dev/pts/%I
 Documentation=man:agetty(8) man:systemd-getty-generator(8)
 Documentation=man:machinectl(1)
 After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target
-{% if HAVE_SYSV_RC_LOCAL %}
-After=rc-local.service
-{% endif %}
 Before=getty.target
 IgnoreOnIsolate=yes
 ConditionPathExists=/dev/pts/%I
index e9ca6401eed0cc1c93319e39b38888ddf7418a14..19b95ce56d45c431945a53cb447dd477f07ae14e 100644 (file)
@@ -12,9 +12,6 @@ Description=Getty on %I
 Documentation=man:agetty(8) man:systemd-getty-generator(8)
 Documentation=https://0pointer.de/blog/projects/serial-console.html
 After=systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target
-{% if HAVE_SYSV_RC_LOCAL %}
-After=rc-local.service
-{% endif %}
 
 # If additional gettys are spawned during boot then we should make
 # sure that this is synchronized before getty.target, even though
index 25e98ae90e2ed122a86dff8fff79f55d02a7918d..f2c5d220554b5b56f730506288ac8c169f159a98 100644 (file)
@@ -174,10 +174,6 @@ units = [
           'file' : 'quotaon-root.service.in',
           'conditions' : ['ENABLE_QUOTACHECK'],
         },
-        {
-          'file' : 'rc-local.service.in',
-          'conditions' : ['HAVE_SYSV_RC_LOCAL'],
-        },
         {
           'file' : 'reboot.target',
           'symlinks' : ['ctrl-alt-del.target'],
diff --git a/units/rc-local.service.in b/units/rc-local.service.in
deleted file mode 100644 (file)
index b135f38..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#  SPDX-License-Identifier: LGPL-2.1-or-later
-#
-#  This file is part of systemd.
-#
-#  systemd is free software; you can redistribute it and/or modify it
-#  under the terms of the GNU Lesser General Public License as published by
-#  the Free Software Foundation; either version 2.1 of the License, or
-#  (at your option) any later version.
-
-# This unit gets pulled automatically into multi-user.target by
-# systemd-rc-local-generator if {{SYSTEM_SYSVRCLOCAL_PATH}} is executable.
-[Unit]
-Description={{SYSTEM_SYSVRCLOCAL_PATH}} Compatibility
-Documentation=man:systemd-rc-local-generator(8)
-ConditionFileIsExecutable={{SYSTEM_SYSVRCLOCAL_PATH}}
-After=network.target
-
-[Service]
-Type=forking
-ExecStart={{SYSTEM_SYSVRCLOCAL_PATH}} start
-TimeoutSec=infinity
-RemainAfterExit=yes
-GuessMainPID=no
index c0708f17776643ac8839e0182c9d0f8dd694d7b0..01c6b0abb235e6b0457888a40e00f096b3a1cf2b 100644 (file)
@@ -13,9 +13,6 @@ Documentation=man:agetty(8) man:systemd-getty-generator(8)
 Documentation=https://0pointer.de/blog/projects/serial-console.html
 BindsTo=dev-%i.device
 After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service getty-pre.target
-{% if HAVE_SYSV_RC_LOCAL %}
-After=rc-local.service
-{% endif %}
 
 # If additional gettys are spawned during boot then we should make
 # sure that this is synchronized before getty.target, even though