Now I have tried to apply confinement. As a sudo snapcraft cleanbuild takes very long time as it always pulls 100s of MB from the internet, I used the --classic and --jailmode options together with --dangerous on the sudo snap install <options> <snapfile> command.
With
sudo snap install --classic --dangerous cups_0.1.0_amd64.snap
I get
error: cannot perform the following tasks:
- Mount snap "cups" (unset) (snap "cups" requires devmode or confinement override)
How do I do this correctly? I also have tried to set “confinement: classic”, rebuild the package and do
sudo snap install --dangerous cups_0.1.0_amd64.snap
getting the same error.
sudo snap install --jailmode --dangerous cups_0.1.0_amd64.snap
Installs without errors, but CUPS does not start. /var/log/syslog contains the following then:
Nov 10 21:04:00 virt-devel systemd[1]: Reloading.
Nov 10 21:04:01 virt-devel systemd[1]: Mounting Mount unit for cups...
Nov 10 21:04:01 virt-devel systemd[1]: Mounted Mount unit for cups.
Nov 10 21:04:01 virt-devel systemd[1]: Stopping Service for snap application cups.cups-browsed...
Nov 10 21:04:01 virt-devel kernel: [39218.192077] audit: type=1107 audit(1510355041.149:2155): pid=752 uid=105 auid=4294967295 ses=4294967295 msg='apparmor="ALLOWED" operation="dbus_signal" bus="system" path="/com/redhat/PrinterSpooler" interface="com.redhat.PrinterSpooler" member="PrinterRemoved" mask="send" name="org.freedesktop.DBus" pid=7103 label="snap.cups.cupsd" peer_pid=2102 peer_label="unconfined"
Nov 10 21:04:01 virt-devel kernel: [39218.192077] exe="/usr/bin/dbus-daemon" sauid=105 hostname=? addr=? terminal=?'
Nov 10 21:04:01 virt-devel kernel: [39218.192332] audit: type=1107 audit(1510355041.149:2156): pid=752 uid=105 auid=4294967295 ses=4294967295 msg='apparmor="ALLOWED" operation="dbus_method_call" bus="system" path="/org/freedesktop/ColorManager" interface="org.freedesktop.ColorManager" member="FindDeviceById" mask="send" name="org.freedesktop.ColorManager" pid=7103 label="snap.cups.cupsd" peer_pid=926 peer_label="unconfined"
Nov 10 21:04:01 virt-devel kernel: [39218.192332] exe="/usr/bin/dbus-daemon" sauid=105 hostname=? addr=? terminal=?'
Nov 10 21:04:01 virt-devel kernel: [39218.192761] audit: type=1107 audit(1510355041.150:2157): pid=752 uid=105 auid=4294967295 ses=4294967295 msg='apparmor="ALLOWED" operation="dbus_signal" bus="system" path="/org/cups/cupsd/Notifier" interface="org.cups.cupsd.Notifier" member="PrinterDeleted" mask="send" name="org.freedesktop.DBus" pid=7134 label="snap.cups.cupsd" peer_pid=2102 peer_label="unconfined"
Nov 10 21:04:01 virt-devel kernel: [39218.192761] exe="/usr/bin/dbus-daemon" sauid=105 hostname=? addr=? terminal=?'
Nov 10 21:04:01 virt-devel kernel: [39218.192889] audit: type=1107 audit(1510355041.150:2158): pid=752 uid=105 auid=4294967295 ses=4294967295 msg='apparmor="ALLOWED" operation="dbus_signal" bus="system" path="/org/cups/cupsd/Notifier" interface="org.cups.cupsd.Notifier" member="PrinterDeleted" mask="send" name="org.freedesktop.DBus" pid=7134 label="snap.cups.cupsd" peer_pid=1885 peer_label="unconfined"
Nov 10 21:04:01 virt-devel kernel: [39218.192889] exe="/usr/bin/dbus-daemon" sauid=105 hostname=? addr=? terminal=?'
Nov 10 21:04:01 virt-devel kernel: [39218.193038] audit: type=1107 audit(1510355041.150:2159): pid=752 uid=105 auid=4294967295 ses=4294967295 msg='apparmor="ALLOWED" operation="dbus_signal" bus="system" path="/org/cups/cupsd/Notifier" interface="org.cups.cupsd.Notifier" member="PrinterDeleted" mask="send" name="org.freedesktop.DBus" pid=7134 label="snap.cups.cupsd" peer_pid=2676 peer_label="/usr/sbin/cups-browsed"
Nov 10 21:04:01 virt-devel kernel: [39218.193038] exe="/usr/bin/dbus-daemon" sauid=105 hostname=? addr=? terminal=?'
Nov 10 21:04:01 virt-devel kernel: [39218.200235] audit: type=1107 audit(1510355041.157:2160): pid=752 uid=105 auid=4294967295 ses=4294967295 msg='apparmor="ALLOWED" operation="dbus_method_call" bus="system" path="/org/freedesktop/ColorManager" interface="org.freedesktop.ColorManager" member="DeleteDevice" mask="send" name="org.freedesktop.ColorManager" pid=7103 label="snap.cups.cupsd" peer_pid=926 peer_label="unconfined"
Nov 10 21:04:01 virt-devel kernel: [39218.200235] exe="/usr/bin/dbus-daemon" sauid=105 hostname=? addr=? terminal=?'
Nov 10 21:04:01 virt-devel kernel: [39218.212054] audit: type=1107 audit(1510355041.169:2161): pid=752 uid=105 auid=4294967295 ses=4294967295 msg='apparmor="ALLOWED" operation="dbus_signal" bus="system" path="/com/redhat/PrinterSpooler" interface="com.redhat.PrinterSpooler" member="QueueChanged" mask="send" name="org.freedesktop.DBus" pid=7103 label="snap.cups.cupsd" peer_pid=2102 peer_label="unconfined"
Nov 10 21:04:01 virt-devel kernel: [39218.212054] exe="/usr/bin/dbus-daemon" sauid=105 hostname=? addr=? terminal=?'
Nov 10 21:04:01 virt-devel kernel: [39218.212319] audit: type=1107 audit(1510355041.169:2162): pid=752 uid=105 auid=4294967295 ses=4294967295 msg='apparmor="ALLOWED" operation="dbus_signal" bus="system" path="/com/redhat/PrinterSpooler" interface="com.redhat.PrinterSpooler" member="PrinterRemoved" mask="send" name="org.freedesktop.DBus" pid=7103 label="snap.cups.cupsd" peer_pid=2102 peer_label="unconfined"
Nov 10 21:04:01 virt-devel kernel: [39218.212319] exe="/usr/bin/dbus-daemon" sauid=105 hostname=? addr=? terminal=?'
Nov 10 21:04:01 virt-devel kernel: [39218.212506] audit: type=1107 audit(1510355041.169:2163): pid=752 uid=105 auid=4294967295 ses=4294967295 msg='apparmor="ALLOWED" operation="dbus_method_call" bus="system" path="/org/freedesktop/ColorManager" interface="org.freedesktop.ColorManager" member="FindDeviceById" mask="send" name="org.freedesktop.ColorManager" pid=7103 label="snap.cups.cupsd" peer_pid=926 peer_label="unconfined"
Nov 10 21:04:01 virt-devel kernel: [39218.212506] exe="/usr/bin/dbus-daemon" sauid=105 hostname=? addr=? terminal=?'
Nov 10 21:04:01 virt-devel kernel: [39218.212831] audit: type=1107 audit(1510355041.170:2164): pid=752 uid=105 auid=4294967295 ses=4294967295 msg='apparmor="ALLOWED" operation="dbus_signal" bus="system" path="/org/cups/cupsd/Notifier" interface="org.cups.cupsd.Notifier" member="PrinterStopped" mask="send" name="org.freedesktop.DBus" pid=7134 label="snap.cups.cupsd" peer_pid=2102 peer_label="unconfined"
Nov 10 21:04:01 virt-devel kernel: [39218.212831] exe="/usr/bin/dbus-daemon" sauid=105 hostname=? addr=? terminal=?'
Nov 10 21:04:01 virt-devel systemd[1]: Stopped Service for snap application cups.cups-browsed.
Nov 10 21:04:01 virt-devel systemd[1]: Stopping Service for snap application cups.cupsd...
Nov 10 21:04:01 virt-devel systemd[1]: Stopped Service for snap application cups.cupsd.
Nov 10 21:04:01 virt-devel gsd-color[1922]: failed to connect to device: Failed to connect to missing device /org/freedesktop/ColorManager/devices/cups_snaptest
Nov 10 21:04:01 virt-devel systemd[1]: Reloading.
Nov 10 21:04:02 virt-devel snapd[724]: 2017/11/10 21:04:02.812552 cmd.go:133: exe doesn't have snap mount dir prefix: "/usr/lib/snapd/snapd" vs "/snap"
Nov 10 21:04:03 virt-devel systemd[1]: Reloading.
Nov 10 21:04:03 virt-devel systemd[1]: Started Service for snap application cups.cups-browsed.
Nov 10 21:04:03 virt-devel systemd[1]: Started Service for snap application cups.cupsd.
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: perl: warning: Setting locale failed.
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: perl: warning: Please check that your locale settings:
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LANGUAGE = (unset),
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_ALL = (unset),
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_TIME = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_MONETARY = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_ADDRESS = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_TELEPHONE = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_NAME = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_MEASUREMENT = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_IDENTIFICATION = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_NUMERIC = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_PAPER = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LANG = "C.UTF-8"
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: are supported and installed on your system.
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: perl: warning: Falling back to a fallback locale ("C.UTF-8").
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: perl: warning: Setting locale failed.
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: perl: warning: Please check that your locale settings:
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LANGUAGE = (unset),
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_ALL = (unset),
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_TIME = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_MONETARY = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_ADDRESS = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_TELEPHONE = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_NAME = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_MEASUREMENT = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_IDENTIFICATION = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_NUMERIC = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_PAPER = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LANG = "C.UTF-8"
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: are supported and installed on your system.
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: perl: warning: Falling back to a fallback locale ("C.UTF-8").
[...] (Several more times of "perl: warning: Setting locale failed.")
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: perl: warning: Setting locale failed.
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: perl: warning: Please check that your locale settings:
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LANGUAGE = (unset),
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_ALL = (unset),
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_TIME = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_MONETARY = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_ADDRESS = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_TELEPHONE = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_NAME = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_MEASUREMENT = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_IDENTIFICATION = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_NUMERIC = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LC_PAPER = "pt_BR.UTF-8",
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: #011LANG = "C.UTF-8"
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: are supported and installed on your system.
Nov 10 21:04:03 virt-devel cups.cupsd[7717]: perl: warning: Falling back to a fallback locale ("C.UTF-8").
Nov 10 21:04:04 virt-devel systemd[1]: Reloading.
Nov 10 21:04:04 virt-devel cups.cupsd[7717]: Bad system call (core dumped)
Nov 10 21:04:04 virt-devel systemd[1]: snap.cups.cupsd.service: Main process exited, code=exited, status=159/n/a
Nov 10 21:04:04 virt-devel systemd[1]: snap.cups.cupsd.service: Unit entered failed state.
Nov 10 21:04:04 virt-devel systemd[1]: snap.cups.cupsd.service: Failed with result 'exit-code'.
Nov 10 21:04:04 virt-devel systemd[1]: snap.cups.cupsd.service: Service hold-off time over, scheduling restart.
Nov 10 21:04:04 virt-devel systemd[1]: Stopped Service for snap application cups.cupsd.
Nov 10 21:04:04 virt-devel systemd[1]: Started Service for snap application cups.cupsd.
[...] (Several repetitions of the above)
What is going wrong here?