Hello,

Le 20/04/2017 à 12:27, Simon McVittie a écrit :
> On Tue, 11 Apr 2017 at 17:25:00 +0000, Niels Thykier wrote:
>> On Thu, 2 Mar 2017 17:59:02 +0100 Louis Bouchard
>> <louis.bouch...@canonical.com> wrote:
>>> It now tests correctly and I am preparing an upload to our development 
>>> release.
>>
>> Any news on this?  I cannot see an upload to unstable yet, did something
>> hold you up?
> 
> The "us" referred to in "our development release" appears to have been
> Ubuntu, not Debian.
> 
> However, the systemd unit proposed by Scott Leggett is not actually the
> same as the one now shipped in Ubuntu zesty. Is this deliberate? Here
> is a diff:
> 
> --- ubuntu/debian/unattended-upgrades.service
> +++ scott/debian/unattended-upgrades.service
> @@ -1,7 +1,6 @@
>  [Unit]
>  Description=Unattended Upgrades Shutdown
> -DefaultDependencies=no
> -Before=shutdown.target reboot.target halt.target network.target 
> local-fs.target
> +After=network.target
>  Documentation=man:unattended-upgrade(8)
>  
>  [Service]
> @@ -11,4 +10,4 @@ 
> ExecStop=/usr/share/unattended-upgrades/unattended-upgrade-shutdown
>  TimeoutStopSec=900
>  
>  [Install]
> -WantedBy=shutdown.target
> +WantedBy=multi-user.target
> 
> I'm concerned that the version now shipped in Ubuntu might in fact be shut
> down *after* the network is taken down, because Before/After dependencies
> are about the order of startup: shutdown happens in the reverse order.
> So if unattended-upgrades.service has After=network.target, as in Scott's
> proposed unit, it will be started (which now does nothing) after
> network.target is started, but stopped (which is where the real work
> happens) before network.target is stopped. That seems like the right
> thing, and the version in Ubuntu zesty seems like only a partial fix.
> 
>     S
> 

First of all, I am sorry for not keeping up with my work in both bug reports.
Recent events at my employer have made things a bit more difficult, including
the recent release of Ubuntu Zesty.

The fix in Zesty is indeed incomplete, but final freeze prevented me for
including the definitive fix in Zesty. This should happen shortly.

I am also preparing a .debdiff of a proposed debian fix that I will create and
test today and tomorrow. In the meantime, here is the final unit that will be
shiped :

> [Unit]                                                                        
>                                      
> Description=Unattended Upgrades Shutdown                                      
>                                      
> After=network.target local-fs.target                                          
>                                      
> RequiresMountsFor=/var/log /var/run /var/lib /boot                            
>                                      
> Documentation=man:unattended-upgrade(8)                                       
>                                      
>                                                                               
>                                      
> [Service]                                                                     
>                                      
> Type=oneshot                                                                  
>                                      
> RemainAfterExit=yes                                                           
>                                      
> ExecStop=/usr/share/unattended-upgrades/unattended-upgrade-shutdown           
>                                      
> TimeoutStopSec=900                                                            
>                                      
>                                                                               
>                                      
> [Install]                                                                     
>                                      
> WantedBy=multi-user.target                                                    
>                                      

DefaultDependencies=no Needs to be removed as switching from shutdown.target to
multi-user.target requires to have the DefaultDependencies

RequireMountsFor= provides adequate dependencies when /var is separate.

In changing WantedBy= I ran into Debian Bug #797108 which causes the service to
not be properly enabled on upgrade. Working around that took longer than 
expected.

So hopefully I will provide a final proposition for this by End of week.

Kind regards,

...Louis


-- 
Louis Bouchard
Software engineer, Cloud & Sustaining eng.
Canonical Ltd
Ubuntu developer                       Debian Maintainer
GPG : 429D 7A3B DD05 B6F8 AF63  B9C4 8B3D 867C 823E 7A61

Reply via email to