[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#834414: apt-daily.service fails permanently and quietly as it runs before network is up



On Thu, Jun 22, 2017 at 11:04:23AM +0300, Teemu Likonen wrote:
> Teemu Likonen [2017-06-22 09:12:03+03] wrote:
> 
> > Systemd service apt-daily-upgrade.service can't do its job because it
> > tries to run on boot before network connection. The associated timer is
> > scheduled to run on
> >
> >     [Timer]
> >     OnCalendar=*-*-* 6:00
> >     RandomizedDelaySec=60m
> >     Persistent=true
> >
> > and because my computer is usually off at that moment the
> > Persistent=true rule makes the timer run the service immediately at
> > boot. That fails because network is not configured yet.
> 
> Systemd's dependencies seem to be correct:
> 
> 
>     $ systemd-analyze critical-chain apt-daily-upgrade.service
> 
>     The time after the unit is active or started is printed after the
>     "@" character. The time the unit takes to start is printed after the
>     "+" character.
> 
>     apt-daily-upgrade.service +6.696s
>     └─apt-daily-upgrade.timer @7.496s
>       └─apt-daily.timer @7.496s
>         └─network-online.target @7.496s
>           └─NetworkManager-wait-online.service @1.695s +5.800s
>             └─NetworkManager.service @1.657s +37ms
>               └─dbus.service @1.633s
>                 └─basic.target @1.620s
>                 [...]
> 
> 
> So apt-daily-upgrade.service is started immediately after
> network-online.target (@7.496s) but network is not really ready yet.
> 

It's always going to be imprecise, I think, and depends on the
definition of onlineness. NetworkManager says its online as soon
as one interface has an IPv4 address.

This will be fixed shortly, together with the resume cases, by a
helper that waits for the sources in sources.list to be online, and
retrying quicker if they are not (like 30s time out for waiting,
and then retrying every 15 minute or so - I guess it's fairly
cheap, so we can go with a relatively low restart time).

-- 
Debian Developer - deb.li/jak | jak-linux.org - free software dev
                  |  Ubuntu Core Developer |
When replying, only quote what is necessary, and write each reply
directly below the part(s) it pertains to ('inline').  Thank you.


Reply to: