chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
util: when replacing env vars replace unset envvars by nothing
[elogind.git]
/
src
/
service.c
diff --git
a/src/service.c
b/src/service.c
index d6086ca410488a85661e67b1450f3ad1deae01c5..318d8a7dc4e558e2a43dcb68eb744994bac08ede 100644
(file)
--- 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->failure = true;
if (allow_restart &&
-
s->allow
_restart &&
+
!s->forbid
_restart &&
(s->restart == SERVICE_RESTART_ALWAYS ||
(s->restart == SERVICE_RESTART_ON_SUCCESS && !s->failure))) {
(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);
} else
service_set_state(s, s->failure ? SERVICE_MAINTENANCE : SERVICE_DEAD);
+ s->forbid_restart = false;
+
return;
fail:
return;
fail:
@@
-1932,7
+1934,7
@@
static int service_start(Unit *u) {
s->failure = false;
s->main_pid_known = false;
s->failure = false;
s->main_pid_known = false;
- s->
allow_restart = tru
e;
+ s->
forbid_restart = fals
e;
service_enter_start_pre(s);
return 0;
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. */
/* This is a user request, so don't do restarts on this
* shutdown. */
- s->
allow_restart = fals
e;
+ s->
forbid_restart = tru
e;
/* Already on it */
if (s->state == SERVICE_STOP ||
/* Already on it */
if (s->state == SERVICE_STOP ||