FS#44212 - [netctl] Ability to use Before= like in systemd.unit files

Attached to Project: Arch Linux
Opened by David Kowis (BeepDog) - Monday, 16 March 2015, 16:54 GMT
Last edited by Jouke Witteveen (jouke) - Sunday, 08 October 2017, 08:21 GMT
Task Type Feature Request
Category Arch Projects
Status Closed
Assigned To Jouke Witteveen (jouke)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
Ability to use Before= like in systemd.unit files.

Reasoning: I've got some openvpn connections that need the network to be up before they can bind. The openvpn@.service doesn't provide a way to check to see if the interface is up, nor is there a multi-parameter way (that I'm aware of) to do such a thing: "openvpn@config@network.service"

So if I could put Before= in my netctl configs, I could ensure then network device was up before the openvpn tried to do anything.

Thanks!
This task depends upon

Closed by  Jouke Witteveen (jouke)
Sunday, 08 October 2017, 08:21 GMT
Reason for closing:  Not a bug
Additional comments about closing:  netctl 1.13 correctly implements network.target and network-online.target
Comment by David Kowis (BeepDog) - Monday, 16 March 2015, 16:54 GMT
And of course I derp this, and I can't edit the title :(
Comment by Jouke Witteveen (jouke) - Sunday, 14 June 2015, 12:54 GMT
The ordering using After=() indeed only applies to netctl profiles. You can either make your openvpn service be started After= the netctl service (netctl@PROFILE), or after network.target. Alternatively, you could add Before= to your netctl service file.

The best way to add these directives is through additional configuration files. From netctl.unit(5):
Along with a unit file foo.service, a directory foo.service.d/ may exist. All files with the suffix ".conf" from this directory will be parsed after the file itself is parsed. This is useful to alter or add configuration settings to a unit, without having to modify their unit files. Make sure that the file that is included has the appropriate section headers before any directive. Note that for instanced units this logic will first look for the instance ".d/" subdirectory and read its ".conf" files, followed by the template ".d/" subdirectory and reads its ".conf" files.

Loading...