samba: Make it work with Apparmor

smbd.service fails to start if the apparmor-profiles package is installed. User reported issue: https://discuss.freedombox.org/t/samba-not-starting-after-trixie-upgrade/4038.

Currently, Samba service doesn't allow Apparmor to write to /etc because of systemd hardening (ProtectSystem=full).

Also, Apparmor Samba profile generator (/usr/share/samba/update-apparmor-samba-profile) currently only parses /etc/samba/smb.conf but Freedombox uses /etc/samba/smb-freedombox.conf and registry shares instead.

Quick workaround to make smbd service not to fail is to disable smbd profile with aa-disable /usr/sbin/smbd if apparmor-profiles is installed.

Edited by Veiko Aasa