summaryrefslogtreecommitdiff
path: root/src/login/logind.c
AgeCommit message (Collapse)Author
2013-09-17logind: listen actively for session devicesDavid Herrmann
Session compositors need access to fbdev, DRM and evdev devices if they control a session. To make logind pass them to sessions, we need to listen for them actively. However, we avoid creating new seats for non master-of-seat devices. Only once a seat is created, we start remembering all other session devices. If the last master-device is removed (even if there are other non-master devices still available), we destroy the seat. This is the current behavior, but we need to explicitly implement it now as there may be non-master devices in the seat->devices list. Unlike master devices, we don't care whether our list of non-master devices is complete. We don't export this list but use it only as cache if sessions request these devices. Hence, if a session requests a device that is not in the list, we will simply look it up. However, once a session requested a device, we must be notified of "remove" udev events. So we must link the devices somehow into the device-list. Regarding the implementation, we now sort the device list by the "master" flag. This guarantees that master devices are at the front and non-master devices at the tail of the list. Thus, we can easily test whether a seat has a master device attached.
2013-09-16Verify validity of session name when received from outsideZbigniew Jędrzejewski-Szmek
Only ASCII letters and digits are allowed.
2013-08-28logind: be more verbose on errorsZbigniew Jędrzejewski-Szmek
2013-08-13logind: restore logic to kill user processes when session endsLennart Poettering
2013-07-10logind: don't misunderstand UnitRemoved signals during reloadingLennart Poettering
When PID 1 reloads the units logind/machined will see UnitRemoved signals for all units. Instead of trusting these immediately, let's check the actual unit state before considering a unit gone, so that reloading PID 1 is not mistaken as the end of all sessions.
2013-07-03logind/machined: properly notice when units are gc'edLennart Poettering
2013-07-02machined: split out machine registration stuff from logindLennart Poettering
Embedded folks don't need the machine registration stuff, hence it's nice to make this optional. Also, I'd expect that machinectl will grow additional commands quickly, for example to join existing containers and suchlike, hence it's better keeping that separate from loginctl.
2013-07-02logind: port over to use scopes+slices for all cgroup stuffLennart Poettering
In order to prepare things for the single-writer cgroup scheme, let's make logind use systemd's own primitives for cgroup management. Every login user now gets his own private slice unit, in which his sessions live in a scope unit each. Also, add user@$UID.service to the same slice, and implicitly start it on first login.
2013-06-20logind: uninitialized variableZbigniew Jędrzejewski-Szmek
2013-06-20logind: add infrastructure to keep track of machines, and move to slicesLennart Poettering
- This changes all logind cgroup objects to use slice objects rather than fixed croup locations. - logind can now collect minimal information about running VMs/containers. As fixed cgroup locations can no longer be used we need an entity that keeps track of machine cgroups in whatever slice they might be located. Since logind already keeps track of users, sessions and seats this is a trivial addition. - nspawn will now register with logind and pass various bits of metadata along. A new option "--slice=" has been added to place the container in a specific slice. - loginctl gained commands to list, introspect and terminate machines. - user.slice and machine.slice will now be pulled in by logind.service, since only logind.service requires this slice.
2013-04-25conf-parser: restrict .include usageLennart Poettering
Disallow recursive .include, and make it unavailable in anything but unit files.
2013-04-24logind: don't busy loop if a job is still running but the delay timeout expiresLennart Poettering
2013-04-24logind: properly enumerate user/session cgroups under their new suffixed namesLennart Poettering
2013-04-17Report about syntax errors with metadataZbigniew Jędrzejewski-Szmek
The information about the unit for which files are being parsed is passed all the way down. This way messages land in the journal with proper UNIT=... or USER_UNIT=... attribution. 'systemctl status' and 'journalctl -u' not displaying those messages has been a source of confusion for users, since the journal entry for a misspelt setting was often logged quite a bit earlier than the failure to start a unit. Based-on-a-patch-by: Oleksii Shevchuk <alxchk@gmail.com>
2013-04-16nspawn: introduce the new /machine/ tree in the cgroup tree and move ↵Lennart Poettering
containers there Containers will now carry a label (normally derived from the root directory name, but configurable by the user), and the container's root cgroup is /machine/<label>. This label is called "machine name", and can cover both containers and VMs (as soon as libvirt also makes use of /machine/). libsystemd-login can be used to query the machine name from a process. This patch also includes numerous clean-ups for the cgroup code.
2013-04-16logind: when looking for cgroup prefixes, allocate from stackLennart Poettering
2013-04-15Fix spelling errors using 'codespell' toolAnatol Pomozov
2013-04-05Use initalization instead of explicit zeroingZbigniew Jędrzejewski-Szmek
Before, we would initialize many fields twice: first by filling the structure with zeros, and then a second time with the real values. We can let the compiler do the job for us, avoiding one copy. A downside of this patch is that text gets slightly bigger. This is because all zero() calls are effectively inlined: $ size build/.libs/systemd text data bss dec hex filename before 897737 107300 2560 1007597 f5fed build/.libs/systemd after 897873 107300 2560 1007733 f6075 build/.libs/systemd … actually less than 1‰. A few asserts that the parameter is not null had to be removed. I don't think this changes much, because first, it is quite unlikely for the assert to fail, and second, an immediate SEGV is almost as good as an assert.
2013-03-15logind: explicitly create state directories during early initializationLennart Poettering
Strictly speaking this isn't necessary for the /run/systemd/seats/ directory, since that is created anyway as the first seat is found, and seat0 is always found. But let's be explicit here, and also create the sessions/ and users/ directories, so that people can always install inotify watches from very early on, even when nobody logged in yet.
2013-02-14update TODOThomas Hindoe Paaboel Andersen
2013-02-09logind: rename "seat-master" tag to "master-of-seat"Lennart Poettering
We currently enforce that seats are to be named in the form of "seatXXX", i.e. need to begin with the 4 characters "seat". Thus, "seat-master" would qualify as a seat name. As seat names are frequently used as tags on devices, the "seat-master" tag might hence confuse logind if the user decides to name a seat "seat-master". Hence, avoid any ambuigity: let's rename the "seat-master" tag to "master-of-seat".
2013-01-25logind: rework delay inhibition logicLennart Poettering
- Don't allow any locks to be taken while we are in the process of executing the specific operation, so that apps are not surprised if a suspend/shutdown happens while they rely on their inhibitor. - Get rid of the Resumed signal, it was a bad idea, and redundant due to PrepareForSleep(false), see below. - Always send out PrepareFor{Shutdown,Sleep} signals, instead of only if a delay lock is taken. - Move PrepareForSleep(false) after we come back from the suspend, so that apps can use this as "Resumed" notification. This also has the benefit that apps know when to take a new lock.
2013-01-24logind: only allow one shutdown/sleep action to be queued at the same timeLennart Poettering
This should make sure that closing the lid while shutting down won't suspend the machine but will simply cause the shutdown to complete.
2013-01-07logind: Capability of making seats without framebuffer devicesOleg Samarin
file logind.c: The seat is now activated by any device with udev tag "seat-master" file 71-seat.rules.in: All framebuffer devices have this tag
2012-12-24logind: add support for automatic suspend/hibernate/shutdown on idleLennart Poettering
2012-09-21logind: split up HandleSleepKey= into HandleSuspendKey= and HandleHibernateKey=Lennart Poettering
The kernel and X11 distuingish these two, and Thinkpad keys have both, hence we really should distinguish them too.
2012-09-21logind: allow users to override their own suspend/sleep inhibitorsLennart Poettering
2012-09-19logind: if a lid-switch lock was taken while the lid was closed, recheck lid ↵Lennart Poettering
status when the lock is released
2012-09-19logind: rework power key/suspend key/lid switch handlingLennart Poettering
http://lists.freedesktop.org/archives/systemd-devel/2012-September/006604.html https://bugzilla.gnome.org/show_bug.cgi?id=680689 This changes the meaning of the HandlePowerKey=/HandleSleepKey=/HandleLidSwitch= setting of logind.conf
2012-09-17logind: make VT reservation logic compatible with containersLennart Poettering
2012-09-17logind: make sure there's always a getty available on TTY6Lennart Poettering
Previously, if X allocated all 6 TTYs (for multi-session for example) no getty would be available anymore to guarantee console-based logins. With the new ReserveVT= switch in logind.conf we can now choose one VT (6 by default) that will always be subject to autovt-style activation, i.e. we'll always have a getty on TTY6, and X will never take possession of it.
2012-08-08logind: use bus_method_call_with_reply() where posibleSimon Peeters
2012-07-26log.h: new log_oom() -> int -ENOMEM, use itShawn Landden
also a number of minor fixups and bug fixes: spelling, oom errors that didn't print errors, not properly forwarding error codes, few more consistency issues, et cetera
2012-07-25use "Out of memory." consistantly (or with "\n")Shawn Landden
glibc/glib both use "out of memory" consistantly so maybe we should consider that instead of this. Eliminates one string out of a number of binaries. Also fixes extra newline in udev/scsi_id
2012-07-16unit: introduce %s specifier for the user shellLennart Poettering
2012-06-15logind: more robust handling of VT-less systemsMichal Schmidt
Restore the check that was removed in commit 74afee9c. Its removal caused a regression on some s390x systems where for whatever reason the device node /dev/tty0 exists and makes the preceding access() check pass.
2012-05-31logind: properly clean up user cgroups when they run emptyLennart Poettering
2012-05-30logind: rework button setting semanticsLennart Poettering
If a graphical session without full DE that handles power/suspend events is used this can now be controlled by logind instead, optionally.
2012-05-30logind: optionally handle power, sleep and lid switch eventsLennart Poettering
This takes handling of chassis power and sleep keys as well as the lid switch over from acpid. This logic is enabled by default for power and sleep keys, but not for the lid switch. If a graphical session is in the foreground no action is taken under the assumption that the graphical session does this.
2012-05-08logind: implement suspend/hibernate calls with inhibition logicLennart Poettering
2012-05-05logind: implement delay inhibitor locks in addition to block inhibitor locksLennart Poettering
This is useful to allow applications to synchronously save data before the system is suspended or shut down.
2012-04-16logind: remove redundant entries from logind's default controller lists tooLennart Poettering
2012-04-16logind: hook up inhibit logic with idle hint logicLennart Poettering
2012-04-16logind: add shutdown/suspend/idle inhibition frameworkLennart Poettering
2012-04-13logind: explicitly check for /dev/tty0Lennart Poettering
2012-04-12relicense to LGPLv2.1 (with exceptions)Lennart Poettering
We finally got the OK from all contributors with non-trivial commits to relicense systemd from GPL2+ to LGPL2.1+. Some udev bits continue to be GPL2+ for now, but we are looking into relicensing them too, to allow free copy/paste of all code within systemd. The bits that used to be MIT continue to be MIT. The big benefit of the relicensing is that closed source code may now link against libsystemd-login.so and friends.
2012-04-03logind: log with AUTH facilityLennart Poettering
2012-03-30rename /etc/systemd/systemd-{login,journal}d.conf to {login,journal}d.confKay Sievers
2012-02-03cgroup: when getting cgroup empty notifications, always search up the treeLennart Poettering
2012-01-31logind: if we have to stop a session, kill at least its leaderLennart Poettering