<div dir="auto">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)?<div dir="auto"><br></div><div dir="auto">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".</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jul 15, 2023, 19:20 Demi Marie Obenour <<a href="mailto:demi@invisiblethingslab.com">demi@invisiblethingslab.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">What is the appropriate solution for running a non-idempotent command<br>
from udev?  One command needs to be run exactly once when a network<br>
interface appears, and another command needs to be run exactly once when<br>
a network interface disappears.  Both commands need to run after<br>
network-pre.target, but that can be handled in the script themselves.<br>
-- <br>
Sincerely,<br>
Demi Marie Obenour (she/her/hers)<br>
Invisible Things Lab<br>
</blockquote></div>