-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PreUp/PostDown #12
Comments
This can be done using systemd units directly. Just specify Before= in a custom systemd unit that takes care of the StartPre/StopPost actions. |
I can see how this would solve the ExecStartPre problem, but wouldn't ExecStopPost also be executed immediately, and not AFTER This seems fairly complicated for such a simple procedure. Theoretically, would there be a problem with the approach I mentioned in the first post (ExecStart{Pre,Post} in the EDIT: I guess my suggestion might not work after all since the device of the interface doesn't exist at the time |
Whatever you want to do is possible using systemd logic, read systemd.unit and systemd.service for all the details. The only parts where it is non-trivial to use systemd logic is covered by netctl's ExecUpPost and ExecDownPre. Unless you come up with some very convincing use-case, patches to add back ExecUpPre and ExecDownPost will not be merged. I'm sorry for being so brief, but I'm a bit busy at the moment. |
I think there might be a use-case when ExecUpPre and ExecDownPost are requested: when using netctl-ifplugd. In my case I need to restart my firewall (Shorewall) when netctl-ifplugd detects that a link goes down. And from what I understand it is not possible to do it with systemd as the different netctl-ifplugd@..service do not stop by themself when interfaces go down. They just exec netctl stop on the relevant interfaces. Thanks a lot. |
netcfg had PreUp and PostDown which netctl seems to be missing (in the man pages, I only found mention of ExecStartPost and ExecDownPre). Would it be possible to implement these? It seems it would be very easy to do so by adding ExecStartPre and ExecStopPost options in the corresponding systemd service file for a profile.
My concrete use case for this in netcfg was a Bluetooth tethering profile. I used the PreUp to set up a Bluetooth bnep interface through pand and the PostDown to tear the Bluetooth connection down after the profile was brought down. Can this perhaps be implemented in netctl in another way?
The text was updated successfully, but these errors were encountered: