El 23/01/23 a las 00:24, Pascal Hambourg escribió:
> Oleg A. Arkhangelsky wrote:
> > Note that we have to use '--ignore-errors'. Otherwise if we have real
> > hotplug interface that is not present at the moment of restart, `ifup`
> > returns non-zero and systemd unit fail.
> 
> "--ignore-errors" marks missing interfaces as configured, so ifup will not
> configure them when invoked by udev. In order to not fail the systemd unit
> start on ifup error, you can prefix the command with "-".
> 
> On 22/01/2023 at 20:58, Cyril Brulebois wrote:
> > 
> > with an extra ens3 declared as auto, the following seems to work fine
> > for boot-up, stop and start, and restart:
> > 
> >      [Service]
> >      Type=oneshot
> >      EnvironmentFile=-/etc/default/networking
> >      ExecStart=/sbin/ifup -a --read-environment
> >      ExecStart=/bin/sh -c 'if [ -f /run/network/restart-hotplug ]; then 
> > /sbin/ifup -a --read-environment --allow=hotplug; fi'
> >      ExecStop=/sbin/ifdown -a --read-environment --exclude=lo
> >      ExecStopPost=/usr/bin/touch /run/network/restart-hotplug
> >      RemainAfterExit=true
> >      TimeoutStartSec=5min
> 
> That seems needlessly convoluted. What about this:
> 
>     [Service]
>     Type=oneshot
>     EnvironmentFile=-/etc/default/networking
>     ExecStart=/sbin/ifup -a --read-environment
>     ExecStart=-/sbin/ifup -a --read-environment --allow=hotplug
>     ExecStop=/sbin/ifdown -a --read-environment --exclude=lo
>     RemainAfterExit=true
>     TimeoutStartSec=5min
> 
> "start" and "restart" configure all existing "auto" and "allow-hotplug"
> interfaces.
> Missing "allow-hotplug" interfaces do not be marked as configured (so that
> they can be configured by udev) and do not make "start" or "restart" fail.

Thanks everybody for the inputs. I've applied Paul's solution, and the
generated .deb can be downloaded from here:

https://salsa.debian.org/debian/ifupdown/-/jobs/3841392/artifacts/raw/debian/output/ifupdown_0.8.41~1.gbp3a6fae+salsaci+20230123+42_amd64.deb

Would it be possible for you (Oleg, Paul, Jeff, kibi et al.) to give it
a try?

Cheers,

 -- S

Attachment: signature.asc
Description: PGP signature

Reply via email to