Pamac-offline-upgrade.service fails

The situation

Here is a long existing non standard manjaro-system using sway. I switch on the auto update on shut down in pamac-gtk.
I installed plymouth an activated the hook in /etc/mkinitcpio.conf and the splash screen in grub.
At shutdown plymouth shows a grafical screen with update but it don’t work.

Search for error

3 updates should be installed:

# pamac checkupdates             
Warnung: Aktualisierungen der Entwicklerpakete als Root abrufen
Warnung: Konfiguriere Build-Verzeichnis /var/cache/pamac
3 Aktualisierungen verfügbar:
gsfonts            20200910-2 -> 20200910-3  extra
pcre2              10.40-3    -> 10.42-2     core
zenity             3.44.1-1   -> 3.44.2-1    extra

service is enabled

# systemctl status pamac-offline-upgrade.service
○ pamac-offline-upgrade.service - Offline System Upgrade using Pamac
     Loaded: loaded (/usr/lib/systemd/system/pamac-offline-upgrade.service; enabled; preset: disabled)
     Active: inactive (dead)
       Docs: http://www.freedesktop.org/wiki/Software/systemd/SystemUpdates

on shutdown pamac fails

# journalctl | grep pamac
Nov 22 18:54:16 PC dbus-daemon[1555]: [session uid=1001 pid=1555] Activating via systemd: service name='org.gtk.vfs.Metadata' unit='gvfs-metadata.service' requested by ':1.28' (uid=1001 pid=1822 comm="pamac checkupdates -q")
Nov 22 18:54:18 PC dbus-daemon[598]: [system] Activating via systemd: service name='org.manjaro.pamac.daemon' unit='pamac-daemon.service' requested by ':1.56' (uid=1001 pid=1800 comm="pamac checkupdates -q --refresh-tmp-files-dbs --us")
Nov 22 18:54:18 PC dbus-daemon[598]: [system] Successfully activated service 'org.manjaro.pamac.daemon'
Nov 22 18:54:19 PC systemd[1]: pamac-daemon.service: Deactivated successfully.
Nov 22 18:54:19 PC dbus-daemon[1555]: [session uid=1001 pid=1555] Activating via systemd: service name='org.freedesktop.Notifications' unit='mako.service' requested by ':1.24' (uid=1001 pid=1661 comm="pamac-tray-plasma")
Nov 22 18:58:02 PC systemd[1]: pamac-cleancache.timer: Deactivated successfully.
Nov 22 18:58:02 PC systemd[1]: pamac-mirrorlist.timer: Deactivated successfully.
Nov 22 18:58:04 PC systemd[1]: pamac-offline-upgrade.service: Main process exited, code=killed, status=15/TERM
Nov 22 18:58:04 PC systemd[1]: pamac-offline-upgrade.service: Failed with result 'signal'.

Starting service manually it installs the updates

# systemctl start pamac-offline-upgrade.service

# systemctl status pamac-offline-upgrade.service
○ pamac-offline-upgrade.service - Offline System Upgrade using Pamac
     Loaded: loaded (/usr/lib/systemd/system/pamac-offline-upgrade.service; enabled; preset: disabled)
     Active: inactive (dead) since Wed 2023-11-22 19:07:31 CET; 5s ago
       Docs: http://www.freedesktop.org/wiki/Software/systemd/SystemUpdates
    Process: 9539 ExecStartPre=/usr/bin/plymouth change-mode --updates (code=exited, status=1/FAILURE)
    Process: 9540 ExecStartPre=/usr/bin/rm /system-update (code=exited, status=0/SUCCESS)
    Process: 9541 ExecStart=/usr/bin/pamac upgrade --no-aur --no-confirm (code=exited, status=0/SUCCESS)
    Process: 9626 ExecStartPost=/usr/bin/plymouth system-update --progress=50 (code=exited, status=1/FAILURE)
    Process: 9627 ExecStartPost=/usr/bin/plymouth system-update --progress=100 (code=exited, status=1/FAILURE)
    Process: 9628 ExecStartPost=/usr/bin/sleep 2 (code=exited, status=0/SUCCESS)
   Main PID: 9541 (code=exited, status=0/SUCCESS)
        CPU: 1.787s

Nov 22 19:07:27 PC systemd[1]: Starting Offline System Upgrade using Pamac...
Nov 22 19:07:31 PC systemd[1]: pamac-offline-upgrade.service: Deactivated successfully.
Nov 22 19:07:31 PC systemd[1]: Finished Offline System Upgrade using Pamac.
Nov 22 19:07:31 PC systemd[1]: pamac-offline-upgrade.service: Consumed 1.787s CPU time.

Conclusion

Can someone help me?

Thank you

Try systemctl start --now pamac-offline-upgrade

–now saves the command, oh and systemctl understands service so not needed

??

--now is a modifier for enable, disable, or mask.
It will start or stop the service respective to and in addition to those.

Your version, if functional, would be roughly equal to systemctl start start.

1 Like

Thanks for trying

It seems not to be a problem of systemctl.
Using pacman in pamac-offline-upgrade.service works:
ExecStart=/usr/bin/pacman -Suu --noconfirm

# journalctl | grep pamac
Nov 23 07:41:03 PC systemd[1]: pamac-offline-upgrade.service: Deactivated successfully.

I could be satisfied but after the next pamac update it will use pamac again.

I think pamac misses a service which works on multi-user.target but not in shutdown.target. So I need a better debug level for pamac.

Package updates on shutdown are currently broken: Issues · Applications / pamac · GitLab

Thanks

I left a link in It can't upgrade the system at shutdown, if plymouth is not installed. (#1387) · Issues · Applications / pamac · GitLab

Well, if pacman works, you could use a drop in:

systemctl edit pamac-offline-upgrade.service

Or create your own pacman version.

https://wiki.archlinux.org/title/Systemd

That’s what I did. It worked until a reinstall of pamac.

That’s an idea …

My Solution

I had to uncheck autoupdates in pamac manager.

So I created a cronjob /etc/cron.daily/autoupdate:

#!/bin/bash

/usr/bin/pamac checkupdates
if [ $? -eq 100 ]; then 
    /usr/bin/touch /var/autoupdate/system-update
  # pacman needs to update its database
  # pamac only updates its own  
  # /usr/bin/pamac upgrade -w --no-confirm
  /usr/bin/pacman -Syyuuw --noconfirm  
fi

I created a directory /var/autoupdate/ because the cronjob has not enough permissions to root directory and temporary directories are umounted when update works.

Changing permissions:

chmod 1777 /var/autoupdate

Then I copied /usr/lib/systemd/system/pamac-offline-upgrade.service to /etc/systemd/system/autoupdate.service and customized it.

[Unit]
Description=Offline System Upgrade using Pamac
ConditionACPower=true
ConditionPathExists=/var/autoupdate/system-update
Documentation=http://www.freedesktop.org/wiki/Software/systemd/SystemUpdates

DefaultDependencies=no
After=plymouth-poweroff.service plymouth-reboot.service
Before=umount.target
After=network-online.target
Wants=network-online.target

[Service]
# We are done when the script exits, not before
Type=oneshot
# Upgrade output goes to journal and on-screen.
#StandardOutput=journal+console
StandardOutput=tty
ExecStartPre=-/usr/bin/plymouth change-mode --updates
ExecStartPre=/usr/bin/rm /var/autoupdate/system-update
ExecStartPost=-/usr/bin/plymouth system-update --progress=50
ExecStart=/usr/bin/pacman -Suu --noconfirm
ExecStartPost=-/usr/bin/plymouth system-update --progress=100
ExecStartPost=-/usr/bin/sleep 2

[Install]
WantedBy=shutdown.target

At least I enabeled the service:

systemctl enable --now autoupdate.service

Edit: Pacman needs to update its database. So I edited /etc/cron.daily/autoupdate.

It’s not what you said you did.

Drop in files are there to add your changes to the default file, that way you get the newest version but with your changes. The alternative is to copy the file to /etc/systemd/system and edit it, but that file will never be updated unless you do it.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.