| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
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.
|
|
|
|
| |
For consistency.
|
| |
|
|
|
|
| |
Fixes: #8291
|
| |
|
| |
|
|
|
|
|
| |
After discussing with the kernel folks, we agreed to default to 0700 for
this. Better safe than sorry.
|
|
|
|
| |
Follow-up for 157baa87e4.
|
|
|
|
| |
Follow-up for #8149.
|
|
|
|
|
| |
I didn't like the nested loop where we'd count what we have acquired already,
since we should always know that.
|
|
|
|
|
|
|
|
| |
The kernel exposes the necessary data in /proc anyway, let's expose it
hence by default.
With this in place "systemctl status -- -.slice" will show accounting
data out-of-the-box now.
|
|
|
|
|
| |
Do what we already prepped in cgtop for the root slice in PID 1 too:
consult /proc for the data we need.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Let's make sure we don't clobber the return parameter on failure, to
follow our coding style. Also, break the loop early if we have all
attributes we need.
This also changes the keys parameter to a simple char**, so that we can
use STRV_MAKE() for passing the list of attributes to read.
This also makes it possible to distuingish the case when the whole
attribute file doesn't exist from one key in it missing. In the former
case we return -ENOENT, in the latter we now return -ENXIO.
|
|
|
|
|
|
| |
This is preparation for emulating the "usage_usec" keyed attribute of
the "cpu.stat" property of the root cgroup from data in /proc. Similar,
for emulating the "memory.current" attribute.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
messages pending
We maintain a queue of units and jobs that we are supposed to generate
change/new notifications for because they were either just created or
some of their property has changed. Let's throttle processing of this
queue a bit: as soon as > 1K of bus messages are queued for writing
let's skip processing the queue, and then recheck on the next
iteration again.
Moreover, never process more than 100 units in one go, return to the
event loop after that. Both limits together should put effective limits
on both space and time usage of the function, delaying further
operations until a later moment, when the queue is empty or the the
event loop is sufficiently idle again.
This should keep the number of generated messages much lower than
before on busy systems or where some client is hanging.
Note that this also means a bad client can slow down message dispatching
substantially for up to 90s if it likes to, for all clients. But that
should be acceptable as we only allow trusted bus clients, anyway.
Fixes: #8166
|
| |
|
| |
|
|
|
|
|
|
| |
At various places we only want to close fds if they are not
stdin/stdout/stderr, i.e. fds 0, 1, 2. Let's add a unified helper call
for that, and port everything over.
|
|
|
|
|
|
|
|
|
| |
I figure sooneror later we'll have more of these docs, hence let's give
them a clean place to be.
This leaves NEWS and README/README.md as well as the LICENSE texts in
the root directory of the project since that appears to be customary for
Free Software projects.
|
|
|
|
|
|
|
|
|
|
|
| |
rule-syntax-check.py failed with the following error:
$ ./test/rule-syntax-check.py ./src/login/70-uaccess.rules
Invalid line ./src/login/70-uaccess.rules:31: SUBSYSTEM=="sound", TAG+="uaccess" OPTIONS+="static_node=snd/timer", OPTIONS+="static_node=snd/seq"
clause: TAG+="uaccess" OPTIONS+="static_node=snd/timer"
The comma is actually optional but the script makes it mandatory which seems a
good thing since it improves readability.
|
|
|
|
| |
Accurate for both ppc and ppc64 according to https://fedora.juszkiewicz.com.pl/syscalls.html.
|