| Commit message (Collapse) | Author | Age |
... | |
| |
|
|
|
|
| |
not init.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
available (#8386)
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
(cherry picked from commit 3ceae1bc14d2da3fc1fe4753d6657759012256dc)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The initial fix for relabelling the cgroup filesystem for
SELinux delivered in commit 8739f23e3 was based on the assumption that
the cgroup filesystem is already populated once mount_setup() is
executed, which was true for my system. What I wasn't aware is that this
is the case only when another instance of systemd was running before
this one, which can happen if systemd is used in the initrd (for ex. by
dracut).
In case of a clean systemd start-up the cgroup filesystem is actually
being populated after mount_setup() and does not need relabelling as at
that moment the SELinux policy is already loaded. Since however the root
cgroup filesystem was remounted read-only in the meantime this operation
will now fail.
To fix this check for the filesystem mount flags before relabelling and
only remount ro->rw->ro if necessary and leave the filesystem read-write
otherwise.
Fixes #7901.
(cherry picked from commit 6f7729c1767998110c4460c85c94435c5782a613)
Also https://bugzilla.redhat.com/show_bug.cgi?id=1576240.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes it behave the same whether there is a blank line or not at
the end of the file. This is also consistent with the behavior of the
shell on a shell script that ends on a trailing backslash at the last
line.
Added tests to test_config_parse(), which only pass if the corresponding
change to config_parse() is included.
(cherry picked from commit 4f29e0db127dce9e1a28af4d7bf88c124ba257b7)
|
|
|
|
|
|
|
|
| |
Manager.enable_wall_messages is false
Fixes #8904.
(cherry picked from commit 6e78fa4afd474dae984f3ee4a8477c623296a519)
|
|
|
|
|
|
|
|
| |
Apparently Xen sometimes lies about its identity when queried via CPUID.
Let's hence prefer DMI tests for CPUID
Fixes: #8844
(cherry picked from commit f2fe2865cd19cd4318b82d01b9b62d22b1697b3a)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This includes:
- arm
- arm64
- alpha
- powerpc64
- sparc
Taken from kernel 4.16.6
(cherry picked from commit 773c84349d80c7a6f818f5909a160ddb7337987f)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This extends the change done in b29f6480ec to other logging functions.
This actually fixes some bugs in callers of log_struct(), for example
config_parse_alias() called 'return log_syntax(..., 0, ...)' which could result
in a bogus non-zero return value.
Calls to log_object() and log_format_iovec() — which is only used by
server_driver_message() — appear correct.
(cherry picked from commit d1a1f0aaf0d2f08c60d1e0d32e646439d99f58dc)
|
|
|
|
|
|
|
|
|
|
|
|
| |
If enabling controller for some reason fails we need to clear error
for the FILE stream. Enabling remaining controllers would otherwise
fail because write_string_stream_ts() checks for ferror(f) and returns
-EIO if there is one.
Broken by commit <77fa610b22>.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
(cherry picked from commit 96aa6591d1103b8cca9a4db80ba478a18bdf3e9a)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A regression was introduced that caused the mtime of /etc/.updated
and /var/.updated to be the current time when systemd-update-done
ran instead of being copied from /usr.
This was nearly fixed, but due to fflush being called after mtime
was carefully set, it was overwritten with the current time.
Regression introduced in 872c40396384f9fa89b01baf4e739d28ed590299
A fix was just missed in 39c38d773fbe2b4f76ff29ecd3344640efb9a86c
Fixes #8806
(cherry picked from commit be83711c7eb6a09e0d0c529c427cebcae87c0c1f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Quoting https://github.com/systemd/systemd/pull/8760#discussion_r183321060:
> When we originally added the errno patching we went for a "best of both
> worlds" approach, i.e. that we override errno if an error is specified, but
> if no error is specified (i.e. 0 is passed as error code) then we use the
> previously set errno, similar in style how plain `printf()` would do it. In
> retrospect I think we almost never purposefully made use of the second,
> i.e. the plain `printf()` logic, but we multiple times ran into this case
> accidentally and introduced a bug. Hence yes, it probably makes sense to
> switch this over, and consistently ignore the `errno` already set and always
> override it with the error passed in. The only problem I see with that is: I
> wonder if there might be a case or two lurking somewhere where we actually
> made use of the "best of both worlds" approach, and if so, if we can detect
> where... (But then again, even if there is, and we fail to find those cases,
> maybe that's not all bad, as it's just a few new bugs against probably fixing
> many more old and future bugs, if you follow what I mean).
I scanned our codebase, and found some bugs in the value passed to log_*_errno,
but no intentional cases of error=0 being passed.
(cherry picked from commit b29f6480eca0550ba65d30fbece8dd4d4bfe666d)
|
|
|
|
|
|
| |
This state is cached, and it's seems OK to log at least once.
(cherry picked from commit 13bb68bbe37f0b39cd45234b09fb1a1da8302020)
|
|
|
|
|
|
|
|
|
|
| |
ISO-C doesn't allow empty initializers, so replace it by explicitly
initializing to zero.
Also add braces because x is a union and we initialize a subobject, so
a compiler might warn about suggesting braces. Shut that up.
(cherry picked from commit d579a56c397a1aeaa490032a9f7aabd82124f1c8)
|
|
|
|
|
|
|
|
|
|
| |
Things can fail, and we have no control over it:
- file system issues (immutable bits, file system errors, MAC refusals, etc)
- kernel refusing certain arguments when writing to /proc/sys or /sys
Let's add a new code for the case where we parsed configuration but failed
to execute it because of external errors.
(cherry picked from commit bb9947be2fa308d198b63b30e494ade5d68e5109)
|
|
|
|
|
|
|
|
|
| |
When `systemd` is run in the TEST_RUN_MINIMAL mode, it doesn't really
set up cgroups, so it shouldn't try to remove anything.
Closes https://github.com/systemd/systemd/issues/8474.
(cherry picked from commit f6c63f6fc90040f0017a7cc37f3a05d5b86226d7)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By default both processes, systemd-inhibit and the forked one, receive
the signals. Pressing Ctrl+C on the keyboard results in SIGINT being
sent to the processes, followed by SIGTERM being sent to the forked
process when systemd-inhibit exits. This can cause trouble when the
forked process does not clean up properly but exit immediately.
Instead make systemd-inhibit ignore SIGINT, leaving it to the forked
process to clean up and exit.
(cherry picked from commit 106f12a08fcacef713438fc055872592399deeed)
|
|
|
|
|
|
|
| |
This was broken in 77f9fa3b8ea46c27e5a5e9270f71bf1b4000c3e0. My fault.
Fixes: #8543
(cherry picked from commit 29f74559d4dc6ea41232233d32f1a92bcee43626)
|
|
|
|
| |
(cherry picked from commit 68b525d1d1e8153cbc2e2354fa650aa165f7a434)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"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)
|
|
|
|
|
|
| |
so that the test never affects the root namespace.
(cherry picked from commit c58fd466a313a1f93df1792822e358c67990bcdf)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reproducer:
$ meson build && cd build
$ ninja
$ sudo useradd test
$ sudo su test
$ ./systemd --system --test
...
Failed to create /user.slice/user-1000.slice/session-6.scope/init.scope control group: Permission denied
Failed to allocate manager object: Permission denied
Above error message is caused by the fact that user test didn't have its
own session and we tried to set up init.scope already running as user
test in the directory owned by different user.
Let's try to setup cgroup hierarchy, but if that fails return error only
when not running in the test mode.
Fixes #8072
(cherry picked from commit aa77e234fce7413b7dd64f99ea51450f2e2e9dbd)
|
|
|
|
| |
(cherry picked from commit eef03d70c1bedb3aabd4e2bcf10ab1f2678443bf)
|
|
|
|
|
|
| |
Fixes #8387.
(cherry picked from commit 5cbaad2f6795088db56063d20695c6444595822f)
|
|
|
|
|
|
| |
Fixes #8376, which is introduced by 2b33ab0957f453a06b58e4bee482f2c2d4e100c1.
(cherry picked from commit 280029d18f470a64403d68717eef1be5274ff8af)
|
|
|
|
|
| |
Without locale.h, there is an implicit declaration of function `freelocale`,
which is reported as error by -Werror=implicit-function-declaration.
|
| |
|
|
|
|
| |
(cherry picked from commit d8949c3072a4b984d6fa964178a2d8d945ecbcb6)
|
|
|
|
|
|
| |
on my side.
(cherry picked from commit 1c9629692145891f10a36227749470d87979dd0b)
|
|
|
|
| |
(cherry picked from commit a96cb75c17b008312fca8f81bc2a126f8a87850c)
|
|
|
|
| |
(cherry picked from commit 6964ec46218d41d699690ed590026249969b2257)
|
|
|
|
| |
src/test (6/6)
|
|
|
|
| |
src/shared (5/6)
|
|
|
|
| |
src/login (4/6)
|
|
|
|
| |
src/libelogind (3/6)
|
|
|
|
| |
src/core (2/6)
|
|
|
|
| |
src/basic (1/6)
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Remember to set sd->pushed_fd when we receive an fd from PID1 on startup,
the same as we set it when we send an fd to PID1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ git grep FDNAME
logind-session-device.c: ... "FDNAME=session-", sd->session->id);
logind-session-device.c: ... "FDNAME=session", sd->session->id);
Oops.
Fixes #8343. Or at least a more minimal reproducer. Xorg still
dies when logind is restarted, but the Xorg message says this
is entirely deliberate.
(This could also be the reason I hit #8035, instead of the race
condition I originally suggested).
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Quite often we need to set up a number of fds as stdin/stdout/stderr of
a process we are about to start. Add a generic implementation for a
routine doing that that takes care to do so properly:
1. Can handle the case where stdin/stdout/stderr where previously
closed, and the fds to set as stdin/stdout/stderr hence likely in the
0..2 range. handling this properly is nasty, since we need to first
move the fds out of this range in order to later move them back in, to
make things fully robust.
2. Can optionally open /dev/null in case for one or more of the fds, in
a smart way, sharing the open file if possible between multiple of
the fds.
3. Guarantees that O_CLOEXEC is not set on the three fds, even if the fds
already were in the 0..2 range and hence possibly weren't moved.
|
|
|
|
|
| |
Let's systematically make use of reallocarray() whereever we invoke
realloc() with a product of two values.
|