Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#40806 - [netctl] ExecPostUp executed before network.target is reached

Attached to Project: Arch Linux
Opened by Andrew Morgan (slipperyfrob) - Wednesday, 11 June 2014, 20:08 GMT
Last edited by Jouke Witteveen (jouke) - Tuesday, 17 June 2014, 21:11 GMT
Task Type Bug Report
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:
Within netctl, users can run commands after the network connection is set up automatically by specifying them as "ExecPostUp". The problem is that the command run for "ExecPostUp" is executed before systemd's network.target is reached, which is an issue if the "ExecPostUp" command is something like "systemctl start $service", where $service requires network.target. This ultimately leads to an infinite loop of waiting, visible as netctl hanging forever when a profile is started.

Additional info:
Currently running netctl 1.7-1 from [core].


Steps to reproduce:
- Let $service be any systemd service which depends on network.target, and $profile be any netctl profile.
- Take down all network connections, and ensure $service is stopped.
- Put the line
ExecUpPost="systemctl start $service"
into /etc/netctl/$profile, and then use netctl to start that profile.

netctl then hangs, and you can use "systemctl list-jobs" to see that "netctl@$profile.service" is listed as "running" (waiting for systemctl start $service to complete), and "$service.service" and "network.target" are listed as "waiting" (for netctl@$profile.service to finish starting).
This task depends upon

Closed by  Jouke Witteveen (jouke)
Tuesday, 17 June 2014, 21:11 GMT
Reason for closing:  Not a bug
Comment by Andrew Morgan (slipperyfrob) - Wednesday, 11 June 2014, 20:21 GMT
This can be worked around by backgrounding-and-delaying the execution of "systemctl start $service" so that it happens after the netctl command completes.

But really, something which is executed "post-interface-up" should be guaranteed to see that network.target has been reached.
Comment by Jouke Witteveen (jouke) - Tuesday, 17 June 2014, 11:45 GMT
Stuff like this should be handled via systemd service dependencies. ExecPostUp is meant for commands that are needed as part of the network configuration: they need to be completed before the profile is considered 'up'.

I consider this intended behavior. Additions to the documentation are welcome, otherwise I will close this bug.
Comment by Andrew Morgan (slipperyfrob) - Tuesday, 17 June 2014, 16:28 GMT
You are absolutely right. Thank you.

Loading...