cron: make into systemd.service and make it depend on /etc/localtime
so that changes in timezone will trigger a restart of cron service.
This commit is contained in:
parent
5819f29875
commit
b48e41b8d7
@ -97,12 +97,10 @@ in
|
|||||||
|
|
||||||
environment.systemPackages = [ cronNixosPkg ];
|
environment.systemPackages = [ cronNixosPkg ];
|
||||||
|
|
||||||
jobs.cron =
|
systemd.services.cron =
|
||||||
{ description = "Cron Daemon";
|
{ description = "Cron Daemon";
|
||||||
|
|
||||||
startOn = "startup";
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
path = [ cronNixosPkg ];
|
|
||||||
|
|
||||||
preStart =
|
preStart =
|
||||||
''
|
''
|
||||||
@ -119,7 +117,8 @@ in
|
|||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
exec = "cron -n";
|
restartTriggers = [ config.environment.etc.localtime.source ];
|
||||||
|
serviceConfig.ExecStart = "${cronNixosPkg}/bin/cron -n";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user