net-auto-wired in systemd - ifplugd failed with exit code 3
On Tue, May 8, 2012 at 3:22 PM, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:
> I do in fact get exit code 3 when running the ExecStart line by hand,
> and removing -w seems to take care of it. -w seems to wait for link
> detection, but it seems anything it returns (in the above case I got 3
> because I'm currently on wireless and have no LAN to test it on) would
> cause an error? The rc.d script doesn't seem to use -w, so I'm
> wondering why that was inserted for the service file.
We'd like to consider the network.target to be up only once we have
connected to the network (so that other services can rely on this).
I only fixed this up as it was buggy when I found it, but it might be
that this behavior is not desired at all (I don't use this stuff). How
would you expect this to work?
We need to make sure no the systemd services are only considered
started when the network is actually up. Otherwise, things relying
on the network don't know when they can start.
This means that we need to use Type=forking or Type=oneshot, and in
the case of ifplugd we must daemonize and wait for the daemon to be
ready before we continue.
Also do some minor cleanup:
- don't include env files that are not used
- don't ignore return values
It is not enough to order ourselves Before network target, we must also
make sure it is pulled in. This means that anything that needs the network
to be up before they start can order themselves After=network.target.
Signed-off-by: Tom Gundersen <teg@jklm.no>
05-09-2012, 01:11 AM
Oon-Ee Ng
net-auto-wired in systemd - ifplugd failed with exit code 3
On Tue, May 8, 2012 at 9:34 PM, Tom Gundersen <teg@jklm.no> wrote:
> On Tue, May 8, 2012 at 3:22 PM, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:
>> I do in fact get exit code 3 when running the ExecStart line by hand,
>> and removing -w seems to take care of it. -w seems to wait for link
>> detection, but it seems anything it returns (in the above case I got 3
>> because I'm currently on wireless and have no LAN to test it on) would
>> cause an error? The rc.d script doesn't seem to use -w, so I'm
>> wondering why that was inserted for the service file.
>
> We'd like to consider the network.target to be up only once we have
> connected to the network (so that other services can rely on this).
>
> I only fixed this up as it was buggy when I found it, but it might be
> that this behavior is not desired at all (I don't use this stuff). How
> would you expect this to work?
I was under the impression that the net-auto-wire{d,less} services
would not guarantee that network WOULD be up, they're just monitors
that bring network up IF there's a connection. So, for example, if I
start net-auto-wired.service now when I'm on-the-go, 'active' would
indicate that its currently monitoring for a LAN connection (ie -
ifplugd is started), not that there IS a connection ready.
I'm not very familiar with systemd myself, but it seems to (the
uneducated) me that if network.target should only be up when there's a
usable connection, then net-auto-* should not provide/before/whatever
network.target. How does (for example) networkmanager work? From a
quick grep, it seems to have two service files, though since I don't
use it I can't pretend to understand how they're used.
05-09-2012, 01:25 AM
Oon-Ee Ng
net-auto-wired in systemd - ifplugd failed with exit code 3
On Wed, May 9, 2012 at 9:11 AM, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:
> On Tue, May 8, 2012 at 9:34 PM, Tom Gundersen <teg@jklm.no> wrote:
>> On Tue, May 8, 2012 at 3:22 PM, Oon-Ee Ng <ngoonee.talk@gmail.com> wrote:
>>> I do in fact get exit code 3 when running the ExecStart line by hand,
>>> and removing -w seems to take care of it. -w seems to wait for link
>>> detection, but it seems anything it returns (in the above case I got 3
>>> because I'm currently on wireless and have no LAN to test it on) would
>>> cause an error? The rc.d script doesn't seem to use -w, so I'm
>>> wondering why that was inserted for the service file.
>>
>> We'd like to consider the network.target to be up only once we have
>> connected to the network (so that other services can rely on this).
>>
>> I only fixed this up as it was buggy when I found it, but it might be
>> that this behavior is not desired at all (I don't use this stuff). How
>> would you expect this to work?
>
> I was under the impression that the net-auto-wire{d,less} services
> would not guarantee that network WOULD be up, they're just monitors
> that bring network up IF there's a connection. So, for example, if I
> start net-auto-wired.service now when I'm on-the-go, 'active' would
> indicate that its currently monitoring for a LAN connection (ie -
> ifplugd is started), not that there IS a connection ready.
>
> I'm not very familiar with systemd myself, but it seems to (the
> uneducated) me that if network.target should only be up when there's a
> usable connection, then net-auto-* should not provide/before/whatever
> network.target. How does (for example) networkmanager work? From a
> quick grep, it seems to have two service files, though since I don't
> use it I can't pretend to understand how they're used.
The bottom of this page:-
http://www.h-online.com/open/features/Control-Centre-The-systemd-Linux-init-system-1565543.html?page=3
seems to indicate that network.target should only be up once a fully
configured interface is available.