[systemd-devel] Dynamic generators (after systemd start)

Andrey Borzenkov arvidjaar at gmail.com
Fri Mar 4 11:37:40 PST 2011


I am playing with per-interface auto-generated units (for the case
without NetworkManager :) ) and so far it looks quite promising -
using trivial unit file and even more trivial generator I
automatically get interfaces up at the correct time:

netif at eth0.service - Interface Setup for eth0
          Loaded: loaded (/etc/systemd/system/netif at .service)
          Active: active (running) since Fri, 04 Mar 2011 22:28:03
+0300; 2min 41s ago
         Process: 1714 ExecStart=/sbin/ifup %I daemon (code=exited,
status=0/SUCCESS)
        Main PID: 1809 (ifplugd)
          CGroup: name=systemd:/system/netif at .service/eth0
                  └ 1809 /sbin/ifplugd -I -b -i eth0

netif at wlan0.service - Interface Setup for wlan0
          Loaded: loaded (/etc/systemd/system/netif at .service)
          Active: active (running) since Fri, 04 Mar 2011 22:28:04
+0300; 2min 40s ago
         Process: 1713 ExecStart=/sbin/ifup %I daemon (code=exited,
status=0/SUCCESS)
          CGroup: name=systemd:/system/netif at .service/wlan0
                  ├ 1931 /usr/sbin/wpa_supplicant -B -i wlan0 -c /etc/wpa_s...
                  ├ 1933 /sbin/ifplugd -I -b -i wlan0
                  └ 2186 dhclient -1 -q -lf /var/lib/dhcp/dhclient-wlan0.le...

Now, the question is - what to do with hot-pluggable interfaces? Can I
generate unit after systemd has been started and inform it? I think,
this is becoming quite useful now.

For reference, current proof of concept attached. We are using mostly
the same ifcfg files, so may be at least some design can be shared
with Fedora ...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: netif at .service
Type: application/octet-stream
Size: 254 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20110304/90fd5667/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: net-generator.sh
Type: application/x-sh
Size: 763 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20110304/90fd5667/attachment-0001.sh>


More information about the systemd-devel mailing list