Backport a bunch of patches
Existing patches moved to the systemd-stable tarball, with the exception of 0991-core-fix-resetting-of-Delegate-and-properly-ignore-i.patch, which was partially reverted upstream and is just removed.
This commit is contained in:
parent
6a5d5d666c
commit
b59ff1a2fc
@ -1,33 +0,0 @@
|
|||||||
From 62e20ce3dc0210e331147b717ea36b17a3d555f2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
||||||
Date: Tue, 6 Mar 2018 00:01:36 +0100
|
|
||||||
Subject: [PATCH] test-cgroup-util: bail out when running under mock
|
|
||||||
|
|
||||||
The builds were failing in Fedora koji, where something strange is mounted
|
|
||||||
on /sys/fs/cgroup.
|
|
||||||
---
|
|
||||||
src/test/test-cgroup-util.c | 10 ++++++++--
|
|
||||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/test/test-cgroup-util.c b/src/test/test-cgroup-util.c
|
|
||||||
index c4163fc3a9..9ef7c97c74 100644
|
|
||||||
--- a/src/test/test-cgroup-util.c
|
|
||||||
+++ b/src/test/test-cgroup-util.c
|
|
||||||
@@ -408,9 +408,15 @@ static void test_cg_tests(void) {
|
|
||||||
static void test_cg_get_keyed_attribute(void) {
|
|
||||||
_cleanup_free_ char *val = NULL;
|
|
||||||
char *vals3[3] = {}, *vals3a[3] = {};
|
|
||||||
- int i;
|
|
||||||
+ int i, r;
|
|
||||||
|
|
||||||
- assert_se(cg_get_keyed_attribute("cpu", "/init.scope", "no_such_file", STRV_MAKE("no_such_attr"), &val) == -ENOENT);
|
|
||||||
+ r = cg_get_keyed_attribute("cpu", "/init.scope", "no_such_file", STRV_MAKE("no_such_attr"), &val);
|
|
||||||
+ if (r == -ENOMEDIUM) {
|
|
||||||
+ log_info_errno(r, "Skipping most of %s, /sys/fs/cgroup not accessible: %m", __func__);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ assert_se(r == -ENOENT);
|
|
||||||
assert_se(val == NULL);
|
|
||||||
|
|
||||||
if (access("/sys/fs/cgroup/init.scope/cpu.stat", R_OK) < 0) {
|
|
@ -1,97 +0,0 @@
|
|||||||
From 83492cce79c0cda1ea634abe4ad6519aa69e2fdc Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
||||||
Date: Wed, 7 Mar 2018 23:36:44 +0100
|
|
||||||
Subject: [PATCH] basic/fs-util: skip fsync_directory_of_file() if
|
|
||||||
/proc/self/fd/ is not available
|
|
||||||
|
|
||||||
When systemd is running under lorax (in Fedora compose process), it'd think that
|
|
||||||
it failed to write /etc/machine-id, even though the write succeeded, because
|
|
||||||
fsync_directory_of_file() would fail, because /proc/self/fd/ is not available.
|
|
||||||
fsync_directory_of_file() is mostly an additional safety net, so I think it's best
|
|
||||||
to just silently ignore the error.
|
|
||||||
|
|
||||||
Strace of pid1:
|
|
||||||
35791 stat("/etc", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
|
|
||||||
35791 openat(AT_FDCWD, "/etc/machine-id", O_RDWR|O_CREAT|O_NOCTTY|O_CLOEXEC, 0444) = 3
|
|
||||||
35791 umask(022) = 000
|
|
||||||
35791 read(3, "", 38) = 0
|
|
||||||
35791 openat(AT_FDCWD, "/var/lib/dbus/machine-id", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = -1 ENOENT (No such file o
|
|
||||||
r directory)
|
|
||||||
35791 openat(AT_FDCWD, "/sys/class/dmi/id/product_name", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
|
|
||||||
35791 openat(AT_FDCWD, "/sys/class/dmi/id/sys_vendor", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
|
|
||||||
35791 openat(AT_FDCWD, "/sys/class/dmi/id/board_vendor", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
|
|
||||||
35791 openat(AT_FDCWD, "/sys/class/dmi/id/bios_vendor", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
|
|
||||||
35791 access("/proc/xen", F_OK) = -1 ENOENT (No such file or directory)
|
|
||||||
35791 openat(AT_FDCWD, "/sys/hypervisor/type", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
|
|
||||||
35791 openat(AT_FDCWD, "/proc/cpuinfo", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
|
|
||||||
35791 getrandom("\xb8\x82\xed\xd4\x35\x11\xd0\xeb\xa6\x79\xd7\x31\x6e\x7b\x99\xce", 16, GRND_NONBLOCK) = 16
|
|
||||||
35791 writev(2, [{iov_base="Initializing machine ID from random generator.", iov_len=46}, {iov_base="\n", iov_len=1}],
|
|
||||||
2) = 47
|
|
||||||
35791 lseek(3, 0, SEEK_SET) = 0
|
|
||||||
35791 ftruncate(3, 0) = 0
|
|
||||||
35791 write(3, "b882edd4351140eba679d7316e7b99ce\n", 33) = 33
|
|
||||||
35791 fsync(3) = 0
|
|
||||||
35791 fstat(3, {st_mode=S_IFREG|0444, st_size=33, ...}) = 0
|
|
||||||
35791 readlinkat(AT_FDCWD, "/proc/self/fd/3", 0x564df8c694c0, 99) = -1 ENOENT (No such file or directory)
|
|
||||||
35791 close(3) = 0
|
|
||||||
35791 umask(022) = 022
|
|
||||||
35791 openat(AT_FDCWD, "/run/machine-id", O_WRONLY|O_CREAT|O_NOCTTY|O_TRUNC|O_CLOEXEC, 0444) = 3
|
|
||||||
35791 write(3, "b882edd4351140eba679d7316e7b99ce\n", 33) = 33
|
|
||||||
35791 close(3) = 0
|
|
||||||
35791 umask(022) = 022
|
|
||||||
35791 mount("/run/machine-id", "/etc/machine-id", NULL, MS_BIND, NULL) = 0
|
|
||||||
35791 writev(2, [{iov_base="Installed transient /etc/machine-id file.", iov_len=41}, {iov_base="\n", iov_len=1}], 2) = 42
|
|
||||||
35791 mount(NULL, "/etc/machine-id", NULL, MS_RDONLY|MS_REMOUNT|MS_BIND, NULL) = 0
|
|
||||||
|
|
||||||
https://bugzilla.redhat.com/show_bug.cgi?id=1552843
|
|
||||||
---
|
|
||||||
src/basic/fd-util.c | 15 +++++++++++----
|
|
||||||
src/basic/fs-util.c | 5 +++++
|
|
||||||
2 files changed, 16 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/basic/fd-util.c b/src/basic/fd-util.c
|
|
||||||
index 678ab12bb8..bb74f6c58e 100644
|
|
||||||
--- a/src/basic/fd-util.c
|
|
||||||
+++ b/src/basic/fd-util.c
|
|
||||||
@@ -361,14 +361,21 @@ bool fdname_is_valid(const char *s) {
|
|
||||||
}
|
|
||||||
|
|
||||||
int fd_get_path(int fd, char **ret) {
|
|
||||||
- char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int)];
|
|
||||||
+ _cleanup_close_ int dir = -1;
|
|
||||||
+ char fdname[DECIMAL_STR_MAX(int)];
|
|
||||||
int r;
|
|
||||||
|
|
||||||
- xsprintf(procfs_path, "/proc/self/fd/%i", fd);
|
|
||||||
+ dir = open("/proc/self/fd/", O_CLOEXEC | O_DIRECTORY | O_PATH);
|
|
||||||
+ if (dir < 0)
|
|
||||||
+ /* /proc is not available or not setup up properly, we're most likely
|
|
||||||
+ * in some chroot environment. */
|
|
||||||
+ return -EOPNOTSUPP;
|
|
||||||
|
|
||||||
- r = readlink_malloc(procfs_path, ret);
|
|
||||||
+ xsprintf(fdname, "%i", fd);
|
|
||||||
|
|
||||||
- if (r == -ENOENT) /* If the file doesn't exist the fd is invalid */
|
|
||||||
+ r = readlinkat_malloc(dir, fdname, ret);
|
|
||||||
+ if (r == -ENOENT)
|
|
||||||
+ /* If the file doesn't exist the fd is invalid */
|
|
||||||
return -EBADF;
|
|
||||||
|
|
||||||
return r;
|
|
||||||
diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c
|
|
||||||
index 85c8070a1b..8d8d986082 100644
|
|
||||||
--- a/src/basic/fs-util.c
|
|
||||||
+++ b/src/basic/fs-util.c
|
|
||||||
@@ -978,6 +978,11 @@ int fsync_directory_of_file(int fd) {
|
|
||||||
return r;
|
|
||||||
|
|
||||||
r = fd_get_path(fd, &path);
|
|
||||||
+ if (r == -EOPNOTSUPP)
|
|
||||||
+ /* If /proc is not available, we're most likely running in some
|
|
||||||
+ * chroot environment, and syncing the directory is not very
|
|
||||||
+ * important in that case. Let's just silently do nothing. */
|
|
||||||
+ return 0;
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
|||||||
From e63ebf71edd7947f29389c72e851d8df5c7bedda Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
||||||
Date: Fri, 16 Mar 2018 23:01:05 +0100
|
|
||||||
Subject: [PATCH] core: when reloading, delay any actions on journal and dbus
|
|
||||||
connections
|
|
||||||
|
|
||||||
manager_recheck_journal() and manager_recheck_dbus() would be called to early
|
|
||||||
while we were deserialiazing units, before the systemd-journald.service and
|
|
||||||
dbus.service have been deserialized. In effect we'd disable logging to the
|
|
||||||
journald and close the bus connection. The first is not very noticable, it
|
|
||||||
mostly means that logs emitted during deserialization are lost. The second is
|
|
||||||
more noticeable, because manager_recheck_dbus() would call bus_done_api() and
|
|
||||||
bus_done_system() and close dbus connections. Logging and bus connection would
|
|
||||||
then be restored later after the respective units have been deserialized.
|
|
||||||
|
|
||||||
This is easily reproduced by calling:
|
|
||||||
$ sudo gdbus call --system --dest org.freedesktop.systemd1 --object-path /org/freedesktop/systemd1 --method "org.freedesktop.systemd1.Manager.Reload"
|
|
||||||
which works fine before 8559b3b75cb, and then starts failing with:
|
|
||||||
Error: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Remote peer disconnected
|
|
||||||
|
|
||||||
None of this should happen, and we should delay changing state until after
|
|
||||||
deserialization is complete when reloading. manager_reload() already included
|
|
||||||
the calls to manager_recheck_journal() and manager_recheck_dbus(), so the
|
|
||||||
connection state will be updated after deserialization during reloading is done.
|
|
||||||
|
|
||||||
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1554578.
|
|
||||||
---
|
|
||||||
src/core/unit.c | 7 +++++--
|
|
||||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/core/unit.c b/src/core/unit.c
|
|
||||||
index 815701ad4e..f88aabba61 100644
|
|
||||||
--- a/src/core/unit.c
|
|
||||||
+++ b/src/core/unit.c
|
|
||||||
@@ -2501,8 +2501,11 @@ void unit_notify(Unit *u, UnitActiveState os, UnitActiveState ns, bool reload_su
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- manager_recheck_journal(m);
|
|
||||||
- manager_recheck_dbus(m);
|
|
||||||
+ if (!MANAGER_IS_RELOADING(u->manager)) {
|
|
||||||
+ manager_recheck_journal(m);
|
|
||||||
+ manager_recheck_dbus(m);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
unit_trigger_notify(u);
|
|
||||||
|
|
||||||
if (!MANAGER_IS_RELOADING(u->manager)) {
|
|
@ -1,37 +0,0 @@
|
|||||||
From 8eebb6a9e5e74ec0ef40902e2da53d24559b94a4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Filipe Brandenburger <filbranden@google.com>
|
|
||||||
Date: Thu, 15 Mar 2018 10:42:38 -0700
|
|
||||||
Subject: [PATCH] udev/net-id: Fix check for address to keep interface names
|
|
||||||
stable (#8458)
|
|
||||||
|
|
||||||
This was a bug inadvertently added by commit 73fc96c8ac0aa9.
|
|
||||||
|
|
||||||
The intent of the check is to "match slot address with device by
|
|
||||||
stripping the function" (as the comment above states it), for example
|
|
||||||
match network device PCI address 0000:05:00.0 (including a .0 for
|
|
||||||
function) to PCI slot address 0000:05:00, but changing that to a streq()
|
|
||||||
call prevented the match.
|
|
||||||
|
|
||||||
Change that to startswith(), which should both fix the bug and make the
|
|
||||||
intent of the check more clear and prevent unintentional bugs from being
|
|
||||||
introduced by future refactorings.
|
|
||||||
---
|
|
||||||
src/udev/udev-builtin-net_id.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
|
|
||||||
index 36994360c7..6efa712930 100644
|
|
||||||
--- a/src/udev/udev-builtin-net_id.c
|
|
||||||
+++ b/src/udev/udev-builtin-net_id.c
|
|
||||||
@@ -297,7 +297,7 @@ static int dev_pci_slot(struct udev_device *dev, struct netnames *names) {
|
|
||||||
if (snprintf_ok(str, sizeof str, "%s/%s/address", slots, dent->d_name) &&
|
|
||||||
read_one_line_file(str, &address) >= 0)
|
|
||||||
/* match slot address with device by stripping the function */
|
|
||||||
- if (streq(address, udev_device_get_sysname(names->pcidev)))
|
|
||||||
+ if (startswith(udev_device_get_sysname(names->pcidev), address))
|
|
||||||
hotplug_slot = i;
|
|
||||||
|
|
||||||
if (hotplug_slot > 0)
|
|
||||||
--
|
|
||||||
2.16.2
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
|||||||
From 227b8a762fea1458547be2cdf0e6e4aac0079730 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Michael Olbrich <m.olbrich@pengutronix.de>
|
|
||||||
Date: Mon, 26 Mar 2018 17:34:53 +0200
|
|
||||||
Subject: [PATCH] core: don't include libmount.h in a header file (#8580)
|
|
||||||
|
|
||||||
linux/fs.h sys/mount.h, libmount.h and missing.h all include MS_*
|
|
||||||
definitions.
|
|
||||||
|
|
||||||
To avoid problems, only one of linux/fs.h, sys/mount.h and libmount.h
|
|
||||||
should be included. And missing.h must be included last.
|
|
||||||
|
|
||||||
Without this, building systemd may fail with:
|
|
||||||
|
|
||||||
In file included from [...]/libmount/libmount.h:31:0,
|
|
||||||
from ../systemd-238/src/core/manager.h:23,
|
|
||||||
from ../systemd-238/src/core/emergency-action.h:37,
|
|
||||||
from ../systemd-238/src/core/unit.h:34,
|
|
||||||
from ../systemd-238/src/core/dbus-timer.h:25,
|
|
||||||
from ../systemd-238/src/core/timer.c:26:
|
|
||||||
[...]/sys/mount.h:57:2: error: expected identifier before numeric constant
|
|
||||||
---
|
|
||||||
src/core/dbus-execute.c | 1 +
|
|
||||||
src/core/manager.h | 3 ++-
|
|
||||||
src/core/mount.c | 2 ++
|
|
||||||
3 files changed, 5 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
|
|
||||||
index 7344623ebf..c342093bca 100644
|
|
||||||
--- a/src/core/dbus-execute.c
|
|
||||||
+++ b/src/core/dbus-execute.c
|
|
||||||
@@ -18,6 +18,7 @@
|
|
||||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
***/
|
|
||||||
|
|
||||||
+#include <sys/mount.h>
|
|
||||||
#include <sys/prctl.h>
|
|
||||||
#include <stdio_ext.h>
|
|
||||||
|
|
||||||
diff --git a/src/core/manager.h b/src/core/manager.h
|
|
||||||
index 28c5da225b..e09e0cdf5e 100644
|
|
||||||
--- a/src/core/manager.h
|
|
||||||
+++ b/src/core/manager.h
|
|
||||||
@@ -20,7 +20,6 @@
|
|
||||||
along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
***/
|
|
||||||
|
|
||||||
-#include <libmount.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
@@ -34,6 +33,8 @@
|
|
||||||
#include "list.h"
|
|
||||||
#include "ratelimit.h"
|
|
||||||
|
|
||||||
+struct libmnt_monitor;
|
|
||||||
+
|
|
||||||
/* Enforce upper limit how many names we allow */
|
|
||||||
#define MANAGER_MAX_NAMES 131072 /* 128K */
|
|
||||||
|
|
||||||
diff --git a/src/core/mount.c b/src/core/mount.c
|
|
||||||
index 0e755da5c0..0154ebda5d 100644
|
|
||||||
--- a/src/core/mount.c
|
|
||||||
+++ b/src/core/mount.c
|
|
||||||
@@ -23,6 +23,8 @@
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <sys/epoll.h>
|
|
||||||
|
|
||||||
+#include <libmount.h>
|
|
||||||
+
|
|
||||||
#include "sd-messages.h"
|
|
||||||
|
|
||||||
#include "alloc-util.h"
|
|
@ -1,200 +0,0 @@
|
|||||||
From 49a5d09a402d23815275282a89526869fc1c39f5 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Franck Bui <fbui@suse.com>
|
|
||||||
Date: Thu, 15 Mar 2018 06:23:46 +0100
|
|
||||||
Subject: [PATCH] basic/macros: rename noreturn into _noreturn_ (#8456)
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
"noreturn" is reserved and can be used in other header files we include:
|
|
||||||
|
|
||||||
[ 16s] In file included from /usr/include/gcrypt.h:30:0,
|
|
||||||
[ 16s] from ../src/journal/journal-file.h:26,
|
|
||||||
[ 16s] from ../src/journal/journal-vacuum.c:31:
|
|
||||||
[ 16s] /usr/include/gpg-error.h:1544:46: error: expected ‘,’ or ‘;’ before ‘)’ token
|
|
||||||
[ 16s] void gpgrt_log_bug (const char *fmt, ...) GPGRT_ATTR_NR_PRINTF(1,2);
|
|
||||||
|
|
||||||
Here we include grcrypt.h (which in turns include gpg-error.h) *after* we
|
|
||||||
"noreturn" was defined in macro.h.
|
|
||||||
|
|
||||||
(cherry picked from commit 848e863acc51ecfb0f3955c498874588201d9130)
|
|
||||||
---
|
|
||||||
src/basic/log.c | 4 ++--
|
|
||||||
src/basic/log.h | 4 ++--
|
|
||||||
src/basic/macro.h | 19 +++++++++----------
|
|
||||||
src/basic/process-util.c | 2 +-
|
|
||||||
src/basic/process-util.h | 2 +-
|
|
||||||
src/core/main.c | 4 ++--
|
|
||||||
src/journal/test-journal-interleaving.c | 2 +-
|
|
||||||
src/shared/pager.c | 2 +-
|
|
||||||
src/udev/collect/collect.c | 2 +-
|
|
||||||
9 files changed, 20 insertions(+), 21 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/basic/log.c b/src/basic/log.c
|
|
||||||
index 7a7f2cbec1..16a2431c54 100644
|
|
||||||
--- a/src/basic/log.c
|
|
||||||
+++ b/src/basic/log.c
|
|
||||||
@@ -814,7 +814,7 @@ static void log_assert(
|
|
||||||
log_dispatch_internal(level, 0, file, line, func, NULL, NULL, NULL, NULL, buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
-noreturn void log_assert_failed_realm(
|
|
||||||
+_noreturn_ void log_assert_failed_realm(
|
|
||||||
LogRealm realm,
|
|
||||||
const char *text,
|
|
||||||
const char *file,
|
|
||||||
@@ -826,7 +826,7 @@ noreturn void log_assert_failed_realm(
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
|
|
||||||
-noreturn void log_assert_failed_unreachable_realm(
|
|
||||||
+_noreturn_ void log_assert_failed_unreachable_realm(
|
|
||||||
LogRealm realm,
|
|
||||||
const char *text,
|
|
||||||
const char *file,
|
|
||||||
diff --git a/src/basic/log.h b/src/basic/log.h
|
|
||||||
index efcf0f1bfc..314be128a2 100644
|
|
||||||
--- a/src/basic/log.h
|
|
||||||
+++ b/src/basic/log.h
|
|
||||||
@@ -186,7 +186,7 @@ int log_dump_internal(
|
|
||||||
char *buffer);
|
|
||||||
|
|
||||||
/* Logging for various assertions */
|
|
||||||
-noreturn void log_assert_failed_realm(
|
|
||||||
+_noreturn_ void log_assert_failed_realm(
|
|
||||||
LogRealm realm,
|
|
||||||
const char *text,
|
|
||||||
const char *file,
|
|
||||||
@@ -195,7 +195,7 @@ noreturn void log_assert_failed_realm(
|
|
||||||
#define log_assert_failed(text, ...) \
|
|
||||||
log_assert_failed_realm(LOG_REALM, (text), __VA_ARGS__)
|
|
||||||
|
|
||||||
-noreturn void log_assert_failed_unreachable_realm(
|
|
||||||
+_noreturn_ void log_assert_failed_unreachable_realm(
|
|
||||||
LogRealm realm,
|
|
||||||
const char *text,
|
|
||||||
const char *file,
|
|
||||||
diff --git a/src/basic/macro.h b/src/basic/macro.h
|
|
||||||
index 89bdd852a9..3a6fc6f585 100644
|
|
||||||
--- a/src/basic/macro.h
|
|
||||||
+++ b/src/basic/macro.h
|
|
||||||
@@ -53,6 +53,15 @@
|
|
||||||
#else
|
|
||||||
#define _fallthrough_
|
|
||||||
#endif
|
|
||||||
+/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
|
|
||||||
+ * compiler versions */
|
|
||||||
+#ifndef _noreturn_
|
|
||||||
+#if __STDC_VERSION__ >= 201112L
|
|
||||||
+#define _noreturn_ _Noreturn
|
|
||||||
+#else
|
|
||||||
+#define _noreturn_ __attribute__((noreturn))
|
|
||||||
+#endif
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
/* Temporarily disable some warnings */
|
|
||||||
#define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \
|
|
||||||
@@ -414,16 +423,6 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
-/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
|
|
||||||
- * compiler versions */
|
|
||||||
-#ifndef noreturn
|
|
||||||
-#if __STDC_VERSION__ >= 201112L
|
|
||||||
-#define noreturn _Noreturn
|
|
||||||
-#else
|
|
||||||
-#define noreturn __attribute__((noreturn))
|
|
||||||
-#endif
|
|
||||||
-#endif
|
|
||||||
-
|
|
||||||
#define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \
|
|
||||||
static inline void func##p(type *p) { \
|
|
||||||
if (*p) \
|
|
||||||
diff --git a/src/basic/process-util.c b/src/basic/process-util.c
|
|
||||||
index aa9846db5d..e6120af5b6 100644
|
|
||||||
--- a/src/basic/process-util.c
|
|
||||||
+++ b/src/basic/process-util.c
|
|
||||||
@@ -987,7 +987,7 @@ bool is_main_thread(void) {
|
|
||||||
return cached > 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
-noreturn void freeze(void) {
|
|
||||||
+_noreturn_ void freeze(void) {
|
|
||||||
|
|
||||||
log_close();
|
|
||||||
|
|
||||||
diff --git a/src/basic/process-util.h b/src/basic/process-util.h
|
|
||||||
index 93029e36e5..5170adec7b 100644
|
|
||||||
--- a/src/basic/process-util.h
|
|
||||||
+++ b/src/basic/process-util.h
|
|
||||||
@@ -91,7 +91,7 @@ int pid_from_same_root_fs(pid_t pid);
|
|
||||||
|
|
||||||
bool is_main_thread(void);
|
|
||||||
|
|
||||||
-noreturn void freeze(void);
|
|
||||||
+_noreturn_ void freeze(void);
|
|
||||||
|
|
||||||
bool oom_score_adjust_is_valid(int oa);
|
|
||||||
|
|
||||||
diff --git a/src/core/main.c b/src/core/main.c
|
|
||||||
index 076846a41c..4b2d149237 100644
|
|
||||||
--- a/src/core/main.c
|
|
||||||
+++ b/src/core/main.c
|
|
||||||
@@ -141,7 +141,7 @@ static uint64_t arg_default_tasks_max = UINT64_MAX;
|
|
||||||
static sd_id128_t arg_machine_id = {};
|
|
||||||
static EmergencyAction arg_cad_burst_action = EMERGENCY_ACTION_REBOOT_FORCE;
|
|
||||||
|
|
||||||
-noreturn static void freeze_or_reboot(void) {
|
|
||||||
+_noreturn_ static void freeze_or_reboot(void) {
|
|
||||||
|
|
||||||
if (arg_crash_reboot) {
|
|
||||||
log_notice("Rebooting in 10s...");
|
|
||||||
@@ -156,7 +156,7 @@ noreturn static void freeze_or_reboot(void) {
|
|
||||||
freeze();
|
|
||||||
}
|
|
||||||
|
|
||||||
-noreturn static void crash(int sig) {
|
|
||||||
+_noreturn_ static void crash(int sig) {
|
|
||||||
struct sigaction sa;
|
|
||||||
pid_t pid;
|
|
||||||
|
|
||||||
diff --git a/src/journal/test-journal-interleaving.c b/src/journal/test-journal-interleaving.c
|
|
||||||
index 5a88b2774f..d87bdbdd32 100644
|
|
||||||
--- a/src/journal/test-journal-interleaving.c
|
|
||||||
+++ b/src/journal/test-journal-interleaving.c
|
|
||||||
@@ -37,7 +37,7 @@
|
|
||||||
|
|
||||||
static bool arg_keep = false;
|
|
||||||
|
|
||||||
-noreturn static void log_assert_errno(const char *text, int error, const char *file, int line, const char *func) {
|
|
||||||
+_noreturn_ static void log_assert_errno(const char *text, int error, const char *file, int line, const char *func) {
|
|
||||||
log_internal(LOG_CRIT, error, file, line, func,
|
|
||||||
"'%s' failed at %s:%u (%s): %m", text, file, line, func);
|
|
||||||
abort();
|
|
||||||
diff --git a/src/shared/pager.c b/src/shared/pager.c
|
|
||||||
index 75db3c985b..681af9c40e 100644
|
|
||||||
--- a/src/shared/pager.c
|
|
||||||
+++ b/src/shared/pager.c
|
|
||||||
@@ -47,7 +47,7 @@ static int stored_stderr = -1;
|
|
||||||
static bool stdout_redirected = false;
|
|
||||||
static bool stderr_redirected = false;
|
|
||||||
|
|
||||||
-noreturn static void pager_fallback(void) {
|
|
||||||
+_noreturn_ static void pager_fallback(void) {
|
|
||||||
int r;
|
|
||||||
|
|
||||||
r = copy_bytes(STDIN_FILENO, STDOUT_FILENO, (uint64_t) -1, 0);
|
|
||||||
diff --git a/src/udev/collect/collect.c b/src/udev/collect/collect.c
|
|
||||||
index 2821640e93..c8fa47b3d7 100644
|
|
||||||
--- a/src/udev/collect/collect.c
|
|
||||||
+++ b/src/udev/collect/collect.c
|
|
||||||
@@ -58,7 +58,7 @@ static inline struct _mate *node_to_mate(struct udev_list_node *node)
|
|
||||||
return container_of(node, struct _mate, node);
|
|
||||||
}
|
|
||||||
|
|
||||||
-noreturn static void sig_alrm(int signo)
|
|
||||||
+_noreturn_ static void sig_alrm(int signo)
|
|
||||||
{
|
|
||||||
exit(4);
|
|
||||||
}
|
|
@ -1,58 +0,0 @@
|
|||||||
From 19da3fec80d3e30191be11f6dc7305f6c82e5254 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
||||||
Date: Wed, 18 Apr 2018 18:48:55 +0200
|
|
||||||
Subject: [PATCH] Allow Delegate= to be set on transient units
|
|
||||||
|
|
||||||
---
|
|
||||||
src/core/dbus-cgroup.c | 13 +++++++------
|
|
||||||
1 file changed, 7 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/core/dbus-cgroup.c b/src/core/dbus-cgroup.c
|
|
||||||
index d77f96fdb3..489112087f 100644
|
|
||||||
--- a/src/core/dbus-cgroup.c
|
|
||||||
+++ b/src/core/dbus-cgroup.c
|
|
||||||
@@ -32,6 +32,7 @@
|
|
||||||
#include "fd-util.h"
|
|
||||||
#include "fileio.h"
|
|
||||||
#include "path-util.h"
|
|
||||||
+#include "unit.h"
|
|
||||||
|
|
||||||
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_cgroup_device_policy, cgroup_device_policy, CGroupDevicePolicy);
|
|
||||||
|
|
||||||
@@ -351,13 +352,13 @@ static int bus_cgroup_set_transient_property(
|
|
||||||
if (streq(name, "Delegate")) {
|
|
||||||
int b;
|
|
||||||
|
|
||||||
- if (!UNIT_VTABLE(u)->can_delegate)
|
|
||||||
- return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Delegation not available for unit type");
|
|
||||||
-
|
|
||||||
r = sd_bus_message_read(message, "b", &b);
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
|
|
||||||
+ if (!UNIT_VTABLE(u)->can_delegate && b)
|
|
||||||
+ log_unit_notice(u, "Delegate=yes set, but has no effect for unit type");
|
|
||||||
+
|
|
||||||
if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
|
|
||||||
c->delegate = b;
|
|
||||||
c->delegate_controllers = b ? _CGROUP_MASK_ALL : 0;
|
|
||||||
@@ -370,9 +371,6 @@ static int bus_cgroup_set_transient_property(
|
|
||||||
} else if (streq(name, "DelegateControllers")) {
|
|
||||||
CGroupMask mask = 0;
|
|
||||||
|
|
||||||
- if (!UNIT_VTABLE(u)->can_delegate)
|
|
||||||
- return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Delegation not available for unit type");
|
|
||||||
-
|
|
||||||
r = sd_bus_message_enter_container(message, 'a', "s");
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
@@ -414,6 +412,9 @@ static int bus_cgroup_set_transient_property(
|
|
||||||
unit_write_settingf(u, flags, name, "Delegate=%s", strempty(t));
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (!UNIT_VTABLE(u)->can_delegate && c->delegate)
|
|
||||||
+ log_unit_notice(u, "Delegate=yes set, but has no effect for unit type");
|
|
||||||
+
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
|||||||
From 8eede524d4ec1806554982b67ccfc155fbeb272a Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
||||||
Date: Wed, 18 Apr 2018 19:50:07 +0200
|
|
||||||
Subject: [PATCH] core: fix resetting of Delegate= and properly ignore invalid
|
|
||||||
assignment
|
|
||||||
|
|
||||||
The default is false not true. If we say "ignoring" we must return 0.
|
|
||||||
|
|
||||||
(cherry picked from commit ff1b8455c26b560641d476b426209e297209333a)
|
|
||||||
---
|
|
||||||
src/core/load-fragment.c | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
|
|
||||||
index 5b30c47e83..f1b9b65d1a 100644
|
|
||||||
--- a/src/core/load-fragment.c
|
|
||||||
+++ b/src/core/load-fragment.c
|
|
||||||
@@ -3440,7 +3440,7 @@ int config_parse_delegate(
|
|
||||||
* mask to delegate. */
|
|
||||||
|
|
||||||
if (isempty(rvalue)) {
|
|
||||||
- c->delegate = true;
|
|
||||||
+ c->delegate = false;
|
|
||||||
c->delegate_controllers = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
@@ -3461,7 +3461,7 @@ int config_parse_delegate(
|
|
||||||
return log_oom();
|
|
||||||
if (r < 0) {
|
|
||||||
log_syntax(unit, LOG_ERR, filename, line, r, "Invalid syntax, ignoring: %s", rvalue);
|
|
||||||
- return r;
|
|
||||||
+ return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
cc = cgroup_controller_from_string(word);
|
|
2
sources
2
sources
@ -1 +1 @@
|
|||||||
SHA512 (systemd-238.tar.gz) = c0f272b022308d3bd94679184e102a8dc85de55310bda205a458ea33c77c7733e5c8c8e5b15f786ba3e0ce59e7c6a9bf0d5a0950517c6b91e0f345950129b9c8
|
SHA512 (systemd-0e0aa59.tar.gz) = e904aaf5e5427413894816614cc60f453bd43335654f39356c55345bdc8fd0876d0a234a1e4658632747db5a2fbe395bf145bf9dbef3354a55f339f66e821027
|
||||||
|
20
systemd.spec
20
systemd.spec
@ -1,4 +1,4 @@
|
|||||||
#global gitcommit 10e465b5321bd53c1fc59ffab27e724535c6bc0f
|
%global gitcommit 0e0aa590a8ba759679efbd72e92c0ba4811aa1ec
|
||||||
%{?gitcommit:%global gitcommitshort %(c=%{gitcommit}; echo ${c:0:7})}
|
%{?gitcommit:%global gitcommitshort %(c=%{gitcommit}; echo ${c:0:7})}
|
||||||
|
|
||||||
# We ship a .pc file but don't want to have a dep on pkg-config. We
|
# We ship a .pc file but don't want to have a dep on pkg-config. We
|
||||||
@ -13,7 +13,7 @@
|
|||||||
Name: systemd
|
Name: systemd
|
||||||
Url: http://www.freedesktop.org/wiki/Software/systemd
|
Url: http://www.freedesktop.org/wiki/Software/systemd
|
||||||
Version: 238
|
Version: 238
|
||||||
Release: 7%{?gitcommit:.git%{gitcommitshort}}%{?dist}.1
|
Release: 8%{?gitcommit:.git%{gitcommitshort}}%{?dist}
|
||||||
# For a breakdown of the licensing, see README
|
# For a breakdown of the licensing, see README
|
||||||
License: LGPLv2+ and MIT and GPLv2+
|
License: LGPLv2+ and MIT and GPLv2+
|
||||||
Summary: System and Service Manager
|
Summary: System and Service Manager
|
||||||
@ -48,15 +48,6 @@ i=1; for j in 00*patch; do printf "Patch%04d: %s\n" $i $j; i=$((i+1));done|
|
|||||||
GIT_DIR=../../src/systemd/.git git diffab -M v233..master@{2017-06-15} -- hwdb/[67]* hwdb/parse_hwdb.py > hwdb.patch
|
GIT_DIR=../../src/systemd/.git git diffab -M v233..master@{2017-06-15} -- hwdb/[67]* hwdb/parse_hwdb.py > hwdb.patch
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
Patch0001: 0001-test-cgroup-util-bail-out-when-running-under-mock.patch
|
|
||||||
Patch0002: 0002-basic-fs-util-skip-fsync_directory_of_file-if-proc-s.patch
|
|
||||||
Patch0003: 0003-core-when-reloading-delay-any-actions-on-journal-and.patch
|
|
||||||
Patch0004: 0004-udev-net-id-Fix-check-for-address-to-keep-interface-.patch
|
|
||||||
Patch0005: 0005-core-don-t-include-libmount.h-in-a-header-file-8580.patch
|
|
||||||
Patch0006: 0006-basic-macros-rename-noreturn-into-_noreturn_-8456.patch
|
|
||||||
|
|
||||||
Patch0990: 0990-Allow-Delegate-to-be-set-on-transient-units.patch
|
|
||||||
Patch0991: 0991-core-fix-resetting-of-Delegate-and-properly-ignore-i.patch
|
|
||||||
Patch0998: 0998-resolved-create-etc-resolv.conf-symlink-at-runtime.patch
|
Patch0998: 0998-resolved-create-etc-resolv.conf-symlink-at-runtime.patch
|
||||||
|
|
||||||
%global num_patches %{lua: c=0; for i,p in ipairs(patches) do c=c+1; end; print(c);}
|
%global num_patches %{lua: c=0; for i,p in ipairs(patches) do c=c+1; end; print(c);}
|
||||||
@ -710,6 +701,13 @@ fi
|
|||||||
%files tests -f .file-list-tests
|
%files tests -f .file-list-tests
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri May 11 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 238-8.git0e0aa59
|
||||||
|
- Backport a number of patches (documentation, hwdb updates)
|
||||||
|
- Fixes for tmpfiles 'e' entries
|
||||||
|
- systemd-networkd crashes
|
||||||
|
- XEN virtualization detection on hyper-v
|
||||||
|
- Avoid relabelling /sys/fs/cgroup if not needed (#1576240)
|
||||||
|
|
||||||
* Wed Apr 18 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 238-7.fc28.1
|
* Wed Apr 18 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 238-7.fc28.1
|
||||||
- Allow fake Delegate= setting on slices (#1568594)
|
- Allow fake Delegate= setting on slices (#1568594)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user