[systemd-devel] Execute custom command whenever network interface appears

Lennart Poettering lennart at poettering.net
Tue Feb 3 10:50:21 PST 2015


On Sun, 14.12.14 11:50, DimanNe (dimanne at ya.ru) wrote:

> Hello,

> I read manual about systemd-networkd module
> (http://www.freedesktop.org/software/systemd/man/systemd.network.html),
> and as far as I know, I can do only basic actions (like run dhcp, or
> assign static addresses/mac/routes and so on), but in general I want
> to run some script or command.
> 
> Here is real world example - https://wiki.archlinux.org/index.php/ZTE_MF_823_(Megafon_M100-3)_4G_Modem
> If you are using usb modem, you should
> 1) run dhcp
> 2) run curl/wget with special url
> 
> so, my question, it it possible just now (how?)? If not, what is the best approach to accomplish described above task?

No, this is currently not supported, and it is unlikely that we ever
will. In general we are not really convinced that doing callouts from
lower layers into higher layers of the stack is something to support.

If you want to do something like this make the higher stack subscribe
to changes from the lower stack. In scripts you can use
systemd-networkd-wait-online for that, to a certain level...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list