Comment 28 for bug 1654600

Revision history for this message
SergeiFranco (sergei-franco) wrote :

Hello,

Yes, I am fully aware that my /var/run->/run replacement in that script is a hack.

To be clear I am not testing in Zesty but Ubuntu 16.04.2 LTS Xenial.

The setup is following:
/dev/sda1 on / type xfs (rw,relatime,attr2,inode64,noquota)
/dev/sdc on /var type xfs (rw,relatime,attr2,inode64,noquota)

Every single machine we (my and my colleague) tested with the updated unit still hangs.

As var as I can tell they never reboot.

I have posted a question regarding this issue to systemd mailing list, and one of the responses was the following:

"""
> [Unit]
> Description=Unattended Upgrades Shutdown
> DefaultDependencies=no
> Before=shutdown.target reboot.target halt.target network.target
> local-fs.target

Well, you order if before local-fs.target, which means it is stopped
after local-fs.target. You get exactly what you ask for. If this is
wrong, fix unit definition, but we do not really know what is
appropriate for this service.

> Documentation=man:unattended-upgrade(8)
>
> [Service]
> Type=oneshot
> RemainAfterExit=yes
> ExecStop=/usr/share/unattended-upgrades/unattended-upgrade-shutdown --debug
> TimeoutStopSec=900
>
> [Install]
> WantedBy=shutdown.target
>
> It appears no one who is involved in this fix understands systemd (which is
> very worrying!).
>
> How does one would fix this unit so it is ran before the file systems get
> unmounted?
>

Order it

After=local-fs.target
"""
"Obviously" according to systemd mailing list if I want to things to run Before I need to use After!

So I believe the confusion is with what exactly Before and After mean in systemd units.

Today I will be testing various combinations with After/Before to see if I can make sense of it.