nixos/{jira,crowd,confluence}: restart service on failure

In case of unexpected failures of the services - such as an OOM - it
shouldn't be necessary for an administrator to restart the service by
hand (which is usually sufficient). Instead, this should happen
automatically.

Also, I decided to increase the interval between restart attempts from
100ms[1] to 10s for a small grace period as suggested by several online
resources[2][3].

[1] See `systemd.service(5)`
[2] https://it.megocollector.com/linux/create-systemd-services-for-atlassian-apps/
[3] https://anteru.net/blog/2017/jira-confluence-with-systemd-on-centos/
This commit is contained in:
Maximilian Bosch 2022-05-10 22:02:04 +02:00 committed by Maximilian Bosch
parent 51770697cc
commit 6f9099fa62
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E
3 changed files with 6 additions and 0 deletions

View file

@ -189,6 +189,8 @@ in
User = cfg.user;
Group = cfg.group;
PrivateTmp = true;
Restart = "on-failure";
RestartSec = "10";
ExecStart = "${pkg}/bin/start-confluence.sh -fg";
ExecStop = "${pkg}/bin/stop-confluence.sh";
};

View file

@ -157,6 +157,8 @@ in
User = cfg.user;
Group = cfg.group;
PrivateTmp = true;
Restart = "on-failure";
RestartSec = "10";
ExecStart = "${pkg}/start_crowd.sh -fg";
};
};

View file

@ -197,6 +197,8 @@ in
User = cfg.user;
Group = cfg.group;
PrivateTmp = true;
Restart = "on-failure";
RestartSec = "10";
ExecStart = "${pkg}/bin/start-jira.sh -fg";
ExecStop = "${pkg}/bin/stop-jira.sh";
};