[systemd-devel] [PATCH] systemd: Fail a service if it exceeds its start limit

Eelco Dolstra eelco.dolstra at logicblox.com
Mon Aug 6 12:30:47 PDT 2012


Previously, if a service configured to restart automatically exceeds
its start limit, it entered the "inactive/dead" state.  That seems
wrong to me, since there is nothing to indicate to the user that the
service has failed.  This patch causes it to enter the failed state
instead.
---
 src/core/service.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/core/service.c b/src/core/service.c
index 1c127bd..eafdbe5 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -2487,6 +2487,7 @@ static int service_start(Unit *u) {
         r = service_start_limit_test(s);
         if (r < 0) {
                 service_notify_sockets_dead(s, true);
+                service_set_state(s, SERVICE_FAILED);
                 return r;
         }
 
-- 
1.7.11.4



More information about the systemd-devel mailing list