20

I have VPS, and after checking systemctl, I noticed that my fwupd-refresh.service failed.

terminal

Can you explain the problem, and could you help to fix it?

Pablo Bianchi
  • 17,371
seesharp
  • 313

4 Answers4

20

In some cases this error can be safely ignored. fwupd-refresh.service just executes /usr/bin/fwupdmgr refresh command and treats exit status 2 as success (see last 2 lines of fwupd-refresh.service). But fwupdmgr can also successfully exit with status 0, which will be wrongfully interpreted by systemd as an error.

  • systemctl cat fwupd-refresh:

    # /lib/systemd/system/fwupd-refresh.service
    [Unit]
    Description=Refresh fwupd metadata and update motd
    Documentation=man:fwupdmgr(1)
    After=network.target
    

    [Service] Type=oneshot CacheDirectory=fwupdmgr StandardError=null DynamicUser=yes RestrictAddressFamilies=AF_NETLINK AF_UNIX AF_INET AF_INET6 SystemCallFilter=~@mount ProtectKernelModules=yes ProtectControlGroups=yes RestrictRealtime=yes SuccessExitStatus=2 ExecStart=/usr/bin/fwupdmgr refresh

  • sudo /usr/bin/fwupdmgr refresh:

    ...
    Successfully downloaded new metadata: 0 local devices supported
    
  • echo $?: 0

  • man fwupdmgr:

    EXIT STATUS
          Commands that successfully execute will return "0", but commands that have no actions but successfully execute will return "2".
    
Shevchuk
  • 373
14

In my own case (Ubuntu Server 20.04 with latest updates), DynamicUser=no provides quick&dirty solution.

First, run "systemctl edit fwupd-refresh" and enter:

[Service]
DynamicUser=no

Then, run "systemctl restart fwupd-refresh" and enjoy.

2

fwupd-refresh.service Loaded: masked

A service that is masked is disabled and can't be activated by an other unit (timers, targets, services...) that needs it or manually. It's the stronger version of disabling a service.

fwupd-refresh.timer: ...failed...unit fwupd-refresh is masked.

To change this:

sudo systemctl unmask fwupd-refresh

Then this:

sudo systemctl daemon-reload && sudo systemctl start fwupd-refresh.service
systemctl list-units --failed

If fwupd-refresh is listed as failed then:

Uncomment #DynamicUser=yes in /lib/systemd/system/fwupd-refresh.service

https://www.freedesktop.org/software/systemd/man/systemd.exec.html#DynamicUser=

2

I've solved my problem with it https://github.com/fwupd/fwupd/wiki/PluginFlag:legacy-bios

Simply adding "bios" at the end of this line DisabledPlugins=test;invalid;bios in

/etc/fwupd/daemon.conf