Comment 5 for bug 1605303

Revision history for this message
Adam Conrad (adconrad) wrote :

Following up on Andy's comment above (which may or may not have been cargo-cult from an IRC conversation we had), I think a sane approach would be:

1) Create unit files in /var/snap/systemd/foo.{mount,service}
2) Symlink /etc/systemd/system/foo -> /var/snap/systemd/foo

On postrm/purge, you can then do the same list-unit-files trick, but:

1) readlink /etc/systemd/system/foo
2) iff symlink points to /var/snap/systemd/*, remove.

That way, you're not claiming absolutely dominion over a namespace that other packages or the sysadmin may have other ideas about.