summaryrefslogtreecommitdiff
path: root/src/up-daemon.c
AgeCommit message (Collapse)AuthorFilesLines
2013-10-14daemon: Load level policy configurationBastien Nocera1-0/+55
2013-10-14daemon: Remove unused config file loadingBastien Nocera1-25/+0
We already have UpConfig to handle that.
2013-10-14daemon: Remove unneeded reset of priv struct membersBastien Nocera1-8/+0
It's already done by GObject.
2013-10-14daemon: Remove obsolete featuresBastien Nocera1-622/+1
2013-10-14daemon: Simplify _new() functionsBastien Nocera1-3/+1
2013-10-14daemon: Remove unused _set_propertyBastien Nocera1-14/+0
2013-02-20Revert "Add option to run daemon on the session bus for testing"Martin Pitt1-16/+1
This reverts commit eddcf0ef3d0b8445618e368328d7e110a83b69b3. We don't need the --test option any more now that we always run tests on a (fake) system D-BUS.
2013-02-12Also deprecate running the powersave scriptsRichard Hughes1-3/+9
Over the years we've moved all the quirks to the kernel (and fixed most of the issues properly) so on Fedora we've not actually been shipping any rules in pm-utils for a couple of releaes now. Dropping this functionality allows us to finally drop the pm-utils dep for upower.
2013-02-12Add a --enable-deprecated configure argumentRichard Hughes1-10/+82
This is turned off by default. If this is not set, then any calls to Suspend(), SuspendAllowed(), Hibernate() or HibernateAllowed() will fail with an error. The error mesage tells the user what new method to port to in logind. I'm expecting to set --enable-deprecated for Fedora 17 and 18, but turn it off for Fedora 19, so other distributions probably want to follow suit to find out what other stuff needs to be ported to the new APIs early. GNOME should already be fine, but KDE will need some solid porting as I understand it. See http://lists.freedesktop.org/archives/devkit-devel/2013-January/001339.html for more information on future plans and for rationale.
2012-07-11Use systemd for suspend and hibernateMatthias Clasen1-21/+40
When running under systemd, call into systemd for suspend and hibernate instead of pm-utils. To capture resume events, install a small script that gets executed by systemd after resume and sends a dbus signal back to upower. To make this work, the upower backends gain a new signal, ::resuming, that they can optionally emit to signal that a resume happened. Backends opt in to this by returning TRUE from up_backend_emits_resuming(). In this case, upower doesn't assume the sleep command to block until resume, but instead waits for the ::resuming signal from the backend. The only backend that uses this mechanism is the linux backend when built with systemd support. Signed-off-by: Richard Hughes <richard@hughsie.com>
2012-01-06Add boolean RunPowersaveCommand to UPower.confLandry Breuil1-2/+8
Defaulting to true, it controls whether we want the powersave commands to be run when running on battery/plugging ac. Signed-off-by: Richard Hughes <richard@hughsie.com>
2011-05-04Add new NotifySleep() and NotifyResume() signals that include the sleep typeRichard Hughes1-1/+30
This allows session power managers to do different actions depending on whether the user is suspending or hibernating. This allows the session policy agent to poke other things (for instance, the screensaver) even if another process initiated the sleep. This is based on a patch from Phillip Susi <psusi@cfl.rr.com>, many thanks.
2011-04-26Add option to run daemon on the session bus for testingMartin Pitt1-1/+16
Add a daemon option --test which will run upowerd on the session bus. This allows us to run tests without interfering with the system instance. This also avoids any root privileges entirely, which permits running integration tests as part of a package build.
2011-03-28Add a config option 'IgnoreLid' so users with broken / inverted lid switches ↵Richard Hughes1-0/+18
don't suspend at session start
2011-03-14Correct the DBus-glib property name for LidForceSleepRichard Hughes1-1/+1
2011-02-02Add a LidForceSleep property to ensure that we don't melt any laptopsRichard Hughes1-0/+25
We still need to add the DMI quirks, but I'm waiting for the community to supply them now.
2011-01-04Add an IsDocked binary property to the main interfaceRichard Hughes1-0/+26
2010-11-01Ensure the self check code can find UPower.confRichard Hughes1-2/+12
2010-11-01Port from EggDebug to the GLib built-in logging frameworkRichard Hughes1-28/+26
2010-08-19Fix double D-BUS return in up_daemon_*_allowedMatthias Clasen1-4/+20
Do not send a D-BUS return message any more in up_polkit_is_allowed(), since this makes it hard for callers to ensure that they return exactly one result to the D-BUS caller. Instead, just pass a GError to the caller. Update up_daemon_suspend_allowed() and up_daemon_hibernate_allowed() accordingly, to always return either a result or an error. Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2010-08-19Revert "Add missing D-Bus return in up_qos_cancel_request()"Martin Pitt1-21/+5
This reverts commit 1fc5aae71f474f82ba62c7a92be3aef05cc7ebef.
2010-08-19Add missing D-Bus return in up_qos_cancel_request()Matthias Clasen1-5/+21
Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2010-08-19Free GErrors after returning themMatthias Clasen1-0/+8
dbus_g_method_return_error() does not free or take ownership of the passed GError, we need to free it ourselves. Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com>
2010-07-07Dynamic testing for enough hibernate swapMartin Pitt1-14/+27
Checking for enough hibernation swap space at the daemon startup is not sufficient, since both active memory as well as swap space change over time. Now check whenever we receive a hibernate request or read the can-hibernate property.
2010-07-07fix typo in numerical constantMartin Pitt1-1/+1
*brown paperbag*
2010-07-07Fix UP_DAEMON_WATERLINE harderMartin Pitt1-3/+3
Commmit fc7c6e003 had a thinko, UP_DAEMON_WATERLINE specifies (active memory)/(available swap), not the other way around. So replace it with 99% instead. Also update the documentation of up_backend_get_used_swap() to explain what the returned percentage actually means.
2010-07-07Increase UP_DAEMON_SWAP_WATERLINEMartin Pitt1-1/+4
Native Linux suspend-to-disk does not use compression, and needs 2 KB of page meta information for each MB of active memory. So bump the previous waterline of 80% of active memory to 100.2%. Add an extra .05% to prevent rounding errors. This should make the prediction whether hibernate is going to work very accurate. However, it might prevent hibernate for folks who use an alternative userspace solution like uswsusp which do support compression. http://lists.freedesktop.org/archives/devkit-devel/2010-July/000867.html
2010-07-07Get the powersave command from the backend rather than hardcoding Linux ↵Richard Hughes1-13/+14
specifics
2010-06-05Port to GTestRichard Hughes1-27/+0
2010-06-05Assign names to our idle sources when using new versions of glib2Richard Hughes1-0/+12
This makes it possible to profile more accurately using systemtap
2010-05-10trivial: correct some debugging statements that made things more confusingRichard Hughes1-4/+4
2010-05-10Ensure we sent ::notify signals when UpDaemon properties changeRichard Hughes1-0/+4
2010-05-07Ensure we send ::Sleeping() if clients do not call AboutToSleep()Richard Hughes1-2/+16
2010-05-07Only emit ::Sleeping() after we've checked AboutToSleep()Richard Hughes1-4/+4
2010-04-19Provide UpDaemon with C setters rather than relying on GObject propertiesRichard Hughes1-30/+53
2010-04-14Add a config file with SleepTimeout and AllowHibernateEncryptedSwap entriesRichard Hughes1-93/+129
2010-03-29Get the suspend and hibernate commands from the backend, rather than ↵Richard Hughes1-2/+6
hardcoding Linux specifics
2010-03-29Get the swap size from the backend, rather than hardcoding Linux specificsRichard Hughes1-61/+1
2010-03-29Get the encrypted swap status from the backend, rather than hardcoding Linux ↵Richard Hughes1-108/+1
specifics
2010-03-29Get the kernel sleep capabilities from the backend, rather than hardcoding ↵Richard Hughes1-28/+2
Linux specifics
2010-02-09trivial: remove two unused variables which break the build when using strict ↵Richard Hughes1-2/+0
warnings
2010-02-09Add {Suspend,Hibernate}Allowed D-Bus methodsMartin Pitt1-0/+46
Add two D-Bus server methods to check whether the caller has the privilege to suspend or hibernate. This enables us to check for PK privileges in UpClient's can_{suspend,hibernate} properties, so that clients like gnome-session or gnome-power-manager hide the suspend/hibernate related actions if the admin or OEM disabled suspend/hibernate through a PolicyKit .pkla file. https://bugs.freedesktop.org/show_bug.cgi?id=26473
2010-02-08Add a new method and two new signals to inform userspace of the pending ↵Richard Hughes1-22/+158
suspend and the resume event Based on an idea from Matthew Garrett and Lennart Poettering
2010-02-07trivial: do not free errors that we do not allocate in the error pathsRichard Hughes1-4/+0
2010-02-07trivial: Fix up a void marshalling typeRichard Hughes1-1/+1
2010-01-26trivial: rename the new libupower 'type' to 'kind' to avoid clashing with ↵Richard Hughes1-10/+10
GObject generated names
2010-01-18Rename the PolicyKit rules from org.freedesktop.devicekit.power to ↵Richard Hughes1-2/+2
org.freedesktop.upower
2010-01-18Rename the DBus service from org.freedesktop.DeviceKit.Power to ↵Richard Hughes1-1/+1
org.freedesktop.UPower
2010-01-18trivial: switch to using the new enum names internally (no ABI or API break)Richard Hughes1-4/+4
2010-01-18trivial: DkpPolkit -> UpPolkit (no ABI or API break)Richard Hughes1-6/+6