summaryrefslogtreecommitdiff
path: root/src/login/logind.h
Commit message (Collapse)AuthorAge
* Prep v239.2: Fix migration errors in loginSven Eden2018-11-08
|
* logind: add a RequiresMountsFor= dependency from the session scope unit to ↵Lennart Poettering2018-10-29
| | | | | | | | | | | | | | 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)
* logind: optionally watch utmp for login dataLennart Poettering2018-10-29
| | | | | | | | 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)
* logind: add hashtable for finding session by leader PIDLennart Poettering2018-10-29
| | | | | | | This is useful later on, when we quickly want to find the session for a leader PID. (cherry picked from commit 238794b15082e6f61d0ce2943d39205289fff7f0)
* logind: optionally, keep the user@.service instance for eached logged in ↵Lennart Poettering2018-10-29
| | | | | | | | | | | | 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)
* logind: rework how we manage the slice and user-runtime-dir@.service unit ↵Lennart Poettering2018-10-29
| | | | | | | | | | | | | | | | | | | | | | 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)
* logind: make unit/job active checking more debuggableLennart Poettering2018-10-29
| | | | | | Let's log the error messages if we get any at debug level. (cherry picked from commit bd26aee1f6bea13fe25b3feb2a5e9cd1be522e7e)
* Prep v239: Add support for the new 'suspend-then-hibernate' method.Sven Eden2018-08-24
|
* tree-wide: remove Lennart's copyright linesLennart Poettering2018-08-24
| | | | | | | | | | | 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.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-08-24
| | | | | | | | | | | | | | | | 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.
* logind: let's change the type of the runtime directory size to uint64_tLennart Poettering2018-08-24
| | | | | | | 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.
* tree-wide: port over all code to the new CONFIG_PARSER_PROTOTYPE() macroLennart Poettering2018-08-24
| | | | | | | | | | | 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.
* logind: remove manager_start_slice()Zbigniew Jędrzejewski-Szmek2018-08-24
| | | | It is now unused.
* Use a dash-truncated drop-in for user-%j.slice configurationZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | | | | | | | | | | 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.
* logind: move two functions to logind_core utility libZbigniew Jędrzejewski-Szmek2018-08-24
| | | | In preparation to reusing them later in other places...
* logind: enable limiting of user session scopes using pam context objects (#8397)Jan Synacek2018-08-24
|
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-08-24
| | | | | | | | | | 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.
* Suspend on lid close based on power status. (#8016)Simon Fowler2018-05-30
| | | | | | | | 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.
* Prep v236 : Add missing SPDX-License-Identifier (5/9) src/loginSven Eden2018-03-26
|
* v235: Added missing updatesSven Eden2017-11-19
|
* logind: VT_GETSTATE "cannot return state for more than 16 VTs" (#6625)Alan Jenkins2017-09-25
| | | | | `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.
* build-sys: add check for gperf lookup function signature (#5055)Mike Gilbert2017-07-17
| | | | | | | 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
* Prep v231: Move elogind specific code in login/logind.c to login/elogind.cSven Eden2017-06-16
|
* logind: change TasksMax= value for user logins to 33%Lennart Poettering2017-06-16
| | | | | | | | | | | | | | | | | | | | 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
* Prep v230: Add utmp support to make wall message to work properly.Sven Eden2017-06-16
|
* Prep v230: Apply missing upstream fixes and updates (6/8) src/login.Sven Eden2017-06-16
|
* logind: enforce a limit on inhibitors we hand outLennart Poettering2017-06-16
| | | | | | | | 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.
* logind: enforce a limit on current user sessionsLennart Poettering2017-06-16
| | | | | | | | | | | 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.
* Prep v229: Consolidate system sleep functions.Sven Eden2017-05-22
| | | | | | Move sleep relevant functions from shared/sleep-config.* and login/logind-action.* into login/logind-sleep.* - they aren't used outside of elogind anyway.
* tree-wide: remove Emacs lines from all filesDaniel Mack2017-05-17
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* Prep v228: Condense elogind source masks (5/5)Sven Eden2017-04-26
|
* Prep v228: Substitute declaration masks (4/4)Sven Eden2017-04-26
|
* Prep v228: Removed utmp bits. elogind does not support utmp-wtmp.Sven Eden2017-04-26
|
* Prep v228: Add remaining updates from upstream (3/3)Sven Eden2017-04-26
| | | | | Apply remaining fixes and the performed move of utility functions into their own foo-util.[hc] files on the rest of elogind.
* Major cleanup of all leftovers after rebasing on master.Sven Eden2017-03-14
| | | | | | | | 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.
* Cleaned up more unneeded functions and types in:Sven Eden2017-03-14
| | | | | | | | | | | | | | | | | | | | - 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
* Incorporate sleep.conf into logind.confSven Eden2017-03-14
| | | | | | | | | | | | | | | | | * 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.
* Handle suspend, shutdown, reboot, etc within elogindSven Eden2017-03-14
| | | | | | | | | | | | | | | | | 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.
* Remove support for auto-spawning VTsSven Eden2017-03-14
| | | | | Auto-spawning VTs requires systemd in practice. If you're using systemd you can just use its logind :)
* Remove dependency of systemd units, services and slices for new sessions.Sven Eden2017-03-14
| | | | | | | | | | | | | | | | | | | | * 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.
* [Patch 3/3] Add cgroups initialization and handlingSven Eden2017-03-14
| | | | | Let elogind setup cgroups support on its manager initialization and free the cgroups subsystem when the manager is destroyed.
* Fix lookup_errno by adding a gperf length parameter detection.Sven Eden2017-03-14
| | | | | | | | | 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
* Prep 4xx6: Fix logind_gperf_lookup declarationSven Eden2017-03-14
|
* Prep v225: Applying various fixes and changes to src/login that got lost ↵Sven Eden2017-03-14
| | | | during git am transfer.
* Prep v220: Use new cgroups functionsSven Eden2017-03-14
| | | | | 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.
* Handle suspend/hibernate/hybrid-suspend/shutdown/reboot directlyAndy Wingo2017-03-14
| | | | | | | | | | | | | | * 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.
* Beginnings of handling suspend/etc within logindAndy Wingo2017-03-14
| | | | | Since we are catching the keys, we might as well just do suspend/reboot/etc handling here.
* Remove systemd subscription and user/session unitsAndy Wingo2017-03-14
| | | | | | 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.
* Remove support for auto-spawning VTsAndy Wingo2017-03-14
| | | | | Auto-spawning VTs requires systemd in practice. If you're using systemd you can just use its logind :)
* logind: rework display counting when detecting whether the system is dockedLennart Poettering2017-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.