[oe-commits] [openembedded-core] branch master-next updated: systemd: backport patch to fix sysctl warning on boot

git at git.openembedded.org git at git.openembedded.org
Mon Jul 15 13:04:20 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

The following commit(s) were added to refs/heads/master-next by this push:
     new e94dedb  systemd: backport patch to fix sysctl warning on boot
e94dedb is described below

commit e94dedbdfaca68d9754cac18a9f4cd83e235ba9d
Author: Matthias Schiffer <matthias.schiffer at ew.tq-group.com>
AuthorDate: Wed Jul 10 14:13:53 2019 +0200

    systemd: backport patch to fix sysctl warning on boot
    
    Due to improved validation of sysctl settings in recent kernels (5.2+, but
    also stable kernels like 4.19.53), systemd will log an error message like
    
        systemd[1]: Failed to bump fs.file-max, ignoring: Invalid argument
    
    during boot. Backport the bugfix from the systemd master.
    
    Signed-off-by: Matthias Schiffer <matthias.schiffer at ew.tq-group.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 ....file-max-sysctl-to-LONG_MAX-rather-than-.patch | 39 ++++++++++++++++++++++
 meta/recipes-core/systemd/systemd_242.bb           |  1 +
 2 files changed, 40 insertions(+)

diff --git a/meta/recipes-core/systemd/systemd/0001-core-set-fs.file-max-sysctl-to-LONG_MAX-rather-than-.patch b/meta/recipes-core/systemd/systemd/0001-core-set-fs.file-max-sysctl-to-LONG_MAX-rather-than-.patch
new file mode 100644
index 0000000..ff64f58
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-core-set-fs.file-max-sysctl-to-LONG_MAX-rather-than-.patch
@@ -0,0 +1,39 @@
+From 6e2f78948403a4cce45b9e34311c9577c624f066 Mon Sep 17 00:00:00 2001
+From: Lennart Poettering <lennart at poettering.net>
+Date: Mon, 17 Jun 2019 10:51:25 +0200
+Subject: [PATCH] core: set fs.file-max sysctl to LONG_MAX rather than
+ ULONG_MAX
+
+Since kernel 5.2 the kernel thankfully returns proper errors when we
+write a value out of range to the sysctl. Which however breaks writing
+ULONG_MAX to request the maximum value. Hence let's write the new
+maximum value instead, LONG_MAX.
+
+/cc @brauner
+
+Fixes: #12803
+
+Upstream-Status: Backport
+
+Signed-off-by: Matthias Schiffer <matthias.schiffer at ew.tq-group.com>
+---
+ src/core/main.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/core/main.c b/src/core/main.c
+index b33ea1b5b5..e7f51815f0 100644
+--- a/src/core/main.c
++++ b/src/core/main.c
+@@ -1245,9 +1245,9 @@ static void bump_file_max_and_nr_open(void) {
+ #endif
+ 
+ #if BUMP_PROC_SYS_FS_FILE_MAX
+-        /* I so wanted to use STRINGIFY(ULONG_MAX) here, but alas we can't as glibc/gcc define that as
+-         * "(0x7fffffffffffffffL * 2UL + 1UL)". Seriously. 😢 */
+-        if (asprintf(&t, "%lu\n", ULONG_MAX) < 0) {
++        /* The maximum the kernel allows for this since 5.2 is LONG_MAX, use that. (Previously thing where
++         * different but the operation would fail silently.) */
++        if (asprintf(&t, "%li\n", LONG_MAX) < 0) {
+                 log_oom();
+                 return;
+         }
diff --git a/meta/recipes-core/systemd/systemd_242.bb b/meta/recipes-core/systemd/systemd_242.bb
index 29f64b9..ca083ad 100644
--- a/meta/recipes-core/systemd/systemd_242.bb
+++ b/meta/recipes-core/systemd/systemd_242.bb
@@ -25,6 +25,7 @@ SRC_URI += "file://touchscreen.rules \
            file://0006-network-remove-redunant-link-name-in-message.patch \
            file://99-default.preset \
            file://0001-resolved-Fix-incorrect-use-of-OpenSSL-BUF_MEM.patch \
+           file://0001-core-set-fs.file-max-sysctl-to-LONG_MAX-rather-than-.patch \
            "
 
 # patches needed by musl

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list