2

I'm testing a new gitlab runner I've setup.

If a project just has a very short CI job (or one that fails very quickly, which is probably more realistic outside of testing the setup) systemd starts reporting that "[email protected]" failed, 999 being the uid of gitlab-runner. The job ran as it should, and if it make it slower (e.g. by adding a sleep to it), nothing fails.

Searching for the error leads me to believe it just systemd trying to do something everytime a new "session" starts for that user, and deciding it must be broken because it exits so soon multiple times in a very short period of time. How do I allow that, preferably just for this one user?

  • There is a `StartLimitBurst=5` by default, which restricts restarts to 5 in 10 seconds, but I don't think it applies to slice and scope Units. – meuh Aug 15 '19 at 15:14
  • I know there are options to configure how many restarts are acceptable for normal services, but this is not a normal service, and if possible I only want to edit it for this one user. – Henrik supports the community Aug 15 '19 at 15:21

1 Answers1

0

It turns out this is a more normal unit than I thought.

And by making a /etc/systemd/system/[email protected]/override.conf (actually override doesn't matter, it can be any (there might be some exceptions) string), containing:

[Service]
StartLimitBurst=20

and running sudo systemctl daemon-reload the problem disappeared. (I haven't thought much about the value 20, it is just a number that proved to work)

(If you don't need to automate it, it good way to make such a file is with sudo systemctl edit [email protected] - some documentation I found suggested that after making such a file, it is enough to restart the affected service, that's where it seems to be special, at least I haven't figured out how to.)