summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* 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.
* Stop sessions on ReleaseSessionSven Eden2017-03-14
|
* Uninstall the cgroup release agent when the manager is shut down.Sven Eden2017-03-14
|
* Remove src/basic/special.h, as all defines in there are systemd-only.Sven Eden2017-03-14
|
* Add poweroff, suspend etc. loginctl commandsSven Eden2017-03-14
| | | | | | | * src/login/loginctl.c: Add poweroff, reboot, suspend, hibernate, and hybrid-sleep commands. Normally these are handled by systemctl but since elogind is targeted at the no-systemd use case, we incorporate them here.
* 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.
* [Patch 2/3] Add cgroups initialization and handlingSven Eden2017-03-14
| | | | | Add a highly reduced src/core/cgroup.[hc] to enable elogind to setup cgroups for proper usage.
* [Patch 1/3] Add cgroups initialization and handlingSven Eden2017-03-14
| | | | | | Re-add elogind-cgroups-agent. elogind will not be able to support the new unified hierarchy, and the agent is needed for the classical hierarchy.
* 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.
* Remove obsolete headers and the src/core directory.Sven Eden2017-03-14
|
* Remove librt dependency.Sven Eden2017-03-14
| | | | | | | | The only function still using librt was src/shared/clean-ipc.c::clean_posix_mq(). But that function is not really needed, because elogind does not call mq_open() anywhere, or any other mqueue related functions.
* Remove sd_is_mqSven Eden2017-03-14
| | | | | | | * src/systemd/sd-daemon.h: * src/libelogind/sd-daemon/sd-daemon.c (sd_is_mq): Remove unused function that depended on librt. Ultimately we should remove this header at some point.
* Fix man page building to be less systemd and more elogind.Sven Eden2017-03-14
|
* Remove APPARMOR, BLKID and SECCOMP checks and feature.Sven Eden2017-03-14
| | | | | Remove logind check, it is always built as elogind anyway. Remove ENABLE_LOGIND conditional from man pages.
* 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.
* Remove libidn featureSven Eden2017-03-14
|
* Remove ELFUTILS, GCRYPT, GNUTLS, IMA, LIBAUDIT, LIBCRYPTSETUP,Sven Eden2017-03-14
| | | | LZ4 and XZ features from build.h
* 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
* Remove kmodSven Eden2017-03-14
|
* Remove cgroups-agent, it is not really needed.Sven Eden2017-03-14
|
* Remove SysV compatSven Eden2017-03-14
|
* Remove utmp stuff that has found it's way back in.Sven Eden2017-03-14
|
* Prep 4xx6: Fix logind_gperf_lookup declarationSven Eden2017-03-14
|
* Prep v226: Mask all unneeded functionsSven Eden2017-03-14
|
* Prep v226: loginctl.c: Fix call to (changed) cg_is_empty_recursive().Sven Eden2017-03-14
|
* Prep v226: Fix some function prototypes in bus-util.hSven Eden2017-03-14
|
* Prep v226: Add src/basic/copy.[hc] to libbasic, the function copy_bytes() is ↵Sven Eden2017-03-14
| | | | needed by pager.c
* Prep v220: Fix src/basic/time-util.h, unmask timezone_is_valid, mask ↵Sven Eden2017-03-14
| | | | unneeded functions.
* Prep v226: Apply missing fixes and changes to src/sharedSven Eden2017-03-14
|
* Prep v226: Apply missing fixes and changes to src/loginSven Eden2017-03-14
|
* Prep v226: Apply missing fixes and changes to src/libelogindSven Eden2017-03-14
|
* Prep v226: Apply missing fixes and changes to src/basicSven Eden2017-03-14
|
* sd-bus: when connecting to a container AF_UNIX bus, return errorLennart Poettering2017-03-14
| | | | | | | | When forking of a child process for connecting to a container, pass the preicse connection error to the calling process. We already did this correctly for kdbus busses, let's do so for dbus1 busses, too.
* logind: make scope of wall message handling smallerLennart Poettering2017-03-14
|
* sd-bus: make introspection data non-recursiveDavid Herrmann2017-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, our introspection data looks like this: <node> <interface name="org.freedesktop.DBus.Peer"> ... </interface> <interface name="org.freedesktop.DBus.Introspectable"> ... </interface> <interface name="org.freedesktop.DBus.Properties"> ... </interface> <node name="org"/> <node name="org/freedesktop"/> <node name="org/freedesktop/login1"/> <node name="org/freedesktop/login1/user"/> <node name="org/freedesktop/login1/user/self"/> <node name="org/freedesktop/login1/user/_1000"/> <node name="org/freedesktop/login1/seat"/> <node name="org/freedesktop/login1/seat/self"/> <node name="org/freedesktop/login1/seat/seat0"/> <node name="org/freedesktop/login1/session"/> <node name="org/freedesktop/login1/session/self"/> <node name="org/freedesktop/login1/session/c1"/> </node> (ordered alphabetically for better visibility) This is grossly incorrect. The spec says that we're allowed to return non-directed children, however, it does not allow us to return data recursively in multiple parents. If we return "org", then we must not return anything else that starts with "org/". It is unclear, whether we can include child-nodes as a tree. Moreover, it is usually not what the caller wants. Hence, this patch changes sd-bus to never return introspection data recursively. Instead, only a single child-layer is returned. This patch relies on enumerators to never return hierarchies. If someone registers an enumerator via sd_bus_add_enumerator, they better register sub-enumerators if they support *TRUE* hierarchies. Each enumerator is treated as a single layer and not filtered. Enumerators are still allowed to return nested data. However, that data is still required to be a single hierarchy. For instance, returning "/org/foo" and "/com/bar" is fine, but including "/com" or "/org" in that dataset is not. This should be the default for enumerators and I see no reason to filter in sd-bus. Moreover, filtering that data-set would require to sort the strv by path and then do prefix-filtering. This is O(n log n), which would be fine, but still better to avoid. Fixes #664.
* sd-bus: derive uid from cgroup if possibleDavid Herrmann2017-03-14
| | | | | | | | | | | | | | | | | | | | | | Whenever we run in a user context, sd_bus_{default_user,open_user}() and friends should always connect to the user-bus of the current context, instead of deriving the uid from getuid(). This allows us running programs via sudo/su, without the nasty side-effect of accidentally connecting to the root user-bus. This patch enforces the idea of making su/sudo *not* opening sessions by default. That is, all they do is raising privileges, but keeping everything set as before. You can still use su/sudo to open real sessions by requesting a login-session (or loading pam_elogind otherwise). However, in this case XDG_RUNTIME_DIR= will not be set (as usual in these cases), hence, you will not be able to connect to *any* user-bus. Long story short: With this patch applied, both: - ./busctl --user - sudo ./busctl --user ..will successfully connect to the user-bus of the local user. Fixes #390.
* login: fix NULL-deref on wall_messageDavid Herrmann2017-03-14
| | | | | | | | | | | | | | | We treat an empty wall-message equal to a NULL wall-message since: commit 5744f59a3ee883ef3a78214bd5236157acdc35ba Author: Lennart Poettering <lennart@poettering.net> Date: Fri Sep 4 10:34:47 2015 +0200 logind: treat an empty wall message like a NULL one Fix the shutdown scheduler to not deref a NULL pointer, but properly check for an empty wall-message. Fixes: #1120
* logind: when parsing a boolean via sd-bus the type must be "int"Lennart Poettering2017-03-14
| | | | And not bool.
* logind: treat an empty wall message like a NULL oneLennart Poettering2017-03-14
|
* sd-login: minor header commenting improvementsLennart Poettering2017-03-14
|
* sd-login: add new sd_pid_get_cgroup() APILennart Poettering2017-03-14
| | | | | | | | | | This adds a new sd_pid_get_cgroup() call to sd-login which may be used to query the control path of a process. This is useful for programs when making use of delegation units, in order to figure out which subtree has been delegated. In light of the unified control group hierarchy this is finally safe to do, hence let's add a proper API for it, to make it easier to use this.
* sd-login: rework error handlingLennart Poettering2017-03-14
| | | | | | Makre sure we always return sensible errors for the various, following the same rules, and document them in a comment in sd-login.c. Also, update all relevant man pages accordingly.
* cgroup: when comparing agent paths, use path_equal()Lennart Poettering2017-03-14
| | | | | After all a path is a path is a path and we should use path_equal() to comapre those.
* audit: audit calls should return ENODATA when process are not in an audit ↵Lennart Poettering2017-03-14
| | | | | | | session ENODATA is how we usually indicate such "missing info" cases, so we should do this here, too.
* util: add new uid_is_valid() callLennart Poettering2017-03-14
| | | | | | This simply factors out the uid validation checks from parse_uid() and uses them everywhere. This simply verifies that the passed UID is neither 64bit -1 nor 32bit -1.