Commit Graph

11 Commits

Author SHA1 Message Date
Paul Menzel
bf1b876e56 data/motd/fwupd-refresh: Only order after network.target
From [Lennart’s answer on systemd-devel][1]:

> fwupd.target should not list the various network management solutions,
> that is unnecessary, and ordering after network.target should be
> sufficient to achieve the same, in a generic fashion. i.e. network
> managers should order themselves before network.target, so that
> ordering yourself after that automatically orders you after all
> implementations at once...

So, remove the unneeded targets. As the service unit is not
installed/enabled, and instead called by a timer, the system will most
probably be online already.

[1]: https://lists.freedesktop.org/archives/systemd-devel/2020-March/044205.html
     "Best practices for starting unit only if network is online"
2020-04-01 13:14:41 -05:00
Mario Limonciello
5d8c244b2e trivial: correct a fwupd-refresh.service filling error 2020-02-02 11:27:20 +00:00
Mario Limonciello
315fd4dee9 trivial: motd: correct the systemd path to include package name 2020-01-16 21:00:47 -06:00
Mario Limonciello
d81ea2e3fc Move MOTD population into the daemon
This allows it to be refreshed anytime the daemon updates rather
than once a day by a systemd job.

As part of this change, remove the logging from `fwupdmgr` which
was only used for motd purposes.
2020-01-16 10:33:43 -06:00
Mario Limonciello
0b9bfec150 Add a systemd preset file for fwupd-refresh.service
Makes `fwupd-refresh.service` strictly opt-in.

Some distros are defaulting to all systemd services on and causing
more refreshes than desirable by default, especially when using
both `gnome-software` and `fwupd-refresh.service`
2019-10-20 14:31:13 -05:00
Mario Limonciello
561751faff trivial: don't try to enable LVFS from systemd 2019-10-18 09:21:19 -05:00
Mario Limonciello
80d6581be8 trivial: fwupd-refresh: activate motd if using systemd v243 or later
It turns out there is some bug in systemd v242 or less that runtime
directories can't be used.  So only populate motd when we know that
we have a newer systemd
2019-10-15 15:56:33 -05:00
Mario Limonciello
2a4fa179ff trivial: fwupd-refresh: allow exit code 2 for success
This is no supported devices, and shouldn't cause systemd failures
for fwupd-refresh.
2019-10-15 15:56:33 -05:00
Mario Limonciello
4f13bbc7e3 trivial: motd: disable updating motd for now
It looks like a systemd bug is happening, but let it be diagnosed upstream
systemd first.

https://github.com/systemd/systemd/issues/13688
2019-09-30 14:09:18 -05:00
Mario Limonciello
dc7e7c3808 trivial: fwupd-refresh: fix a clash with fwupd.service (Closes: #941360)
`fwupd-refresh.service` uses `DynamicUser=true` which causes systemd
to make `/var/cache/fwupd` a symlink to `/var/cache/private/fwupd`.

Individual units aren't allowed to access this directory, only the ones
with the directive.  This means that `fwupd.service` stops working as
soon as a user tries to start `fwupd-refresh.service`.

The bug details are present in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=941360
2019-09-30 14:09:18 -05:00
Mario Limonciello
b390b14f8f Add support to integrate into the motd (Fixes: #1270)
Fixes Debian bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=921820

Introduce a new --log option to fwupdmgr that will log stdout to an argument.
If run under systemd, prefix that argument with $RUNTIME_DIRECTORY.

Add a new systemd unit and associated timer to regularly refresh metadata.
After the metadata refresh is complete, save the output to the motd location.

The timer and service are disabled by default and can be enabled by an admin.
2019-08-22 06:39:02 +01:00