[systemd-devel] [PATCH] Run rc-local after network.target, as it's often used for frobbing the network.

Michal Schmidt mschmidt at redhat.com
Thu Dec 1 07:33:41 PST 2011


On 11/22/2011 08:57 PM, Bill Nottingham wrote:
> diff --git a/units/fedora/rc-local.service b/units/fedora/rc-local.service
> index 106b12c..9a38e59 100644
> --- a/units/fedora/rc-local.service
> +++ b/units/fedora/rc-local.service
> @@ -8,6 +8,7 @@
>   [Unit]
>   Description=/etc/rc.local Compatibility
>   ConditionFileIsExecutable=/etc/rc.d/rc.local
> +After=network.target
>
>   [Service]
>   Type=forking

Yes, I suppose that people using rc.local want to have it run after the 
network is ready.

The trouble is that this will delay services that are ordered after 
rc-local.service even if one has no /etc/rc.d/rc.local file. The unit 
acts as an ordering barrier even if its condition is false, because 
conditions are evaluated when the service is about to be started.

To get rid of this ordering barrier in the usual case, we could add a 
generator to produce rc-local.service only if /etc/rc.d/rc.local is 
executable (or the other way around: the generator could runtime-mask 
the existing rc-local.service if the file is not executable.). Or add 
support for some kind of early evaluated conditions.

Michal


More information about the systemd-devel mailing list