| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
| |
Let's log the error messages if we get any at debug level.
(cherry picked from commit bd26aee1f6bea13fe25b3feb2a5e9cd1be522e7e)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
These lines are generally out-of-date, incomplete and unnecessary. With
SPDX and git repository much more accurate and fine grained information
about licensing and authorship is available, hence let's drop the
per-file copyright notice. Of course, removing copyright lines of others
is problematic, hence this commit only removes my own lines and leaves
all others untouched. It might be nicer if sooner or later those could
go away too, making git the only and accurate source of authorship
information.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This part of the copyright blurb stems from the GPL use recommendations:
https://www.gnu.org/licenses/gpl-howto.en.html
The concept appears to originate in times where version control was per
file, instead of per tree, and was a way to glue the files together.
Ultimately, we nowadays don't live in that world anymore, and this
information is entirely useless anyway, as people are very welcome to
copy these files into any projects they like, and they shouldn't have to
change bits that are part of our copyright header for that.
hence, let's just get rid of this old cruft, and shorten our codebase a
bit.
|
|
|
|
|
|
|
| |
Externally it's an uint64_t anyway, and internally we most just
initialize it to physical_memory() which returns uint64_t, hence there's
exactly zero value in using it as size_t internally. Hence, let's fix
that, and use uint64_t everywhere.
|
|
|
|
|
|
|
|
|
|
|
| |
This makes most header files easier to look at. Also Emacs gets really
slow when browsing through large sections of overly long prototypes,
which is much improved by this macro.
We should probably not do something similar with too many other cases,
as macros like this might help readability for some, but make it worse
for others. But I think given the complexity of this specific prototype
and how often we use it, it's worth doing.
|
|
|
|
| |
It is now unused.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes the UserTasksMax= setting in logind.conf. Instead, the generic
TasksMax= setting on the slice should be used. Instead of a transient unit we
use a drop-in to tweak the default definition of a .slice. It's better to use
the normal unit mechanisms instead of creating units on the fly. This will also
make it easier to start user@.service independently of logind, or set
additional settings like MemoryMax= for user slices.
The setting in logind is removed, because otherwise we would have two sources
of "truth": the slice on disk and the logind config. Instead of trying to
coordinate those two sources of configuration (and maintainer overrides to
both), let's just convert to the new one fully.
Right now now automatic transition mechanism is provided. logind will emit a
hint when it encounters the setting, but otherwise it will be ignored.
Fixes #2556.
|
|
|
|
| |
In preparation to reusing them later in other places...
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Files which are installed as-is (any .service and other unit files, .conf
files, .policy files, etc), are left as is. My assumption is that SPDX
identifiers are not yet that well known, so it's better to retain the
extended header to avoid any doubt.
I also kept any copyright lines. We can probably remove them, but it'd nice to
obtain explicit acks from all involved authors before doing that.
|
|
|
|
|
|
|
|
| |
This change adds support for controlling the suspend-on-lid-close
behaviour based on the power status as well as whether the machine is
docked or has an external monitor. For backwards compatibility the new
configuration file variable is ignored completely by default, and must
be set explicitly before being considered in any decisions.
|
| |
|
| |
|
|
|
|
|
| |
`vt_is_busy(16)` would always return FALSE. So we could have started
autovt@16.service even when VT 16 was already being used for something.
|
|
|
|
|
|
|
| |
gperf-3.1 generates lookup functions that take a size_t length
parameter instead of unsigned int. Test for this at configure time.
Fixes: https://github.com/elogind/elogind/issues/5039
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Let's change from a fixed value of 12288 tasks per user to a relative value of
33%, which with the kernel's default of 32768 translates to 10813. This is a
slight decrease of the limit, for no other reason than "33%" sounding like a nice
round number that is close enough to 12288 (which would translate to 37.5%).
(Well, it also has the nice effect of still leaving a bit of room in the PID
space if there are 3 cooperating evil users that try to consume all PIDs...
Also, I like my bikesheds blue).
Since the new value is taken relative, and machined's TasksMax= setting
defaults to 16384, 33% inside of containers is usually equivalent to 5406,
which should still be ample space.
To summarize:
| on the host | in the container
old default | 12288 | 12288
new default | 10813 | 5406
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
For similar reasons as the recent addition of a limit on sessions.
Note that we don't enforce a limit on inhibitors per-user currently, but
there's an implicit one, since each inhibitor takes up one fd, and fds are
limited via RLIMIT_NOFILE, and the limit on the number of processes per user.
|
|
|
|
|
|
|
|
|
|
|
| |
We really should put limits on all resources we manage, hence add one to the
number of concurrent sessions, too. This was previously unbounded, hence set a
relatively high limit of 8K by default.
Note that most PAM setups will actually invoke pam_elogind prefixed with "-",
so that the return code of pam_elogind is ignored, and the login attempt
succeeds anyway. On systems like this the session will be created but is not
tracked by elogind.
|
|
|
|
|
|
| |
Move sleep relevant functions from shared/sleep-config.* and
login/logind-action.* into login/logind-sleep.* - they aren't used outside
of elogind anyway.
|
|
|
|
|
| |
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Apply remaining fixes and the performed move of utility functions
into their own foo-util.[hc] files on the rest of elogind.
|
|
|
|
|
|
|
|
| |
The patching of elogind in several steps with only partly rebasing on
a common commit with upstream, left the tree in a state, that was
unmergeable with master. By rebasing on master and manually cleaning
up all commits, this merge is now possible.
However, this process left some orphans, that are cleanup now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- src/basic/ioprio.h - removed
- src/basic/ring.h - removed
- src/basic/capability.[hc] - cleaned
- src/basic/cgroup-util.[hc] - cleaned
- src/basic/hostname-util.[hc] - cleaned
- src/basic/path-util.[hc] - cleaned
- src/basic/socket-util.h - cleaned
- src/basic/strv.[hc] - cleaned
- src/basic/time-util.[hc] - cleaned
- src/basic/unit-name.[hc] - cleaned
- src/basic/util.[hc] - cleaned
- src/libelogind/sd-bus/bus-introspect.c - cleaned
- src/login/loginctl.c - cleaned
- src/login/logind-dbus.c - cleaned
- src/login/logind.h - cleaned
- src/shared/conf-parser.[hc] - cleaned
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/login/logind-action.c (shutdown_or_sleep, do_sleep): Take modes
from the manager instead of parsing them ourselves.
* src/login/logind-dbus.c (execute_shutdown_or_sleep): Adapt to
shutdown_or_sleep prototype change.
* src/login/logind-gperf.gperf: Add config items from sleep.conf.
* src/login/logind.c (manager_new): Wire up defaults for new config
items.
(manager_free): Free new config items.
(manager_parse_config_file): Arrange to parse a single
elogind/logind.conf file, not grovelling all over the filesystem.
Take the file from the ELOGIND_CONF_FILE environment variable if
present.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since we are catching the keys, we might as well just do
suspend/reboot/etc handling here.
* configure.ac: Get paths of halt and reboot.
* Makefile.am (systemsleepdir, systemshutdowndir): New variables. Look
in them for hooks to run.
* src/login/logind-action.c: Inline the salient bits from systemd's
sleep/sleep.c here.
* src/login/logind-dbus.c (execute_shutdown_or_sleep): Call our own
shutdown_or_sleep helper instead of invoking a systemd method.
* src/login/logind-action.h: Declare shutdown_or_sleep.
|
|
|
|
|
| |
Auto-spawning VTs requires systemd in practice. If you're using systemd
you can just use its logind :)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* elogind does not support systemd services and units. But at least
the units are needed to support the systemd cgroup slice/scope
system.
* Remove systemd subscription to scope, service and slice jobs.
These can not be supported in any way, as they depend on systemd
running the machine.
* The functions session_start_scope(), user_start_service() and
user_start_slice() no longer try to call systemd via dbus for
assistance.
This way they generate their proper scope, service and slice names,
and store them in the Managers HashMaps for session and user units.
This should enable us to reverse track pids to users and such
stuff, as that is what systemd-logind does, not knowing whether any
unit *really* has been started or not.
However, this will not work out of the box until we find a way to
integrate cg_create_everywhere() into elogind without becoming
dependent of systemd unit, service and job knowledge again.
|
|
|
|
|
| |
Let elogind setup cgroups support on its manager initialization and
free the cgroups subsystem when the manager is destroyed.
|
|
|
|
|
|
|
|
|
| |
build-sys: add check for gperf lookup function signature (#5055)
gperf-3.1 generates lookup functions that take a size_t length
parameter instead of unsigned int. Test for this at configure time.
Fixes: https://github.com/systemd/systemd/issues/5039
|
| |
|
|
|
|
| |
during git am transfer.
|
|
|
|
|
| |
Prep v220: Update logind and loginctl to upstream version.
Prep v220: src/shared/rm-rf.c does not need to be able to handle btrfs subvolumes for elogind.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure.ac: Get paths of halt and reboot.
* Makefile.am (systemsleepdir, systemshutdowndir): New variables. Look
in them for hooks to run.
* src/login/logind-action.c: Inline the salient bits from systemd's
system-sleep.c here.
* src/login/logind-dbus.c (execute_shutdown_or_sleep): Call our own
shutdown_or_sleep helper instead of invoking a systemd method.
* src/login/logind.h: Declare shutdown_or_sleep.
|
|
|
|
|
| |
Since we are catching the keys, we might as well just do
suspend/reboot/etc handling here.
|
|
|
|
|
|
| |
This removes attempts by logind to listen to systemd messages over the
bus, and to start and/or manage units associated with sessions and
users.
|
|
|
|
|
| |
Auto-spawning VTs requires systemd in practice. If you're using systemd
you can just use its logind :)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we'd just count connected displays, and if there was 2 or
more we assumed a "docked" state.
With this change we now:
- Only count external displays, ignore internal ones (which we detect by
checking the connector name against a whitelist of known external plug
types)
- We ignore connectors which are explicitly disabled
- We then compare the count with >= 1 rather than >= 2 as before
This new logic has the benefit that systems that disconnect the internal
display when the lid is closed are better supported. Also, explicitly
disabled ports do not confuse the algorithm anymore.
This new algorithm has been suggested here:
http://lists.freedesktop.org/archives/intel-gfx/2015-June/068821.html
This also makes two functions static, that are not used outside of their
.c files.
|