From eb0845dfb8a503e194b25524626c6bc767d77c69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 12 Mar 2021 09:04:30 +0100 Subject: [PATCH] man: mention network-online.target in discussion of rc.local Replacement for #18853. --- man/systemd-rc-local-generator.xml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/man/systemd-rc-local-generator.xml b/man/systemd-rc-local-generator.xml index 2da7f6525d8..f0e38ead47d 100644 --- a/man/systemd-rc-local-generator.xml +++ b/man/systemd-rc-local-generator.xml @@ -31,18 +31,32 @@ Description - systemd-rc-local-generator is a generator that checks whether - &RC_LOCAL_PATH; exists and is executable, and if it is pulls the + systemd-rc-local-generator is a generator that checks whether + &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. + this script during late boot. The script is run after network.target, but in + parallel with most other regular system services. + + Note that rc-local.service 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. + + Also note that rc-local.service is ordered after + network.target, which does not mean that the network is functional, see + systemd.special7. + If the script requires a configured network connection, it may be desirable to pull in and order it after + network-online.target with a drop-in: + + # /etc/systemd/system/rc-local.service.d/network.conf +[Unit] +Wants=network-online.target +After=network-online.target + 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. + Note that the path to the script is set at compile time and varies between distributions. systemd-rc-local-generator implements systemd.generator7. -- 2.47.3