GithubHelp home page GithubHelp logo

PreUp/PostDown about netctl HOT 4 CLOSED

dkasak avatar dkasak commented on June 19, 2024
PreUp/PostDown

from netctl.

Comments (4)

joukewitteveen avatar joukewitteveen commented on June 19, 2024

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.

dkasak avatar dkasak commented on June 19, 2024

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.

joukewitteveen avatar joukewitteveen commented on June 19, 2024

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.

lerouxju avatar lerouxju commented on June 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.