summaryrefslogtreecommitdiff
path: root/src/login/logind.c
Commit message (Collapse)AuthorAge
* elogind: Try to register any of the signals report errors and return the ↵Stefan Stefanović2018-11-10
| | | | first error.
* elogind: Use SIG_BLOCK before signal handler registration.Stefan Stefanović2018-11-10
|
* Prep v239.2: Fix migration errors in loginSven Eden2018-11-08
|
* 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: 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: voidify a few callsLennart Poettering2018-10-29
| | | | (cherry picked from commit 75bbdf478c73d78bbe5bdee6f468c2e84a1844c6)
* logind: improve logging in manager_connect_console()Lennart Poettering2018-10-29
| | | | | | | | | | | | | | | | | 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)
* logind: initialize Manager object with structure initialization tooLennart Poettering2018-10-29
| | | | (cherry picked from commit b25ba6cf673036e46cbaec77d3c7859ed83d3ca8)
* 238/239 : Fix session finalizationSven Eden2018-10-15
| | | | | | | | | | While migrating the v237/v238 commits, a migration error caused session_may_gc() to always return false. This caused closed sessions to stay on state "closing" forever. Bug: https://github.com/elogind/elogind/issues/82 Closes: https://github.com/elogind/elogind/issues/82 Signed-off-by: Sven Eden <sven.eden@prydeworx.com>
* Prep v239: Utilize new user_runtime_dir() functionSven Eden2018-08-29
|
* Prep v239: Fix main() to call manager_new() again.Sven Eden2018-08-24
|
* Prep v239: Add support for the new 'suspend-then-hibernate' method.Sven Eden2018-08-24
|
* Prep v239: Update manager_parse_config_file() that got moved to logind-core.cSven 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: fix borked r checkZbigniew Jędrzejewski-Szmek2018-08-24
| | | | CID #1390947, #1390952.
* logind: (void)ify all things we knowingly ignoreLennart Poettering2018-08-24
|
* logind: terminate cleanly on SIGTERM/SIGINTLennart Poettering2018-08-24
| | | | | | | Let's properly terminate on SIGTERM or SIGINT. Previously we'd just rely on the implicit process clean-up logic on UNIX. By shutting down properly on SIGTERM/SIGINT we make it easier to track down memory leaks by employing valgrind.
* logind: modernize Manager object allocation and freeingLennart Poettering2018-08-24
| | | | | | Let's propagate errors correctly, and stick to the usual naming and behaviour of these functions. Or in other words, make this closer to the matching code in machined.
* login: drop unnecessary headersYu Watanabe2018-08-24
|
* logind: move two functions to logind_core utility libZbigniew Jędrzejewski-Szmek2018-08-24
| | | | In preparation to reusing them later in other places...
* tree-wide: drop redundant _cleanup_ macros (#8810)Lennart Poettering2018-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | This drops a good number of type-specific _cleanup_ macros, and patches all users to just use the generic ones. In most recent code we abstained from defining type-specific macros, and this basically removes all those added already, with the exception of the really low-level ones. Having explicit macros for this is not too useful, as the expression without the extra macro is generally just 2ch wider. We should generally emphesize generic code, unless there are really good reasons for specific code, hence let's follow this in this case too. Note that _cleanup_free_ and similar really low-level, libc'ish, Linux API'ish macros continue to be defined, only the really high-level OO ones are dropped. From now on this should really be the rule: for really low-level stuff, such as memory allocation, fd handling and so one, go ahead and define explicit per-type macros, but for high-level, specific program code, just use the generic _cleanup_() macro directly, in order to keep things simple and as readable as possible for the uninitiated. Note that before this patch some of the APIs (notable libudev ones) were already used with the high-level macros at some places and with the generic _cleanup_ macro at others. With this patch we hence unify on the latter.
* 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.
* macro: introduce TAKE_PTR() macroLennart Poettering2018-08-24
| | | | | | | | | | | | | | | | This macro will read a pointer of any type, return it, and set the pointer to NULL. This is useful as an explicit concept of passing ownership of a memory area between pointers. This takes inspiration from Rust: https://doc.rust-lang.org/std/option/enum.Option.html#method.take and was suggested by Alan Jenkins (@sourcejedi). It drops ~160 lines of code from our codebase, which makes me like it. Also, I think it clarifies passing of ownership, and thus helps readability a bit (at least for the initiated who know the new macro)
* Fix elogind debug mode:Sven Eden2018-06-29
| | | | | | | | | | | | | | When switched from autotools to meson, config.h changed fundamentally. Although enabled values are still #define HAVE_FOO 1 the disabled values are nolonger undef, but now #define HAVE_FOO 0 Therefore all instances of #ifdef ENABLE_DEBUG_ELOGIND have been changed to #if ENABLE_DEBUG_ELOGIND
* Prep v238: Uncomment now needed headers and unmask now needed functions in ↵Sven Eden2018-06-05
| | | | src/login (4/6)
* logind: check file is device node before using .st_rdevLennart Poettering2018-05-30
|
* logind: trivial improvementsLennart Poettering2018-05-30
| | | | | Just some addition whitespace, some additional assert()s, and removal of redundant variables.
* Add some handling to remaining unlinkat callsZbigniew Jędrzejewski-Szmek2018-05-30
| | | | | | | | | | | Coverity now started warning about this ("Calling unlinkat without checking return value (as is done elsewhere 12 out of 15 times).", and it is right: most of the time we should at list print a log message so people can figure out something is wrong when this happens. v2: - use warning level in journald too (this is unlikely to happen ever, so it should be safe to something that is visible by default).
* login,user-sessions: always warn when we fail to remove nologin fileZbigniew Jędrzejewski-Szmek2018-05-30
| | | | | | | This usually is very annoying to users who then cannot log in, so make sure we always warn if that happens (selinux, or whatever other reason). This reverts a790812cb349c5cef95d1b4a20fc80ca08d3a145.
* logind: change check_gc to may_gc everywhereZbigniew Jędrzejewski-Szmek2018-05-30
|
* 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.
* log: minimize includes in log.hLennart Poettering2018-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | log.h really should only include the bare minimum of other headers, as it is really pulled into pretty much everything else and already in itself one of the most basic pieces of code we have. Let's hence drop inclusion of: 1. sd-id128.h because it's entirely unneeded in current log.h 2. errno.h, dito. 3. sys/signalfd.h which we can replace by a simple struct forward declaration 4. process-util.h which was needed for getpid_cached() which we now hide in a funciton log_emergency_level() instead, which nicely abstracts the details away. 5. sys/socket.h which was needed for struct iovec, but a simple struct forward declaration suffices for that too. Ultimately this actually makes our source tree larger (since users of the functionality above must now include it themselves, log.h won't do that for them), but I think it helps to untangle our web of includes a tiny bit. (Background: I'd like to isolate the generic bits of src/basic/ enough so that we can do a git submodule import into casync for it)
* tree-wide: make the Subscribe() method calls asynchronous tooLennart Poettering2018-05-30
|
* tree-wide: install matches asynchronouslyLennart Poettering2018-05-30
| | | | | | | | | Let's remove a number of synchronization points from our service startups: let's drop synchronous match installation, and let's opt for asynchronous instead. Also, let's use sd_bus_match_signal() instead of sd_bus_add_match() where we can.
* tree-wide: make name requesting asynchronous in all our servicesLennart Poettering2018-05-30
| | | | | This optimizes service startup a bit, and makes it less prone to deadlocks.
* Move /var/lib/systemd/linger to /var/lib/elogind/.Sven Eden2018-04-23
|
* Prep v236 : Add missing SPDX-License-Identifier (5/9) src/loginSven Eden2018-03-26
|
* check_tree.pl: Do not allow commented out includes to be moved under our ↵Sven Eden2018-03-08
| | | | elogind block.
* Apply updates from upstreamSven Eden2017-12-07
|
* cgroup, unit, fragment parser: make use of new firewall functionsDaniel Mack2017-11-21
|
* Add abstraction model for BPF programsDaniel Mack2017-11-20
| | | | | This object takes a number of bpf_insn members and wraps them together with the in-kernel reference id. Will be needed by the firewall code.
* Prep v235: Catch and react on SIGINT, SIGQUIT and SIGTERMSven Eden2017-08-31
|
* Prep v235: Fix startup order and add debug logging.Sven Eden2017-08-31
|
* Prep v235: optimize elogind extra startup functionalitySven Eden2017-08-30
|
* Prep v235: Set defaults for the sleep config *after* loading the config file.Sven Eden2017-08-29
|
* Prep v235: Allow elogind to daemonize itself with "-D|--daemon".Sven Eden2017-08-16
|
* Prep v234: Eventually fix the cgroup stuff. elogind is not init.Sven Eden2017-07-27
|