]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
automount: make sure the expire event is restarted after a daemon-reload (#4265)
authorMichael Olbrich <m.olbrich@pengutronix.de>
Tue, 4 Oct 2016 14:13:27 +0000 (16:13 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 4 Oct 2016 14:13:27 +0000 (16:13 +0200)
If the corresponding mount unit is deserialized after the automount unit
then the expire event is set up in automount_trigger_notify(). However, if
the mount unit is deserialized first then the automount unit is still in
state AUTOMOUNT_DEAD and automount_trigger_notify() aborts without setting
up the expire event.
Explicitly call automount_start_expire() during coldplug to make sure that
the expire event is set up as necessary.

Fixes #4249.

src/core/automount.c

index 00295cf7691f21cfae43483376feda18778a66f6..bdc0e06965244bfd5e178e7d6e8b1cf3e45adb05 100644 (file)
@@ -271,6 +271,11 @@ static int automount_coldplug(Unit *u) {
                                 return r;
 
                         (void) sd_event_source_set_description(a->pipe_event_source, "automount-io");
+                        if (a->deserialized_state == AUTOMOUNT_RUNNING) {
+                                r = automount_start_expire(a);
+                                if (r < 0)
+                                        log_unit_warning_errno(UNIT(a), r, "Failed to start expiration timer, ignoring: %m");
+                        }
                 }
 
                 automount_set_state(a, a->deserialized_state);