jobs -> systemd.services
This commit is contained in:
@@ -67,24 +67,22 @@ in {
|
||||
|
||||
services.cron.systemCronJobs = [ "*/${toString cfg.updater.frequency} * * * * root start fprot-updater" ];
|
||||
|
||||
jobs = {
|
||||
fprot_updater = {
|
||||
name = "fprot-updater";
|
||||
task = true;
|
||||
|
||||
# have to copy fpupdate executable because it insists on storing the virus database in the same dir
|
||||
preStart = ''
|
||||
mkdir -m 0755 -p ${stateDir}
|
||||
chown ${fprotUser}:${fprotGroup} ${stateDir}
|
||||
cp ${pkgs.fprot}/opt/f-prot/fpupdate ${stateDir}
|
||||
ln -sf ${cfg.updater.productData} ${stateDir}/product.data
|
||||
'';
|
||||
#setuid = fprotUser;
|
||||
#setgid = fprotGroup;
|
||||
exec = "/var/lib/fprot/fpupdate --keyfile ${cfg.updater.licenseKeyfile}";
|
||||
systemd.services."fprot-updater" = {
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = false;
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
# have to copy fpupdate executable because it insists on storing the virus database in the same dir
|
||||
preStart = ''
|
||||
mkdir -m 0755 -p ${stateDir}
|
||||
chown ${fprotUser}:${fprotGroup} ${stateDir}
|
||||
cp ${pkgs.fprot}/opt/f-prot/fpupdate ${stateDir}
|
||||
ln -sf ${cfg.updater.productData} ${stateDir}/product.data
|
||||
'';
|
||||
|
||||
script = "/var/lib/fprot/fpupdate --keyfile ${cfg.updater.licenseKeyfile}";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user