systemd PathExists triggers

Christian Ehrhardt christian.ehrhardt at canonical.com
Thu Oct 1 07:32:25 UTC 2020


On Wed, Sep 30, 2020 at 7:43 PM Brian Murray <brian at ubuntu.com> wrote:
>
> Recently there was a systemd change regarding PathExists for
> systemd.path units that made systemd behave the way it was documented to
> work. The effect being that if the PathExists or PathExistsGlob
> condition is met the service is continually started which may not be the
> behavior some packages expect as it didn't used to work that way.
>
> As an example apport's autoreport service uses PathExistsGlob to check
> for a .crash file and then calls whoopsie-upload-all which used to run
> once when the .crash file appeared. As of Groovy whoopsie-upload-all was
> called continuously thereby causing systemd to use 100% of your CPU[1].
>
> While this is resolved for apport's case, the Foundation's team thought
> it was worth mentioning as other package's services may also be
> impacted.

Thanks Brian for your warning!
I see in your list some .path files e.g. the aforementioned
apport-autoreport.path
that I understand if using a PathExist* will have changed. Of those the list [2]
contains 9 to look at.

I beg your pardon, but the list is vast due to including any
"Type=oneshot" as well.
And from the summary you gave I don't see why those are included as well.
Looking at the first in the list that probably everyone has installed I see:
a)
/lib/systemd/system/alsa-restore.service there are no associated .path
files, only
ConditionPathExists in the unit itself - are those also affected?
b)
Looking slightly further /lib/systemd/system/apt-daily.service even
has no associated
.path nor any *Exist* statement.

My question would now be - are those files of type (a) or (b) all also
affected in
some way or is the "critical list" actually much shorter? I was wondering if you
could help to clarify before everyone that feels responsible for a package with
a file in that list is diving into and re-understanding the case.

Thanks in advance,
Christian

> An archive search[2] (thanks Seth!) was done of services which are
> Type=oneshot or utilize a PathExists or PathExistsGlob. Briefly scanning
> the list the following packages should probably be looked at:
>
> mandos-client
> ostree
> python-diskimage-builder
> ubuntu-report
>
> [1] http://launchpad.net/bugs/1891657
> [2] https://paste.ubuntu.com/p/k5Gj7rQ9FX/
>
> Cheers,
> --
> Brian Murray
>
> --
> ubuntu-devel mailing list
> ubuntu-devel at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel



-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd



More information about the ubuntu-devel mailing list