| Commit message (Collapse) | Author | Age |
|
|
|
|
| |
Bug: #83
Signed-off-by: Sven Eden <sven.eden@prydeworx.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
As elogind supports musl-libc, we have to remedy the situation that
upstream decided to make use of qsort_r(). This function is not
provided by musl-libc, so we have to provide an own variant.
The variant is an adaption of the qsort_r() algorithm found in
glibc-2.28, the disclaimer from their source files have been added.
Bug: #83
Signed-off-by: Sven Eden <sven.eden@prydeworx.com>
|
|
|
|
|
|
|
|
|
|
| |
Since D-Bus 1.9.14 (2015-03-02) dbus looks in $XDG_RUNTIME_DIR/bus for
the system bus on its own, hence we can finally drop setting this
environment variable. gdbus since glib 2.45.3 (June 2015) also supports
it.
Closes: #87
Sigend-off-by: Sven Eden <sven.eden@prydeworx.com>
|
| |
|
|
|
|
|
|
|
| |
Bug: #87
Closes: #87
Signed-off-by: Cameron Nemo <camerontnorman@gmail.com>
Signed-off-by: Sven Eden <sven.eden@prydeworx.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(emersion):
> sd-bus is shipped with elogind, so it makes sense to ship the
> busctl command, too.
This is not only a nice helper tool to take a closer look at what is
happening on the dbus, it will also prove to be usefull if something
like issue #59 happens ever again. There we had to use dbus-send
directly to dissect the bus traffic.
Bug: #86
Closes: #86
Signed-off-by: Sven Eden <sven.eden@prydeworx.com>
|
|
|
|
|
|
| |
Bug: #85
Closes: #85
Signed-off-by: Sven Eden <sven.eden@prydeworx.com>
|
|
|
|
|
|
| |
Bug: #88
Closes: #88
Signed-off-by: Sven Eden <sven.eden@prydeworx.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
(cherry picked from commit cb9e44db36caefcbb8ee7a12e14217305ed69ff2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
journald calls fd_get_path() a lot (it probably shouldn't, there's some
room for improvement there, but I'll leave that for another time), hence
it's worth optimizing the call a bit, in particular as it's easy.
Previously we'd open the dir /proc/self/fd/ first, before reading the
symlink inside it. This means the whole function requires three system
calls: open(), readlinkat(), close(). The reason for doing it this way
is to distinguish the case when we see ENOENT because /proc is not
mounted and the case when the fd doesn't exist.
With this change we'll directly go for the readlink(), and only if that
fails do an access() to see if /proc is mounted at all.
This optimizes the common case (where the fd is valid and /proc
mounted), in favour of the uncommon case (where the fd doesn#t exist or
/proc is not mounted).
(cherry picked from commit f267719c389de57ceda433f6288a505e7eeb2f8f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I noticed while profiling journald that we invoke readlinkat() a ton on
open /proc/self/fd/<fd>, and that the returned paths are more often than
not longer than the 99 chars used before, when we look at archived
journal files. This means for these cases we generally need to execute
two rather than one syscalls.
Let's increase the buffer size a tiny bit, so that we reduce the number
of syscalls executed. This is really a low-hanging fruit of
optimization.
(cherry picked from commit 8e060ec225b74bbf22e5bdbacd604efcc73294c0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
First of all, let's fix logging: let's simply log the same message as we
do on success, so that there's always the same pair of these messages
around, regardless if the suspend was successful or not. To distuingish
a successful suspend from a failed one, check the ERRNO= field of the
structured message.
In most ways a failed suspend cycle is not distuingishable from a
successful one that took no time, hence let's treat it this way, and
always pair the success message with a failure message.
This also changes a more important concept: the post-suspend callouts
are now called also called on failure, following the same logic: let's
always run them in pairs: for every pre callout a post callout has to
follow.
(cherry picked from commit 14250f0942b0c1122a35d678e73945d7adf9cfa0)
|
|
|
|
|
|
|
|
| |
This function is about compatibility, nothing else, hence we should make
it properly compatible.
Fixes: #9556
(cherry picked from commit def34f63fe066c964764733242b332774070bac6)
|
|
|
|
| |
(cherry picked from commit 8f7329ac276306dfaf6cc47920f3c5e71a0ab586)
|
|
|
|
|
|
|
|
|
|
|
| |
The helper is supposed to properly handle cases where .sun_path does not
contain a NUL byte, and thus copies out the path suffix a NUL as
necessary.
This also reworks the more specific socket_address_unlink() to be a
wrapper around the more generic sockaddr_un_unlink()
(cherry picked from commit 9f20fc28f0a624ea49ac941bcde57b5435a01b6e)
|
|
|
|
| |
(cherry picked from commit 242c41b850af8ebc0c7a0cd44be057e50b5a027a)
|
|
|
|
|
|
|
|
| |
Let's be safe than sorry, in particular as logind doesn't set it up
anymore, but user-runtime-dir@.service does, and logind doesn't really
track success of that.
(cherry picked from commit b92171124819305985ed292cc472f6668a027425)
|
|
|
|
|
|
|
|
|
| |
does in comments
The old comments were imprecise, and misleading. Let's extend things and
explain the situation in more detail.
(cherry picked from commit 3a7369495bdbec38d897a48da511e126e373b253)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
slice, not runtime dir service) is running anymore
This heavily borrows from @intelfx' PR #5546, but watches all three
units that are associated with a user now: the slice, the user@.service
and user-runtime-dir@.service.
The logic and reasoning behind it is the same though: there's no value
in keeping lingering users around if all their three services are gone.
Replaces: #5546
Fixes: #4162
(cherry picked from commit 4e5b605af202c770dfc8e3562d0f8d0440b2fe14)
|
|
|
|
|
|
|
|
|
|
|
| |
Let's make this a bit prettier, and propagate unexpected access() errors
correctly.
(The callers of this function will suppress them, but it's nicer of they
do that, rather than us doing that twice in both the callers and the
callees)
(cherry picked from commit 6996df9b864981980f5b713dc5c7d506a7a4b9bf)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the home directory of the user
This is useful so that during shutdown scope units are always terminated
before the mounts necessary for the home directory.
(Ideally we'd also add a similar dependency from the user@.service
instance to the home directory, but this isn't as easy as that service
is defined statically and not dynamically, and hence not easy to modify
dynamically, in particular when it comes to deps)
(cherry picked from commit d5ac9d060267820aabdf9af509a54a1830b27b7d)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the bus
I think this is a slightly cleaner approach than parsing the
configuration file at multiple places, as this way there's only a single
reload cycle for logind.conf, and that's systemd-logind.service's
runtime.
This means that logind and dbus become a requirement of
user-runtime-dir, but given that XDG_RUNTIME_DIR is not set anyway
without logind and dbus around this isn't really any limitation.
This also simplifies linking a bit as this means user-runtime-dir
doesn't have to link against any code of logind itself.
(cherry picked from commit 07ee5adb356b9fde500c8a5226f24a314789832b)
|
|
|
|
|
|
|
|
| |
This allows us to determine the TTY an ssh session is for, which is
useful to to proper idle detection for ssh sessions.
Fixes: #9622
(cherry picked from commit 3d0ef5c7e00155bc74f6f71c34cad518a4ff56ba)
|
|
|
|
|
|
|
| |
This is useful later on, when we quickly want to find the session for a
leader PID.
(cherry picked from commit 238794b15082e6f61d0ce2943d39205289fff7f0)
|
|
|
|
|
|
|
|
|
|
|
|
| |
user around for a while
This should speed up rapid logout/login cycles a bit.
By default this timeout is now set to 10s.
Fixes: #8410
Replaces: #4434
(cherry picked from commit 9afe9efb9340588db553950727a2a9672dc3db24)
|
|
|
|
| |
(cherry picked from commit 061c6607a9f2e39a76ee74048f19b5de16c8fac3)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
for each user
Instead of managing it explicitly, let's simplify things and rely on
regular Wants=/Requires= dependencies to pull in these units from
user@.service and the session scope, and StopWhenUneeded= to stop these
auxiliary units again. This way, they can be pulled in easily by
unrelated units too.
This simplifies things quite a bit: for each session we now only need to
manage the session scope, and for each user the user@.service, the other
units are not something we need to manage anymore.
This patch also makes sure that if user@.service of a user is masked we
will continue to work, and user-runtime-dir@.service will still be
correctly pulled in, as it is now a dependency of the scope unit.
Fixes: #9461
Replaces: #5546
(cherry picked from commit 25a1ab4ed48b72e974f77a68dcbe3521014787bb)
|
|
|
|
| |
(cherry picked from commit fb2367edd943d37f418725c90498a940016e80bd)
|
|
|
|
| |
(cherry picked from commit ea3a7cf6c34163834893f1f4c7af44c8245776ac)
|
|
|
|
|
|
|
|
|
|
| |
Let's propagate errors from stopping sessions via seat_stop(). This is
similar to how we propagate such errors in user_stop() for all sessions
associated with a user.
Note that we propagate these errors, but we don't abort the function.
(cherry picked from commit e6958b7ea33813b085966ac25817a957c0dad7f9)
|
|
|
|
| |
(cherry picked from commit b1951bc83ffbbb92ba4de7b9cba845421c2f35b1)
|
|
|
|
| |
(cherry picked from commit 1b88ed3b7db37241323348f640f9adb61c0df47a)
|
|
|
|
| |
(cherry picked from commit d5ddc930150633f9ce38ed4a6dc9accfd7ceaaac)
|
|
|
|
| |
(cherry picked from commit 709d058756da7139181355b63cfad2288eefddfe)
|
|
|
|
| |
(cherry picked from commit 75bbdf478c73d78bbe5bdee6f468c2e84a1844c6)
|
|
|
|
| |
(cherry picked from commit e555d12635007da7263d0a43ed7307e70a07720d)
|
|
|
|
| |
(cherry picked from commit 04857cd801022d9f9933efb484c6253572f09870)
|
|
|
|
|
|
| |
Let's log the error messages if we get any at debug level.
(cherry picked from commit bd26aee1f6bea13fe25b3feb2a5e9cd1be522e7e)
|
|
|
|
|
|
|
|
|
| |
This new call move an sd_bus_error into another one.
(cherry picked from commit 190128e407eb24a445554c0e1f956a1d51f97338)
In the backport, the new function is made non-public, declared in bus-error.h
not sd-bus.h.
|
|
|
|
| |
(cherry picked from commit cce08496e7353e3e9903b42695aba3f9d259b90a)
|
|
|
|
| |
(cherry picked from commit d88ffeeeefda4c3447223fd36f8e30f23c931e48)
|
|
|
|
|
|
|
| |
Whether we are stopping or not is highly relevant, hence don't forget it
across restarts.
(cherry picked from commit d865bc024bf28c17120d7322a81e9a99997a59f6)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
let's make sure we log about every failure
Also, complain about systems where /dev/tty0 exists but
/sys/class/tty/tty0/active does not. Such systems (usually container
environments) are pretty broken as they mount something that is not a VC
to /dev/tty0 and they really shouldn't.
Systems should either have a VC or not, but not badly fake one by
mounting things wildly.
This just adds a warning message, as before we'll simply turn off VC
handling in this case.
(cherry picked from commit 0b6d55cae9b8adc507fbea95d1b2874729a77386)
|