summaryrefslogtreecommitdiff
path: root/src/mount.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-01-20 13:17:22 +0100
committerLennart Poettering <lennart@poettering.net>2011-01-20 13:17:22 +0100
commite2f3b44cfc8864bfea7c77ff4c383ce9b535f27e (patch)
tree81dc25605f9493c5f32b596556a3736f55fb9bb0 /src/mount.c
parentf8d0ceb46b8c617abce8eaf99812ca7f4ce1c658 (diff)
service: when reloading a service fails don't fail the entire service but just the reload job
Diffstat (limited to 'src/mount.c')
-rw-r--r--src/mount.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/mount.c b/src/mount.c
index 5b433c970a..08e99141b1 100644
--- a/src/mount.c
+++ b/src/mount.c
@@ -554,7 +554,8 @@ static void mount_set_state(Mount *m, MountState state) {
mount_state_to_string(old_state),
mount_state_to_string(state));
- unit_notify(UNIT(m), state_translation_table[old_state], state_translation_table[state]);
+ unit_notify(UNIT(m), state_translation_table[old_state], state_translation_table[state], !m->reload_failure);
+ m->reload_failure = false;
}
static int mount_coldplug(Unit *u) {
@@ -910,7 +911,8 @@ static void mount_enter_remounting(Mount *m, bool success) {
fail:
log_warning("%s failed to run 'remount' task: %s", m->meta.id, strerror(-r));
- mount_enter_mounted(m, false);
+ m->reload_failure = true;
+ mount_enter_mounted(m, true);
}
static int mount_start(Unit *u) {
@@ -1098,9 +1100,6 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) {
case MOUNT_MOUNTING_DONE:
case MOUNT_MOUNTING_SIGKILL:
case MOUNT_MOUNTING_SIGTERM:
- case MOUNT_REMOUNTING:
- case MOUNT_REMOUNTING_SIGKILL:
- case MOUNT_REMOUNTING_SIGTERM:
if (success)
mount_enter_mounted(m, true);
@@ -1110,6 +1109,18 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) {
mount_enter_dead(m, false);
break;
+ case MOUNT_REMOUNTING:
+ case MOUNT_REMOUNTING_SIGKILL:
+ case MOUNT_REMOUNTING_SIGTERM:
+
+ m->reload_failure = !success;
+ if (m->from_proc_self_mountinfo)
+ mount_enter_mounted(m, true);
+ else
+ mount_enter_dead(m, true);
+
+ break;
+
case MOUNT_UNMOUNTING:
case MOUNT_UNMOUNTING_SIGKILL:
case MOUNT_UNMOUNTING_SIGTERM:
@@ -1147,7 +1158,8 @@ static void mount_timer_event(Unit *u, uint64_t elapsed, Watch *w) {
case MOUNT_REMOUNTING:
log_warning("%s remounting timed out. Stopping.", u->meta.id);
- mount_enter_signal(m, MOUNT_REMOUNTING_SIGTERM, false);
+ m->reload_failure = true;
+ mount_enter_mounted(m, true);
break;
case MOUNT_UNMOUNTING: