I think Raspbian ships with a version of snapd that is so old it doesn’t correctly self-refresh to the current release when installing some snaps. You may have better luck if you run sudo snap install core before installing scummvm.
You can check what snapd version you’re running by typing snap version.
I ran the sudo snap install core, rebooted, and tried again.
sudo snap install scummvm
error: cannot perform the following tasks:
restart of [scummvm.daemon] (# systemctl restart snap.scummvm.daemon.service
Job for snap.scummvm.daemon.service failed.
See “systemctl status snap.scummvm.daemon.service” and “journalctl -xe” for details.
version confirmation:
pi@raspberrypi:~ $ snap version
snap 2.48
snapd 2.48
series 16
raspbian 10
kernel 5.4.72-v7l+
Unfortunately, I don’t have a Pi4/400 to test with, so I can only guess what went wrong here.
I wonder if this issue is related to snapd on Raspbian/Raspberry Pi OS. Could you please try to sudo snap install hello-world and run the hello world command afterwards to check if Snaps are working in general?
Another great test would be to check if you can run the ScummVM snap with Ubuntu Desktop 20.10 on your Pi (via https://ubuntu.com/download/raspberry-pi), so if you have a spare SD card…
pi@pi-desktop:~$ snap changes
ID Status Spawn Ready Summary
1 Done 44 days ago, at 07:17 MST today at 11:32 MST Initialize system state
2 Done today at 11:32 MST today at 11:32 MST Initialize device
3 Done today at 11:43 MST today at 11:43 MST Install “hello-world” snap
4 Error today at 11:46 MST today at 11:46 MST Install “scummvm” snap
systemctl output:
pi@pi-desktop:~$ systemctl
UNIT LOAD ACTIVE SUB >
proc-sys-fs-binfmt_misc.automount loaded active waiting >
dev-loop0.device loaded activating tentative >
dev-loop1.device loaded activating tentative >
dev-loop2.device loaded activating tentative >
dev-loop3.device loaded activating tentative >
dev-loop4.device loaded activating tentative >
dev-loop5.device loaded activating tentative >
dev-loop6.device loaded activating tentative >
sys-devices-platform-emmc2bus-fe340000.emmc2-mmc_host-mmc0-mmc0:59b4-block-mmcblk0-mmcblk0p1.device loaded active plugged >
sys-devices-platform-emmc2bus-fe340000.emmc2-mmc_host-mmc0-mmc0:59b4-block-mmcblk0-mmcblk0p2.device loaded active plugged >
sys-devices-platform-emmc2bus-fe340000.emmc2-mmc_host-mmc0-mmc0:59b4-block-mmcblk0.device loaded active plugged >
sys-devices-platform-scb-fd500000.pcie-pci0000:00-0000:00:00.0-0000:01:00.0-usb1-1\x2d1-1\x2d1.1-1\x2d1.1:1.0-sound-card1.device loaded active plugged >
sys-devices-platform-scb-fd580000.ethernet-net-eth0.device loaded active plugged >
sys-devices-platform-soc-fe00b840.mailbox-bcm2835_audio-sound-card0.device loaded active plugged >
sys-devices-platform-soc-fe201000.serial-tty-ttyAMA0-hci0.device loaded active plugged >
sys-devices-platform-soc-fe201000.serial-tty-ttyAMA0.device loaded active plugged >
sys-devices-platform-soc-fe300000.mmcnr-mmc_host-mmc1-mmc1:0001-mmc1:0001:1-net-wlan0.device loaded active plugged >
sys-devices-virtual-misc-rfkill.device loaded active plugged >
sys-devices-virtual-tty-ttya0.device loaded active plugged >
sys-devices-virtual-tty-ttya1.device loaded active plugged >
sys-devices-virtual-tty-ttya2.device loaded active plugged >
sys-devices-virtual-tty-ttya3.device loaded active plugged >
sys-devices-virtual-tty-ttya4.device loaded active plugged >
sys-devices-virtual-tty-ttya5.device loaded active plugged >
sys-devices-virtual-tty-ttya6.device loaded active plugged >
sys-devices-virtual-tty-ttya7.device loaded active plugged >
sys-devices-virtual-tty-ttya8.device loaded active plugged >
sys-devices-virtual-tty-ttya9.device loaded active plugged >
sys-devices-virtual-tty-ttyaa.device loaded active plugged >
sys-devices-virtual-tty-ttyab.device loaded active plugged >
sys-devices-virtual-tty-ttyac.device loaded active plugged >
sys-devices-virtual-tty-ttyad.device loaded active plugged >
sys-devices-virtual-tty-ttyae.device loaded active plugged >
sys-devices-virtual-tty-ttyaf.device loaded active plugged >
sys-devices-virtual-tty-ttyb0.device loaded active plugged >
journalctl --no-pager -u snap.scummvm.daemon.service output (seems to be nothing):
pi@pi-desktop:~$ journalctl --no-pager -u snap.scummvm.daemon.service
– Logs begin at Thu 2020-09-24 12:27:11 MST, end at Sat 2020-12-05 11:47:53 MST. –
– No entries –
journalctl -xe:
pi@pi-desktop:~$ journalctl -xe
░░
░░ The job identifier is 502.
Dec 05 11:43:58 pi-desktop systemd[1]: tmp-snap.rootfs_lY2dsC.mount: Succeeded.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit tmp-snap.rootfs_lY2dsC.mount has successfully entered the ‘dead’ state.
Dec 05 11:43:58 pi-desktop audit[45155]: AVC apparmor=“DENIED” operation=“capable” profile=“/usr/lib/snapd/snap-confine” pid=45155 comm=“snap-confine” capability=>
Dec 05 11:43:58 pi-desktop kernel: audit: type=1400 audit(1607193838.375:72): apparmor=“DENIED” operation=“capable” profile=“/usr/lib/snapd/snap-confine” pid=4515>
Dec 05 11:43:58 pi-desktop systemd[40203]: tmp-snap.rootfs_lY2dsC.mount: Succeeded.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit UNIT has successfully entered the ‘dead’ state.
Dec 05 11:44:29 pi-desktop tracker-store[45168]: OK
Dec 05 11:44:29 pi-desktop systemd[40203]: tracker-store.service: Succeeded.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit UNIT has successfully entered the ‘dead’ state.
Dec 05 11:46:14 pi-desktop sudo[45200]: pi : TTY=pts/1 ; PWD=/home/pi ; USER=root ; COMMAND=/usr/bin/snap install scummvm
Dec 05 11:46:14 pi-desktop sudo[45200]: pam_unix(sudo:session): session opened for user root by pi(uid=0)
Dec 05 11:46:14 pi-desktop snapd[44502]: api.go:1007: Installing snap “scummvm” revision unset
Dec 05 11:46:53 pi-desktop snapd[44502]: taskrunner.go:271: [change 4 “Download snap "gnome-3-28-1804" (147) from channel "stable"” task] failed: context canc>
Dec 05 11:46:53 pi-desktop snapd[44502]: taskrunner.go:271: [change 4 “Download snap "scummvm" (4461) from channel "stable"” task] failed: context canceled
Dec 05 11:46:53 pi-desktop sudo[45200]: pam_unix(sudo:session): session closed for user root
Dec 05 11:47:53 pi-desktop PackageKit[43814]: daemon quit
Dec 05 11:47:53 pi-desktop systemd[1]: packagekit.service: Succeeded.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit packagekit.service has successfully entered the ‘dead’ state.
I didn’t update it today, the new builds in the edge channel are due to Snapcrafts autobuild feature.
Could you please check if snap install scummvm --edge changes something?
I don’t really have an idea why it’s failing at the moment, but I can only test on AMD64 right now and not on any ARM based devices - maybe some weird things are going on on the snapd side of things.
However, I’m a bit worried because of the AppArmor denials and
Dec 05 11:46:53 pi-desktop snapd[44502]: taskrunner.go:271: [change 4 “Download snap “gnome-3-28-1804” (147) from channel “stable”” task] failed: context canc>
Dec 05 11:46:53 pi-desktop snapd[44502]: taskrunner.go:271: [change 4 “Download snap “scummvm” (4461) from channel “stable”” task] failed: context canceled
which at least from my point of view indicates a deeper issue with snapd.
pi@raspberrypi:~ $ sudo snap install scummvm --edge
error: cannot perform the following tasks:
restart of [scummvm.daemon] (# systemctl restart snap.scummvm.daemon.service
Job for snap.scummvm.daemon.service failed.
See “systemctl status snap.scummvm.daemon.service” and “journalctl -xe” for deta ils.
)
What I don’t get is why RPiOS is trying to start the snap in the daemonized mode, this should only happen on Ubuntu Core so get some sort of “Kiosk” experience.
is there a flag I can set to fix this issue? is it perhaps because I installed the kiosk? I had to switch back to a previous iteration of my RpiOS, if there is something I need to make sure isn’t there I can try to uninstall it…
Please ignore the kiosk stuff for know, it’s not unlikely I’m mixing things up here. Another way to rule out would be to start from scratch with a fresh RPiOS installation to check if it’s something specific to your installation - then we know if we need to look after potential issues with your installation or if we have to deal with a general problem here.
I can go back to a vanilla RPiOS build and give it a try. The only things I am doing on this build are, enabling composite video output from the boot variables, turning on ssh, and updating everything. I haven’t really had time to muck with anything else at all, lol. But for sake of certainty, I will make a clean install with no flags and try installing snap / scummvm. Thanks for your help, I’m happy to fight through troubleshooting to help find the bug and to get ScummVM vis Snap working on RPiOS
Once again, a completely fresh install of RpiOS.
I allowed the gui to connect to my wifi, and to run all the updates. Restarted. Then installed snapd. Then restarted. Then installed hello-world, then:
pi@raspberrypi:~ $ hello-world
ERROR: ld.so: object ‘/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so’ from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
Hello World!
Trying ScummVm:
pi@raspberrypi:~ $ sudo snap install scummvm --edge
error: cannot perform the following tasks:
restart of [scummvm.daemon] (# systemctl restart snap.scummvm.daemon.service
Job for snap.scummvm.daemon.service failed.
See “systemctl status snap.scummvm.daemon.service” and “journalctl -xe” for details.
)
restart of [scummvm.daemon] (exit status 1)
Still getting some errors. Drat. But I can confirm on a 100% clean install and updated RaspberryPi OS install, no changes to any settings aside from region and wifi. Hopefully this is useful. Let me know if you need any other log files.
@OldKid thanks a lot for testing this, so it really seems like an issue specific with this snap, most likely due its built-in “kiosk mode” abilities.
I’ll try to get my hands on a Pi4/Pi400 (hey, now I have a valid excuse to get one!) ASAP, so I can investigate this further and finally test the stuff I do.
The way the daemon option works is that when the daemon first starts it first checks the daemon configuration option. If daemon=false then it stops the daemon. It seems as though things are failing before this can happen.
As you observe, daemon=false should be the default everywhere except Ubuntu Core. The check for Ubuntu Core could be getting it wrong, but that would be surprising. Here’s the check:
$ cat /snap/scummvm/current/snap/hooks/install
#!/bin/sh
set -x
if [ "$(snapctl get daemon)" = "" ]
then
# We run as a daemon on core, otherwise configure the daemon to stop
# (There's no "snapctl disable ...")
if grep -q snap_core= /proc/cmdline
then snapctl set daemon=true
else snapctl set daemon=false
fi
fi
As I don’t have RPiOS to hand, @OldKid could you post the results (on RPiOS) of:
snap get scummvm
and
cat /proc/cmdline
And, of course, you should be able to configure the daemon with:
using the grep code from the install hook works fine when using it from a test script so it looks a little like the install hook is not run at all here …
aaand … here we go:
Dez 07 11:54:01 raspberrypi scummvm.daemon[2935]: error: error running snapctl: snap "scummvm" has "install-snap" change in progress
i guess you want to move the install hook to be a configure hook (which runs a tad later but still before the daemon gets started, you might need to put a snapctl restart snap.scummvm.daemon at the end of the script though)