nixos/usbguard: ensure the audit log file can be created

Since version 0.7.3, usbguard-daemon won't start if the file cannot be opened.
This commit is contained in:
Nadrieril 2018-08-30 21:50:43 +01:00
parent 08148a746a
commit 9b9ba8405b

View File

@ -188,7 +188,10 @@ in {
wants = [ "systemd-udevd.service" "local-fs.target" ];
# make sure an empty rule file and required directories exist
preStart = ''mkdir -p $(dirname "${cfg.ruleFile}") "${cfg.IPCAccessControlFiles}" && ([ -f "${cfg.ruleFile}" ] || touch ${cfg.ruleFile})'';
preStart = ''
mkdir -p $(dirname "${cfg.ruleFile}") $(dirname "${cfg.auditFilePath}") "${cfg.IPCAccessControlFiles}" \
&& ([ -f "${cfg.ruleFile}" ] || touch ${cfg.ruleFile})
'';
serviceConfig = {
Type = "simple";