I’m trying to add an /etc/update-motd.d
script when my snap installs. The way I’ve been trying to achieve this is by declaring a system-files
plug:
plugs:
config-motd:
interface: system-files
read:
- /etc/update-motd.d/99-upgrade-required
write:
- /etc/update-motd.d/99-upgrade-required
and copying a file in the connect-plug-config-motd
hook. This seems to work, however there is a problem when it comes to removing the file. I’ve tried to do that in the remove
and disconnect-plug-config-motd
hooks, but the plug hook does not seem to get invoked and the remove
hook results in this syslog entry:
apparmor="DENIED" operation="unlink" profile="snap.canonical-livepatch.hook.remove" name="/etc/update-motd.d/99-livepatch-kernel-upgrade-required" pid=10875 comm="rm" requested_mask="d" denied_mask="d" fsuid=0 ouid=0
Is there a better way of going about this?