From 452d2dfd52f1cc686395663a6cd4c778306bd309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 15 Sep 2020 17:44:26 +0200 Subject: [PATCH 1/2] meson: RC_LOCAL_SCRIPT_PATH_START to RC_LOCAL_PATH RC_LOCAL_SCRIPT_PATH_START and RC_LOCAL_SCRIPT_PATH_STOP were was originally added in the conversion to meson based on the autotools name. In 44508946534eee032927c263b79464832656dd6e RC_LOCAL_SCRIPT_PATH_STOP was dropped. We don't need to use such a long name. --- meson.build | 4 ++-- src/rc-local-generator/rc-local-generator.c | 2 +- units/rc-local.service.in | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index ee3791a3ae..e6804900a6 100644 --- a/meson.build +++ b/meson.build @@ -212,7 +212,7 @@ conf.set_quoted('SYSTEM_CONFIG_UNIT_DIR', join_paths(pkgsysc conf.set_quoted('SYSTEM_DATA_UNIT_PATH', systemunitdir) conf.set_quoted('SYSTEM_SYSVINIT_PATH', sysvinit_path) conf.set_quoted('SYSTEM_SYSVRCND_PATH', sysvrcnd_path) -conf.set_quoted('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local')) +conf.set_quoted('RC_LOCAL_PATH', get_option('rc-local')) conf.set('ANSI_OK_COLOR', 'ANSI_' + get_option('ok-color').underscorify().to_upper()) @@ -299,7 +299,7 @@ substs.set('CERTIFICATEROOT', get_option('certif substs.set('RANDOM_SEED', join_paths(randomseeddir, 'random-seed')) substs.set('SYSTEM_SYSVINIT_PATH', sysvinit_path) substs.set('SYSTEM_SYSVRCND_PATH', sysvrcnd_path) -substs.set('RC_LOCAL_SCRIPT_PATH_START', get_option('rc-local')) +substs.set('RC_LOCAL_PATH', get_option('rc-local')) substs.set('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default ? 'yes' : 'no') substs.set('STATUS_UNIT_FORMAT_DEFAULT', status_unit_format_default) substs.set('HIGH_RLIMIT_NOFILE', conf.get('HIGH_RLIMIT_NOFILE')) diff --git a/src/rc-local-generator/rc-local-generator.c b/src/rc-local-generator/rc-local-generator.c index 908e6272a8..75bb875b79 100644 --- a/src/rc-local-generator/rc-local-generator.c +++ b/src/rc-local-generator/rc-local-generator.c @@ -59,7 +59,7 @@ static int run(const char *dest, const char *dest_early, const char *dest_late) assert_se(arg_dest = dest); - if (check_executable(RC_LOCAL_SCRIPT_PATH_START) >= 0) { + if (check_executable(RC_LOCAL_PATH) >= 0) { log_debug("Automatically adding rc-local.service."); r = add_symlink("rc-local.service", "multi-user.target"); diff --git a/units/rc-local.service.in b/units/rc-local.service.in index 78ce69e0ae..d4aaaf09d4 100644 --- a/units/rc-local.service.in +++ b/units/rc-local.service.in @@ -8,16 +8,16 @@ # (at your option) any later version. # This unit gets pulled automatically into multi-user.target by -# systemd-rc-local-generator if @RC_LOCAL_SCRIPT_PATH_START@ is executable. +# systemd-rc-local-generator if @RC_LOCAL_PATH@ is executable. [Unit] -Description=@RC_LOCAL_SCRIPT_PATH_START@ Compatibility +Description=@RC_LOCAL_PATH@ Compatibility Documentation=man:systemd-rc-local-generator(8) -ConditionFileIsExecutable=@RC_LOCAL_SCRIPT_PATH_START@ +ConditionFileIsExecutable=@RC_LOCAL_PATH@ After=network.target [Service] Type=forking -ExecStart=@RC_LOCAL_SCRIPT_PATH_START@ start +ExecStart=@RC_LOCAL_PATH@ start TimeoutSec=0 RemainAfterExit=yes GuessMainPID=no From c2ee27a5e7fa1c6a71341579baa2d941c6e3e6e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 15 Sep 2020 17:56:32 +0200 Subject: [PATCH 2/2] man: substitute path to rc.local in the man page Different systems use different paths for it and users are confused when the man page has a path different than the one on the local system. https://bugzilla.redhat.com/show_bug.cgi?id=1876905 --- man/custom-entities.ent.in | 1 + man/systemd-rc-local-generator.xml | 31 ++++++++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/man/custom-entities.ent.in b/man/custom-entities.ent.in index 03fe05f1bc..dc4b242fc3 100644 --- a/man/custom-entities.ent.in +++ b/man/custom-entities.ent.in @@ -10,3 +10,4 @@ + diff --git a/man/systemd-rc-local-generator.xml b/man/systemd-rc-local-generator.xml index 0e607d0bce..b51f50a1e1 100644 --- a/man/systemd-rc-local-generator.xml +++ b/man/systemd-rc-local-generator.xml @@ -1,8 +1,11 @@ - - + + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ + +%entities; +]> + systemd-rc-local-generator @@ -16,7 +19,7 @@ systemd-rc-local-generator - Compatibility generator for starting /etc/rc.local during boot + Compatibility generator for starting &RC_LOCAL_PATH; during boot @@ -27,17 +30,17 @@ Description systemd-rc-local-generator is a generator that checks whether - /etc/rc.local exists and is executable, and if it is pulls the - rc-local.service unit into the boot process. This unit is responsible for running this script - during late boot. Note that the script will be run with slightly different semantics than the original System V - version, which was run "last" in the boot process, which is a concept that does not translate to systemd. The - script is run after network.target, but in parallel with most other regular system - services. + &RC_LOCAL_PATH; exists and is executable, and if it is pulls the + rc-local.service unit into the boot process. This unit is responsible for running + this script during late boot. Note that the script will be run with slightly different semantics than the + original System V version, which was run "last" in the boot process, which is a concept that does not + translate to systemd. The script is run after network.target, but in parallel with + most other regular system services. - Support for /etc/rc.local is provided - for compatibility with specific System V systems only. However, it is strongly recommended to avoid making use of - this script today, and instead provide proper unit files with appropriate dependencies for any scripts to run - during the boot process. + Support for &RC_LOCAL_PATH; is provided for compatibility with specific System + V systems only. However, it is strongly recommended to avoid making use of 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 a compile time and varies between distributions. systemd-rc-local-generator implements systemd.generator7.