The nagios in nixpkgs has systemd.services.nagios.serviceConfig.Restart="always";
which is cluttering the journalctl -u nagios
log and should be Restart="no"; instead!
MySQL fix
For MySQL this works:
systemd.services.mysql.serviceConfig = {
Restart = "always";
RestartSec="10s";
StartLimitInterval="1min";
};
Since the MySQL service does not list any of the 'Restart', 'RestartSec', or 'StartLimitInterval' I suppose.
Attempted nagios fix
Using the same mechanism for nagios as for MySQL before, I try:
systemd.services.nagios.serviceConfig.Restart = "no";
Gives me a:
error: The option `systemd.services.nagios.serviceConfigRestart' defined in `/etc/nixos/configuration.nix' does not exist.
(use ‘--show-trace’ to show detailed location information)
If I updated it to:
systemd.services.nagios.serviceConfig = lib.mkForce { Restart = "no"; };
The result is that the values in systemd.services.mysql.serviceConfig
are now only containing 'Restart' but lack the important 'ExecStart' and other service definitions:
journalctl -u nagios
nagios.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
Finally using this:
systemd.services.nagios.serviceConfig = config.systemd.services.nagios.serviceConfig // { Restart = "no"; };
Give me a:
nixos-rebuild switch
error: infinite recursion encountered, at /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/lib/attrsets.nix:199:44
(use ‘--show-trace’ to show detailed location information)
.
inserviceConfig.Restart
Some further explanation in case of it's of any use:
serviceConfig
serviceConfig
to be the value ofserviceConfig
, which is an infinite recursion!