summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-01-17 04:52:19 +0100
committerLennart Poettering <lennart@poettering.net>2013-01-17 04:54:34 +0100
commit464876c9c410b2f5bb997259510a13d0ee7d0af0 (patch)
tree8fe193976368709ad895088846d44f26ea3e3c64 /src
parentabd55b16547d0bb0ed1c31e72e16838f0f59f48b (diff)
service: properly signal permanent failure of a service to its socket
This makes sure that a service is not indefinitely restarted in a tight loop if it fails before it is able to process its socket. This corrects the breakage introduced with 8d1b002a2e389e79a2414491523de549783abf73. Shame on me.
Diffstat (limited to 'src')
-rw-r--r--src/core/service.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/service.c b/src/core/service.c
index ebd0baea89..9e46dbae94 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -1521,6 +1521,9 @@ static void service_set_state(Service *s, ServiceState state) {
s->control_command_id = _SERVICE_EXEC_COMMAND_INVALID;
}
+ if (state == SERVICE_FAILED)
+ service_notify_sockets_dead(s, s->result == SERVICE_FAILURE_START_LIMIT);
+
if (state == SERVICE_DEAD ||
state == SERVICE_STOP ||
state == SERVICE_STOP_SIGTERM ||
@@ -1528,7 +1531,6 @@ static void service_set_state(Service *s, ServiceState state) {
state == SERVICE_STOP_POST ||
state == SERVICE_FINAL_SIGTERM ||
state == SERVICE_FINAL_SIGKILL ||
- state == SERVICE_FAILED ||
state == SERVICE_AUTO_RESTART)
service_notify_sockets_dead(s, false);