Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snap.cups.cupsd.service fails to start on LXD containers #15

Open
mishac opened this issue Mar 25, 2023 · 0 comments
Open

snap.cups.cupsd.service fails to start on LXD containers #15

mishac opened this issue Mar 25, 2023 · 0 comments

Comments

@mishac
Copy link

mishac commented Mar 25, 2023

I have several LXD containers running Ubuntu 22.04 (on hosts running on 22.04 as well as well as one running 22.10) And all seem to have the same issue with the snap cups service failing to start. It seems like a permission issue on chowning /var/snap/cups/<number>/var/spool/tmp:

  [ubuntu:~] 6s 141 $ journalctl -u snap.cups.cupsd.service
  Feb 20 15:59:34 lxd-container systemd[1]: Started Service for snap application cups.cupsd.
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/872/var/spool/tmp
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/872/var/run/certs
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/872/var/log
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/872/var/cache/fontconfig
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/common/etc/cups/ppd
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/common/etc/cups/ssl
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/common/run
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -m 0755 -p /run/cups
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + export LC_ALL=C.UTF-8
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + export LANG=C.UTF-8
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + export TMPDIR=/var/snap/cups/872/tmp
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/872/tmp
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + CUPSTMPDIR=/var/snap/cups/872/var/spool/tmp
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + [ -d /var/snap/cups/872/tmp ]
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + chown -R root.root /var/snap/cups/872/tmp
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + chmod -R u+rwX /var/snap/cups/872/tmp
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + rm -rf /var/snap/cups/872/tmp
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + [ -d /var/snap/cups/872/tmp ]
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + [ -d /var/snap/cups/872/var/spool/tmp ]
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + chown -R root.root /var/snap/cups/872/var/spool/tmp
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + chmod -R u+rwX /var/snap/cups/872/var/spool/tmp
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + rm -rf /var/snap/cups/872/var/spool/tmp
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + [ -d /var/snap/cups/872/var/spool/tmp ]
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/872/tmp
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + chown -R root.root /var/snap/cups/872/tmp
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + chmod -R 1777 /var/snap/cups/872/tmp
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + mkdir -p /var/snap/cups/872/var/spool/tmp
  Feb 20 15:59:35 lxd-container cups.cupsd[5789]: + chown -R root.snap_daemon /var/snap/cups/872/var/spool/tmp
  Feb 20 15:59:35 lxd-container cups.cupsd[6386]: chown: changing ownership of '/var/snap/cups/872/var/spool/tmp': Invalid argument
  Feb 20 15:59:35 lxd-container systemd[1]: snap.cups.cupsd.service: Main process exited, code=exited, status=1/FAILURE
  Feb 20 15:59:35 lxd-container systemd[1]: snap.cups.cupsd.service: Failed with result 'exit-code'.### 

I have only run into this issue on LXD containers, not on the hosts themselves, which also run both the chromium and firefox snaps, which pull in cups, but where snap.cups.cupsd seems to load just fine.

Since it's a permissions thing I tried setting security.privileged and security.nesting on the LXD containers but it didn't fix the issue starting cupsd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant