chiark / gitweb /
importd: create a loopback btrfs file system for /var/lib/machines, if necessary
[elogind.git] / src / timesync / timesyncd.c
index f7e089fc0c5eda841ef18e42375581d403cfcbbe..735668bedec960a64315676aa9df3f56248911e6 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "sd-event.h"
 #include "sd-daemon.h"
-#include "mkdir.h"
 #include "capability.h"
 #include "clock-util.h"
 #include "network-util.h"
@@ -113,6 +112,10 @@ int main(int argc, char *argv[]) {
         if (r < 0)
                 goto finish;
 
+        /* We need one process for ourselves, plus one thread for the asynchronous resolver */
+        if (setrlimit(RLIMIT_NPROC, &RLIMIT_MAKE_CONST(2)) < 0)
+                log_warning_errno(errno, "Failed to lower RLIMIT_NPROC to 2: %m");
+
         assert_se(sigprocmask_many(SIG_BLOCK, SIGTERM, SIGINT, -1) == 0);
 
         r = manager_new(&m);