Comments (4)
This can be done using systemd units directly. Just specify Before= in a custom systemd unit that takes care of the StartPre/StopPost actions.
from netctl.
I can see how this would solve the ExecStartPre problem, but wouldn't ExecStopPost also be executed immediately, and not AFTER netctl@<profile>.service
is stopped, like it is supposed to? That would mean I'd have to have two custom unit files, one for Pre actions and one for Post actions. But since After/Before only specify ordering, wouldn't I also need a Requires somewhere too?
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 netctl@<profile>.service
)? If not, would you consider accepting a patch that adds the relevant ExecUpPre and ExecDownPost directives to netctl which are implemented in that way?
EDIT: I guess my suggestion might not work after all since the device of the interface doesn't exist at the time netctl@<profile>.service
is started and it has an After directive which specifies the device of the interface. Is this correct?
from netctl.
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.
from netctl.
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 [email protected] do not stop by themself when interfaces go down. They just exec netctl stop on the relevant interfaces.
So unless you know another way to do what I like to do could you please consider merging the patches?
Thanks a lot.
from netctl.
Related Issues (20)
- Ask for password on network connect HOT 3
- [email protected] is not started after interface is inserted HOT 9
- Reduce/remove waiting time for pluggable WiFi devices on startup HOT 9
- netctl-ifplugd Unable to get ip address HOT 3
- [Feature request] Auto retry wifi connection HOT 5
- Add option for accept_ra value HOT 6
- Support stable private IPv6 addresses HOT 4
- Allow regular user to `netctl switch-to <profile>` HOT 2
- [Feature request] Blacklist access points. HOT 10
- NO SSID environment variable HOT 6
- Only one hook works at a time HOT 3
- netctl wanted by multi-user.target, slowing down boot HOT 4
- netctl-auto list_netctl_auto_interfaces() function bug HOT 1
- Add a command for WPS Push Button HOT 4
- How to configure pppoe with macvlan interface? HOT 7
- Check config file when restart command HOT 5
- When an issue occurs in the ISP, the systemd service of pppoe will fail. HOT 10
- Hook not executed for netctl-auto HOT 8
- Error while executing the script via ExecUpPost HOT 1
- No way to leave resolv.conf alone with DHCP profile (?) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from netctl.