AppArmor: try converting to a systemd unit
This commit is contained in:
parent
a9e4eca8bf
commit
d7cc2415ea
@ -40,19 +40,26 @@ AppArmor.
|
|||||||
message = "AppArmor is enabled, but the kernel doesn't have AppArmor support"; }
|
message = "AppArmor is enabled, but the kernel doesn't have AppArmor support"; }
|
||||||
];
|
];
|
||||||
|
|
||||||
jobs.apparmor =
|
environment.systemPackages = [ pkgs.apparmor ];
|
||||||
{ startOn = "startup";
|
|
||||||
|
|
||||||
path = [ pkgs.apparmor ];
|
systemd.services.apparmor = {
|
||||||
|
#wantedBy = [ "basic.target" ];
|
||||||
|
wantedBy = [ "local-fs.target" ];
|
||||||
|
path = [ pkgs.apparmor ];
|
||||||
|
|
||||||
preStart = concatMapStrings (profile: ''
|
serviceConfig = {
|
||||||
apparmor_parser -Kv -I ${pkgs.apparmor}/etc/apparmor.d/ "${profile}"
|
Type = "oneshot";
|
||||||
|
RemainAfterExit = "yes";
|
||||||
|
ExecStart = concatMapStrings (profile: ''
|
||||||
|
${pkgs.apparmor}/sbin/apparmor_parser -rKv -I ${pkgs.apparmor}/etc/apparmor.d/ "${profile}"
|
||||||
|
'') cfg.profiles;
|
||||||
|
ExecStop = concatMapStrings (profile: ''
|
||||||
|
${pkgs.apparmor}/sbin/apparmor_parser -Rv "${profile}"
|
||||||
'') cfg.profiles;
|
'') cfg.profiles;
|
||||||
|
|
||||||
postStop = ''
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user