[systemd-devel] starting/stopping network interfaces with systemd

Lennart Poettering lennart at poettering.net
Mon Oct 10 11:59:27 PDT 2011


On Sat, 08.10.11 23:34, Cliff Brake (cliff.brake at gmail.com) wrote:

> 
> On Sat, Oct 8, 2011 at 11:09 AM, Cliff Brake <cliff.brake at gmail.com> wrote:
> >> and a service file like this:
> >>
> >> cat networl at .service:
> >> [Service]
> >> Type=oneshot
> >> RemainAfterExit=yes
> >> ExecStart=/sbin/ifup %i
> >> ExecStop=/sbin/ifdown %i
> >> StandardOutput=syslog+console
> >
> > I'm still not successfull in getting ifup to run on boot (after the
> > NIC is detected) or on NIC insertion.
> 
> This is actually working for me now on bootup, or first NIC insertion.
>  I'm not sure what I did wrong earlier -- perhaps missed reloading the
> systemd config files or something ...
> 
> However, it does not work for subsequent NIC insertions.  It appears
> that stop is not getting executed when the device is removed, as
> network at eth0.service is always listed as active after the NIC is
> installed, and then removed.

TO make that work you need "BindTo=.....device" in the .service file
which binds runtime of your ifup service to the device being plugged in.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list