3

I've installed and enabled snappy on my openSUSE Leap 15.1 system according to this documentation: https://snapcraft.io/docs/installing-snap-on-opensuse

When adding the repository, I used the one for my specific version: https://download.opensuse.org/repositories/system:/snappy/openSUSE_Leap_15.1/

However, after enabling the service, it keeps crashing with exit code 42 just a few seconds after I start it. The socket seems to be okay:

opensuse:~ # systemctl status snapd.socket
● snapd.socket - Socket activation for snappy daemon
   Loaded: loaded (/usr/lib/systemd/system/snapd.socket; disabled; vendor preset: disabled)
   Active: active (listening) since Tue 2019-12-31 15:22:47 CET; 1h 58min ago
   Listen: /run/snapd.socket (Stream)
           /run/snapd-snap.socket (Stream)

Dec 31 15:22:47 opensuse systemd[1]: Starting Socket activation for snappy daemon.
Dec 31 15:22:47 opensuse systemd[1]: Listening on Socket activation for snappy daemon.

When I manually start snapd.service it shows up okay right after starting it:

opensuse:~ # systemctl status snapd.service
● snapd.service - Snappy daemon
   Loaded: loaded (/usr/lib/systemd/system/snapd.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2019-12-31 17:23:34 CET; 999ms ago
 Main PID: 3014 (snapd)
    Tasks: 10 (limit: 4915)
   CGroup: /system.slice/snapd.service
           └─3014 /usr/lib/snapd/snapd

Dec 31 17:23:34 opensuse systemd[1]: Starting Snappy daemon...
Dec 31 17:23:34 opensuse snapd[3014]: AppArmor status: apparmor is enabled but some kernel features are missing: dbus
Dec 31 17:23:34 opensuse snapd[3014]: daemon.go:346: started snapd/2.42.4-lp151.1.1 (series 16; classic; devmode) opensuse-leap/15.1 (amd64) linux/4.12.14-lp151.28.36-defau.
Dec 31 17:23:34 opensuse snapd[3014]: daemon.go:439: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap)
Dec 31 17:23:34 opensuse systemd[1]: Started Snappy daemon.

But then, after a few seconds it fails:

opensuse:~ # systemctl status snapd.service
● snapd.service - Snappy daemon
   Loaded: loaded (/usr/lib/systemd/system/snapd.service; enabled; vendor preset: disabled)
   Active: inactive (dead) since Tue 2019-12-31 17:23:39 CET; 36s ago
  Process: 3014 ExecStart=/usr/lib/snapd/snapd (code=exited, status=42)
 Main PID: 3014 (code=exited, status=42)

Dec 31 17:23:34 opensuse systemd[1]: Starting Snappy daemon...
Dec 31 17:23:34 opensuse snapd[3014]: AppArmor status: apparmor is enabled but some kernel features are missing: dbus
Dec 31 17:23:34 opensuse snapd[3014]: daemon.go:346: started snapd/2.42.4-lp151.1.1 (series 16; classic; devmode) opensuse-leap/15.1 (amd64) linux/4.12.14-lp151.28.36-defau.
Dec 31 17:23:34 opensuse snapd[3014]: daemon.go:439: adjusting startup timeout by 30s (pessimistic estimate of 30s plus 5s per snap)
Dec 31 17:23:34 opensuse systemd[1]: Started Snappy daemon.
Dec 31 17:23:39 opensuse snapd[3014]: daemon.go:540: gracefully waiting for running hooks
Dec 31 17:23:39 opensuse snapd[3014]: daemon.go:542: done waiting for running hooks
Dec 31 17:23:39 opensuse snapd[3014]: daemon stop requested to wait for socket activation

Running /usr/lib/snapd/snapd directly gives me:

opensuse:~ # /usr/lib/snapd/snapd
AppArmor status: apparmor is enabled but some kernel features are missing: dbus
cannot run daemon: when trying to listen on /run/snapd.socket: socket "/run/snapd.socket" already in use

What do?

1

Never mind, found it (I think). Apparently the service only keeps running when there are any snaps installed. Since I hadn't installed any snaps yet, it terminated itself after starting. After installing the first snap, snapd kept running in the background.

In order to install, first you have to stop the daemon:

systemctl stop snapd.socket

and then do the actual install; otherwise, the error originally posted (cannot run daemon) will appear.

1
  • 1
    Are you sure that fixed it? I can't install anything if I stop snapd.socket: error: cannot communicate with server: Post http://localhost/v2/snaps/globalprotect: dial unix /run/snapd.socket: connect: connection refused .
    – ChrisR
    Jan 15 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.