summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-10-15 00:15:12 +0200
committerGitHub <noreply@github.com>2018-10-15 00:15:12 +0200
commit6cc4d59b35fe7ab3136fbdf6ca41700431f0afa7 (patch)
tree450ec9bdf032381bfa08a5c559b512334eb90eed /src/core
parentman/systemd.nspawn: fix reference to --timezone argument (#10403) (diff)
parentcore: ensure it's not fatal if we cannot watch /etc/localtime (diff)
downloadsystemd-6cc4d59b35fe7ab3136fbdf6ca41700431f0afa7.tar.xz
systemd-6cc4d59b35fe7ab3136fbdf6ca41700431f0afa7.zip
Merge pull request #10392 from poettering/manager-no-inotify-fail
make sure /etc/localtime issues don't cause systemd to fail boot
Diffstat (limited to 'src/core')
-rw-r--r--src/core/manager.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index 002429f1ec..971faef90a 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -423,10 +423,14 @@ static int manager_setup_timezone_change(Manager *m) {
r = sd_event_add_inotify(m->event, &new_event, "/etc/localtime",
IN_ATTRIB|IN_MOVE_SELF|IN_CLOSE_WRITE|IN_DONT_FOLLOW, manager_dispatch_timezone_change, m);
- if (r == -ENOENT) /* If the file doesn't exist yet, subscribe to /etc instead, and wait until it is created
- * either by O_CREATE or by rename() */
+ if (r == -ENOENT) {
+ /* If the file doesn't exist yet, subscribe to /etc instead, and wait until it is created either by
+ * O_CREATE or by rename() */
+
+ log_debug_errno(r, "/etc/localtime doesn't exist yet, watching /etc instead.");
r = sd_event_add_inotify(m->event, &new_event, "/etc",
IN_CREATE|IN_MOVED_TO|IN_ONLYDIR, manager_dispatch_timezone_change, m);
+ }
if (r < 0)
return log_error_errno(r, "Failed to create timezone change event source: %m");
@@ -835,9 +839,7 @@ int manager_new(UnitFileScope scope, ManagerTestRunFlags test_run_flags, Manager
if (r < 0)
return r;
- r = manager_setup_timezone_change(m);
- if (r < 0)
- return r;
+ (void) manager_setup_timezone_change(m);
r = manager_setup_sigchld_event_source(m);
if (r < 0)