summaryrefslogtreecommitdiff
path: root/src/login/logind-action.c
Commit message (Collapse)AuthorAge
* 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.
* shared: add terminal-util.[ch]Ronny Chevalier2017-03-14
|
* shared: add formats-util.hRonny Chevalier2017-03-14
|
* shared: add process-util.[ch]Ronny Chevalier2017-03-14
|
* Incorporate sleep.conf into logind.confAndy Wingo2015-08-29
| | | | | | | | | | | | | | | | | * 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/hibernate/hybrid-suspend/shutdown/reboot directlyAndy Wingo2015-08-23
| | | | | | | | | | | | | | * 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 Wingo2015-08-23
| | | | | Since we are catching the keys, we might as well just do suspend/reboot/etc handling here.
* tree-wide: there is no ENOTSUP on linuxDavid Herrmann2015-03-13
| | | | Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses.
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* logind: add HandleLidSwitchDocked= option to logind.conf + documentationBen Wolsieffer2014-08-26
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=82485
* logind: allow suspending if there are no displaysMantas Mikulėnas2014-05-16
| | | | | | | | | | | With proprietary graphics drivers, there won't be any 'drm' devices in sysfs, so logind will never suspend the system upon closing the lid, even if only one (internal) display is connected. This has been reported by multiple users so far. IMHO, it's better to suspend the system in this case for safety reasons, to avoid having nvidia blob users' laptops overheat, for the same reason that sleep inhibitors are overridden (LidSwitchIgnoreInhibited=yes).
* Remove unnecessary casts in printfsZbigniew Jędrzejewski-Szmek2014-05-15
| | | | No functional change expected :)
* logind: Do not fail display count if a device has no parentMantas Mikulėnas2014-03-11
| | | | | | | udev_device_get_parent() may return NULL when the device doesn't have a parent, as is the case with (for example) /sys/devices/virtual/drm/ttm. Also, log an actual error message instead of "-12 displays connected".
* logind: ignore lid switch events for 30s after each suspend and 3min after ↵Lennart Poettering2014-03-03
| | | | | | | | | | | startup This is needed to give USB docking stations and suchlike time to settle, so that a display connected to an USB docking station can actually act as a lid swith inhibitor correctly. With this change we should have somewhat reliable docking station support in place.
* logind: fix printf formatLennart Poettering2014-03-03
|
* logind: ignore lid switch if more than 1 display is connectedLennart Poettering2014-03-03
| | | | | | | | | | Previously we expected the desktop environment to take an inhibitor lock, but this opened a race on boot-up where logind might already be running but no DE is active. Hence, let's move checking for additional displays into logind. This also opens up this logic for other DEs, given that only GNOME implemented the inhibitor logic so far.
* logind: detect whether the system is docked, and if it is inhibit lid switch ↵Lennart Poettering2014-02-24
| | | | | | | processing This should make operation nicer with docking stations, but will not cover anything that does not implement SW_DOCK.
* logind: when we wake up from suspend and the lid is still closed, go to ↵Lennart Poettering2014-02-21
| | | | | | | | | | | | | | | | | | | sleep immediately again This is quite useful on laptops such as the Lenovo Yoga, where the power button is placed on the front side of the laptop and can be pressed by accident even if the lid is closed. This reworks a bit of the logind logic to repeatedly try to suspend the system as long as a lid is closed. We use the new "post" event source for this, so that we don't keep things busy. This also adds some code to check the lid status on boot, so that a powered-off machine that is accidentaly powered on goes into suspend immediately. Yay! From now on I can put my Yoga safely in my backpack without fearing that it might turn itself on and drain the battery.
* logind: log which process is delaying suspend and not closing locksLennart Poettering2013-11-27
|
* logind: port logind to libsystemd-busLennart Poettering2013-11-05
|
* build-sys: discover the path to kexec during build timeZbigniew Jędrzejewski-Szmek2013-07-15
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=55248
* systemd-sleep: add support for freeze and standbyZbigniew Jędrzejewski-Szmek2013-05-06
| | | | | | | | | | | | | | | | | | | | | | | | | A new config file /etc/systemd/sleep.conf is added. It is parsed by systemd-sleep and logind. The strings written to /sys/power/disk and /sys/power/state can be configured. This allows people to use different modes of suspend on systems with broken or special hardware. Configuration is shared between systemd-sleep and logind to enable logind to answer the question "can the system be put to sleep" as correctly as possible without actually invoking the action. If the user configured systemd-sleep to only use 'freeze', but current kernel does not support it, logind will properly report that the system cannot be put to sleep. https://bugs.freedesktop.org/show_bug.cgi?id=57793 https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=7e73c5ae6e7991a6c01f6d096ff8afaef4458c36 http://lists.freedesktop.org/archives/systemd-devel/2013-February/009238.html SYSTEM_CONFIG_FILE and USER_CONFIG_FILE defines were removed since they were used in only a few places and with the addition of /etc/systemd/sleep.conf it becomes easier to just append the name of each file to the dir name.
* Report about syntax errors with metadataZbigniew Jędrzejewski-Szmek2013-04-17
| | | | | | | | | | | | | 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>
* logind: rework delay inhibition logicLennart Poettering2013-01-25
| | | | | | | | | | | | | | | | - 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.
* logind: only allow one shutdown/sleep action to be queued at the same timeLennart Poettering2013-01-24
| | | | | This should make sure that closing the lid while shutting down won't suspend the machine but will simply cause the shutdown to complete.
* logind: don't allow suspending/hibernating if the kernel doesn't support itLennart Poettering2012-12-24
|
* logind: add support for automatic suspend/hibernate/shutdown on idleLennart Poettering2012-12-24