]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udevd: make sd_notify independent of forknig/notify mode
authorTom Gundersen <teg@jklm.no>
Tue, 2 Jun 2015 21:08:11 +0000 (23:08 +0200)
committerTom Gundersen <teg@jklm.no>
Wed, 3 Jun 2015 00:03:17 +0000 (02:03 +0200)
This will simply silently fail on non-systemd systems, so there is no reason
to make it conditional.

Also make it clear that we notify systemd about being ready as the last step
before starting the event loop, whereas the forking might need to happen
earlier.

src/udev/udevd.c

index a6cddf6e5a4bb4d6ec931c25c8f29044f57ffc29..5fee67d8df1e317f4ce24f553a09376eb42970ba 100644 (file)
@@ -1716,15 +1716,16 @@ int main(int argc, char *argv[]) {
                 setsid();
 
                 write_string_file("/proc/self/oom_score_adj", "-1000");
-        } else
-                sd_notify(false,
-                          "READY=1\n"
-                          "STATUS=Processing...");
+        }
 
         r = manager_listen(manager);
         if (r < 0)
                 return log_error_errno(r, "failed to set up fds and listen for events: %m");
 
+        (void) sd_notify(false,
+                         "READY=1\n"
+                         "STATUS=Processing...");
+
         r = sd_event_loop(manager->event);
         if (r < 0) {
                 log_error_errno(r, "event loop failed: %m");