certain services fail to start after removing snapd

Bug #1864125 reported by Justin Smalkowski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

Description: Ubuntu 16.04.6 LTS
Release: 16.04

snapd version: 2.40 from the xenial-updates repo

After running `apt-get remove snapd`, some services like apparmor and snappy-installed services fail to start up in systemd. apparmor fails because the /etc/apparmor.d/usr.lib.snapd.snap-confine.real profile, which does not get removed, tries to include /var/lib/snapd/apparmor/snap-confine, which does get removed. I expect to find no failed services after removing snap (assuming there weren't any to begin with).

As far as the snappy-installed services, looking at the snap.amazon-ssm-agent.amazon-ssm-agent.service unit, it calls `/usr/bin/snap run amazon-ssm-agent` in its ExecStart, which fails since /usr/bin/snap is gone.

Admittedly I'm not very familiar with packaging, but it seems to me like the ideal case would be to not leave any service failures lingering after uninstalling the package. For the former case, that would require removing the apparmor profile. For the latter, that means removing all snaps before removing the snap package. Are these reasonable goals? My instinct tells me if someone is removing snapd then they won't be using snaps at all.

I am aware that the apparmor issue can be resolved by running `apt-get purge snapd`, but I believe the remove command should still avoid leaving services broken, especially since abstracted package handlers like ansible's package module may not use the purge command.

Tags: packaging
Changed in snapd (Ubuntu):
importance: Undecided → Medium
Changed in snapd (Ubuntu):
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.