nixos/apparmor: allow reloading profiles without losing confinement

Define ExecReload, otherwise reload implies stop followed by start, which
leaves existing processes in unconfined state [1].

[1]: https://gitlab.com/apparmor/apparmor/wikis/AppArmorInSystemd
This commit is contained in:
Joachim Fasting 2019-04-28 15:12:37 +02:00
parent f824dad19a
commit aa24c4e95b
No known key found for this signature in database
GPG Key ID: 5C204DF675C90294

View File

@ -48,6 +48,9 @@ in
ExecStop = map (p:
''${pkgs.apparmor-parser}/bin/apparmor_parser -Rv "${p}"''
) cfg.profiles;
ExecReload = map (p:
''${pkgs.apparmor-parser}/bin/apparmor_parser --reload ${paths} "${p}"''
) cfg.profiles;
};
};
};