[systemd-commits] fixme src/service.c src/service.h
Lennart Poettering
lennart at kemper.freedesktop.org
Mon Aug 9 14:54:24 PDT 2010
fixme | 2 --
src/service.c | 8 +++++---
src/service.h | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
New commits:
commit 47342320a097523d93040cdd627e237a420572c5
Author: Lennart Poettering <lennart at poettering.net>
Date: Mon Aug 9 23:33:48 2010 +0200
main: fix auto restarting of units after a configuration reload
diff --git a/fixme b/fixme
index 373d100..186d3c7 100644
--- a/fixme
+++ b/fixme
@@ -82,8 +82,6 @@
* don't show file not found msgs for irrelevant units
-* getty doesn't respawn
-
External:
* sysv functions should color when stdout is tty, not stdin
diff --git a/src/service.c b/src/service.c
index d6086ca..318d8a7 100644
--- a/src/service.c
+++ b/src/service.c
@@ -1500,7 +1500,7 @@ static void service_enter_dead(Service *s, bool success, bool allow_restart) {
s->failure = true;
if (allow_restart &&
- s->allow_restart &&
+ !s->forbid_restart &&
(s->restart == SERVICE_RESTART_ALWAYS ||
(s->restart == SERVICE_RESTART_ON_SUCCESS && !s->failure))) {
@@ -1511,6 +1511,8 @@ static void service_enter_dead(Service *s, bool success, bool allow_restart) {
} else
service_set_state(s, s->failure ? SERVICE_MAINTENANCE : SERVICE_DEAD);
+ s->forbid_restart = false;
+
return;
fail:
@@ -1932,7 +1934,7 @@ static int service_start(Unit *u) {
s->failure = false;
s->main_pid_known = false;
- s->allow_restart = true;
+ s->forbid_restart = false;
service_enter_start_pre(s);
return 0;
@@ -1945,7 +1947,7 @@ static int service_stop(Unit *u) {
/* This is a user request, so don't do restarts on this
* shutdown. */
- s->allow_restart = false;
+ s->forbid_restart = true;
/* Already on it */
if (s->state == SERVICE_STOP ||
diff --git a/src/service.h b/src/service.h
index 3e18d22..725e213 100644
--- a/src/service.h
+++ b/src/service.h
@@ -115,7 +115,7 @@ struct Service {
bool failure:1;
bool main_pid_known:1;
bool bus_name_good:1;
- bool allow_restart:1;
+ bool forbid_restart:1;
bool got_socket_fd:1;
bool sysv_has_lsb:1;
bool sysv_enabled:1;
More information about the systemd-commits
mailing list