summaryrefslogtreecommitdiff
path: root/src/login/logind.c
Commit message (Collapse)AuthorAge
...
* Prep v234: Apply missing upstream fixes in src/login (3/6)Sven Eden2017-07-25
|
* tree-wide: fix wrong indent (#5757)Yu Watanabe2017-07-25
| | | | Fixes wrong indent introduced by the commit 43688c49d1fdb585196d94e2e30bb29755fa591b.
* logind: save/restore session devices and their respective file descriptorsFranck Bui2017-07-25
| | | | | | | | | | | | | | | | | | | This patch ensures that session devices are saved for each session. In order to make the revokation logic work when logind is restarted, the session devices are now saved in the session state files and their respective file descriptors sent to PID1's fdstore in order to keep them open accross restart. This is mandatory in order to keep the revokation logic working. Indeed in case of input-devices, the same file descriptors must be shared by logind and a given session controller in order EVIOCREVOKE to work otherwise multiple sessions can have device access in parallel. This should be the only remaining and missing piece for making logind fully restartable. Fixes: #1163
* Rename formats-util.h to format-util.hZbigniew Jędrzejewski-Szmek2017-07-17
| | | | | | We don't have plural in the name of any other -util files and this inconsistency trips me up every time I try to type this file name from memory. "formats-util" is even hard to pronounce.
* Prep v232: Apply missing updates from upstreamSven Eden2017-07-05
|
* logind: don't hit assert when we try to free NULL manager objectLennart Poettering2017-07-05
| | | | Fixes: #4431
* Prep v231.2: Make sure logs go to syslog or kmsg if elogind was started in ↵Sven Eden2017-06-28
| | | | debug mode, even if it was started from a tty.
* Prep v231.2: Apply some minor style fixesSven Eden2017-06-19
|
* logind: don't hit assert when we try to free NULL manager objectLennart Poettering2017-06-19
| | | | | Fixes: #4431 (cherry picked from commit 84a4e6608dbda38c724ab196a226db209a50b224)
* 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
* util: introduce physical_memory_scale() to unify how we scale by physical memoryLennart Poettering2017-06-16
| | | | | The various bits of code did the scaling all different, let's unify this, given that the code is not trivial.
* Prep v230: src/logind.c: Do not call manager_free(m) if an error lead to m ↵Sven Eden2017-06-16
| | | | still being NULL.
* Prep v230: Apply missing upstream fixes and updates (6/8) src/login.Sven Eden2017-06-16
|
* logind: process session/inhibitor fds at higher priorityLennart Poettering2017-06-16
| | | | | | | Let's make sure we process session and inhibitor pipe fds (that signal sessions/inhibtors going away) at a higher priority than new bus calls that might create new sessions or inhibitors. This helps ensuring that the number of open sessions stays minimal.
* selinux: always try to load the full selinux dbZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | https://github.com/elogind/elogind/pull/2508#issuecomment-190901170 Maybe fixes https://bugzilla.redhat.com/show_bug.cgi?id=1308771.
* Prep v229: elogind should honor its Sleep configuration.Sven Eden2017-05-19
|
* Prep v229: Add missing fixes from upstream [4/6] src/loginSven Eden2017-05-17
|
* logind,machined: bump TasksMax=Lennart Poettering2017-05-17
| | | | | | | | | Issue #2388 suggests the current TasksMax= setting for user processes is to low. Bump it to 12K. Also, bump the container TasksMax= from 8K to 16K, so that it remains higher than the one for user processes. (Compare: the kernel default limit for processes system-wide is 32K). Fixes #2388
* tree-wide: expose "p"-suffix unref calls in public APIs to make gcc cleanup easyLennart Poettering2017-05-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GLIB has recently started to officially support the gcc cleanup attribute in its public API, hence let's do the same for our APIs. With this patch we'll define an xyz_unrefp() call for each public xyz_unref() call, to make it easy to use inside a __attribute__((cleanup())) expression. Then, all code is ported over to make use of this. The new calls are also documented in the man pages, with examples how to use them (well, I only added docs where the _unref() call itself already had docs, and the examples, only cover sd_bus_unrefp() and sd_event_unrefp()). This also renames sd_lldp_free() to sd_lldp_unref(), since that's how we tend to call our destructors these days. Note that this defines no public macro that wraps gcc's attribute and makes it easier to use. While I think it's our duty in the library to make our stuff easy to use, I figure it's not our duty to make gcc's own features easy to use on its own. Most likely, client code which wants to make use of this should define its own: #define _cleanup_(function) __attribute__((cleanup(function))) Or similar, to make the gcc feature easier to use. Making this logic public has the benefit that we can remove three header files whose only purpose was to define these functions internally. See #2008.
* Prep v228: Condense elogind source masks (5/5)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.
* [4/5] Apply missing fixes from upstreamSven Eden2017-03-29
|
* Rename ELOGIND_CGROUP_CONTROLLER back to SYSTEMD_CGROUP_CONTROLLERSven Eden2017-03-14
| | | | | Although it is nice to have it read ELOGIND instead of SYSTEMD, all diffs just show too many irrelevant (false) positives.
* 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.
* Add mounting of a name=elogind cgroup if no init controller is found.Sven Eden2017-03-14
| | | | | This is done for systems, which init systems are no cgroup controllers. One example is runit on Void Linux.
* Add support for building elogind against musl libcSven Eden2017-03-14
| | | | | | | | | | | | | | | | | | | * Check whether printf.h is available and define/undef HAVE_PRINTF_H accordingly. * Added src/shared/parse-printf-format.[hc] by Emil Renner Berthing <systemd@esmil.dk> that provides parse_printf_format() if printf.h is unavailable * Added src/basic/musl_missing.h by Juergen Buchmueller <pullmoll@t-online.de> that implements glibc functions missing in musl libc as macros. * Extended src/basic/musl_missing.h and added src/basic/musl_missing.c providing - program_invocation_name - program_invocation_short_name and - elogind_set_program_name() to set the two where appropriate. * Added calls to elogind_set_program_name() to all main() functions where needed. * A few other fixes to work nicely with musl libc.
* elogind_cgroup_agent registers as elogind.Agent, not systemd1.Agent.Sven Eden2017-03-14
|
* Add --enable-debug=elogind configure option and fix cgroup pathSven Eden2017-03-14
| | | | | | | a) Add some debugging messages to track what's going on with eloginds cgroup handling. b) Do not create a cgroup path "/elogind" if our cgroup root is already "/elogind".
* Classify processes from sessions into cgroupsSven Eden2017-03-14
| | | | | | | Create a private cgroup tree associated with no controllers, and use it to map PIDs to sessions. Since we use our own path structure, remove internal cgroup-related helpers that interpret the cgroup path structure to pull out users, slices, and scopes.
* Uninstall the cgroup release agent when the manager is shut down.Sven Eden2017-03-14
|
* 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 :)
* [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.
* Create /run/systemd as neededSven Eden2017-03-14
| | | | | | | * src/login/logind.c (main): Also create /run/systemd at startup. * Create /run/systemd/machines, so that the login monitor works. * Fail if any of the needed directories could not be created. * But do not fail if any of the needed directories exist.
* Fix logind startupSven Eden2017-03-14
| | | | | | | | | | | * src/login/logind.c (manager_connect_bus): - Notice instead of error if we can't subscribe to updates from systemd. Perhaps we should remove this entirely. But leaving it optional means, that a system managed by systemd can use elogind substituting systemd-login. - Warn instead of error if we can't add receiver matches from systemd events. On a system not run by systemd, such events wouldn't occur anyway.
* Fix man page building to be less systemd and more elogind.Sven Eden2017-03-14
|
* Remove unused and invalid udev definitionsSven Eden2017-03-14
| | | | | | | | | These definitions were not valid when compiling against eudev. As a nice consequence, our own copies of any udev includes are no longer needed and could be removed for good. Add label.h include to logind.c, as "udev.h" is no longer available which would have done so otherwise.
* Prep v225: Applying various fixes and changes to src/login that got lost ↵Sven Eden2017-03-14
| | | | during git am transfer.
* Prep v221: Update and clean up build system to sync with upstreamSven Eden2017-03-14
| | | | | | | | | | | | | | This commit replays the moving around of source files that have been done between systemd-219 and systemd-221. Further the Makefile.am is synchronized with the upstream version and then "re-cleaned". A lot of functions, that are not used anywhere in elogind have been coated into #if 0/#endif directives to further shorten the list of dependencies. All unneeded files have been removed.
* Prep v220: elogind does not need to register with systemd1.*Sven Eden2017-03-14
|
* 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.
* Classify processes from sessions into cgroupsAndy Wingo2017-03-14
| | | | | | | Create a private cgroup tree associated with no controllers, and use it to map PIDs to sessions. Since we use our own path structure, remove internal cgroup-related helpers that interpret the cgroup path structure to pull out users, slices, and scopes.
* Fix the login monitorAndy Wingo2017-03-14
| | | | | | * src/login/logind.c (main): Create /run/systemd/machines, so that the login monitor works. * configure.ac: v219.10.
* 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 :)
* Create /run/systemd as neededAndy Wingo2017-03-14
| | | | | * src/login/logind.c (main): Also create /run/systemd at startup. * configure.ac: Bump to 219.3.
* everywhere: port everything to sigprocmask_many() and friendsLennart Poettering2017-03-14
| | | | | | | | | | | This ports a lot of manual code over to sigprocmask_many() and friends. Also, we now consistly check for sigprocmask() failures with assert_se(), since the call cannot realistically fail unless there's a programming error. Also encloses a few sd_event_add_signal() calls with (void) when we ignore the return values for it knowingly.