18

I'm playing around with CHEF in a CentOS7 VM, and the script failed due to the issue:

systemd[1]: start request repeated too quickly for fail2ban.service

I know this is configurable in systemd, but I'd just like to know, for testing purposes, if there is a way to "reset" systemd so I'm allowed to execute start fail2ban service without receiving this error forever. Right now I have to restart the OS so I'm able to execute it.

Thanks

qxlab
  • 283
  • 1
  • 2
  • 8

2 Answers2

36

If you really have some reason for restarting a service numerous times in a few seconds (or more likely, the service is misconfigured and failing to start) and are running into start limits, you can reset it by using systemctl reset-failed <unit>.

systemctl reset-failed fail2ban.service

Of course, you should fix whatever you did to the service configuration to cause it to fail to start properly.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
0

In my case the error message was somewhat misleading.

The reason for the failure was found in the definition file. It resulted from a copy between machines. The line

User=my_user 

in my service configuration file /etc/systemd/system/infinite_script.service was the culprit.

The new machine did not know of this user. Changing to User=root solved this problem.

kklepper
  • 109
  • 1