This blind assumption that all units starting with snap[-.] are ours to do with as we see fit seems suspect. snapd does not own the snap prefix exclusively. We could imagine a package with a snap-shotting-service.service which would now get randomly stopped when snapd is removed:
As we are making these dynamically can we not record them or tag them internally so we are sure they are ours? Or perhaps make them symlinks to somewhere else so we can positively identify the ones which we made.
This blind assumption that all units starting with snap[-.] are ours to do with as we see fit seems suspect. snapd does not own the snap prefix exclusively. We could imagine a package with a snap-shotting- service. service which would now get randomly stopped when snapd is removed:
+ mounts="$(systemctl list-unit-files | grep '^snap[ -.].*\. mount' | cut -f1 -d ' ')" "$(systemctl list-unit-files | grep '^snap[ -.].*\. service' | cut -f1 -d ' ')"
+ services=
As we are making these dynamically can we not record them or tag them internally so we are sure they are ours? Or perhaps make them symlinks to somewhere else so we can positively identify the ones which we made.