[systemd-devel] Running a non-idempotent command from udev

Mantas Mikulėnas grawity at gmail.com
Sat Jul 15 18:00:03 UTC 2023


Is that "once per boot", "once per interface appearance", or "once per
physical NIC lifetime"? Can the command check its effects directly (i.e.
check whether a setting has been set, or whatever the task is)?

If it's once per boot, a flag file in /run/thing_done.$ifname would be a
common solution... If it needs to be done again if the interface disappears
and reappears – udev ENV{thing_done}="1".

On Sat, Jul 15, 2023, 19:20 Demi Marie Obenour <demi at invisiblethingslab.com>
wrote:

> What is the appropriate solution for running a non-idempotent command
> from udev?  One command needs to be run exactly once when a network
> interface appears, and another command needs to be run exactly once when
> a network interface disappears.  Both commands need to run after
> network-pre.target, but that can be handled in the script themselves.
> --
> Sincerely,
> Demi Marie Obenour (she/her/hers)
> Invisible Things Lab
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20230715/1e9396dc/attachment.htm>


More information about the systemd-devel mailing list