Imran Haider | 12 May 2013 14:49
Picon

[PATCH] Rely on the "Resuming" signal only on a system with systemd

The notify-upower.sh script is only executed on a system with systemd. For
distributions that use logind without a full fledged systemd, this script
will not get executed and so upower would not know that it has resumed.

This change fixes an issue where the system goes to sleep only once and
does not sleep until upowerd is restarted.
---
 src/linux/up-backend.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/linux/up-backend.c b/src/linux/up-backend.c
index b9f75f5..e3c6c0a 100644
--- a/src/linux/up-backend.c
+++ b/src/linux/up-backend.c
 <at>  <at>  -614,9 +614,11  <at>  <at>  up_backend_get_hibernate_command (UpBackend *backend)
 gboolean
 up_backend_emits_resuming (UpBackend *backend)
 {
+#ifdef HAVE_SYSTEMD
 	if (LOGIND_AVAILABLE())
 		return TRUE;
 	else
+#endif
 		return FALSE;
 }
 #endif
--

-- 
1.8.2.2

(Continue reading)

Tom Gundersen | 19 Mar 2013 13:33
Picon
Gravatar

[PATCH][UPower] build: detect udev rules dir

Udev rules may live in either /lib/udev/rules.d or /usr/lib/udev/rules.d depending on the distro.
Remove the heuristic for deciding the dir, use pkgconfig to detect the location and allow it to be
set manually.
---
 configure.ac      | 12 +++++-------
 rules/Makefile.am |  1 -
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index 56db585..c03e8e8 100644
--- a/configure.ac
+++ b/configure.ac
 <at>  <at>  -82,13 +82,11  <at>  <at>  AM_CONDITIONAL(MAN_PAGES_ENABLED, test x$enable_man_pages = xyes)

 GTK_DOC_CHECK([1.11],[--flavour no-tmpl])

-# udev rules go in /lib, not /usr/lib
-if test "$prefix" = "/usr" -o "$prefix" = "/usr/local" ; then
-  slashlibdir=/lib
-else
-  slashlibdir=$prefix/lib
-fi
-AC_SUBST(slashlibdir)
+AC_ARG_WITH([udevdir],
+            AS_HELP_STRING([--with-udevrulesdir=DIR], [Directory for udev rules]),
+            [],
+            [with_udevrulesdir=$($PKG_CONFIG --variable=udevdir udev)"/rules.d"])
+AC_SUBST([udevrulesdir], [$with_udevrulesdir])

 # History/Db dir
(Continue reading)

Richard Hughes | 18 Mar 2013 17:29
Picon

UPower 0.9.20

Version 0.9.20
~~~~~~~~~~~~~~
Released: 2013-03-18

New Features:
 - Add a --enable-deprecated configure argument to remove pm-utils
support (Richard Hughes)
 - Deprecate running the powersave scripts (Richard Hughes)
 - Factor out the Logitech Unifying support to support other devices
(Richard Hughes)
 - Require applications to define UPOWER_ENABLE_DEPRECATED to use
deprecated functionality (Richard Hughes)

Bugfixes:
 - Bump maximum accepted "time to empty" to 10 days (Martin Pitt)
 - Don't use the deprecated INCLUDES in Makefile.am (Richard Hughes)
 - Fix batteries which report current energy but full charge (Alex Hornung)
 - Fix K750 features name, use 1 second interval (Julien Danjou)
 - Fix memory leak in up_polkit_get_subject (Charles Kerr)
 - Fix two memory leaks (Colin Watson)
 - integration-test: Always run on a fake system bus (Martin Pitt)
 - integration-test: Move to using umockdev (Martin Pitt)
 - Never use -WError when building (Richard Hughes)
 - Raise the hard PolicyKit dep to 0.97 (Richard Hughes)

Richard
Phillip Susi | 13 Mar 2013 04:03
Favicon

What happened to the permissions checkbox?


Some users have had problems restoring a system from backup because
they used gnome-disks-utility to format the disk, and the permissions
on the root fs were wrong.  A while back, a checkbox was added to take
ownership of the newly formatted filesystem, as this often is what
users want, but this checkbox seems to have vanished, and now there
seems to be no way avoid changing the permissions.

Richard Hughes | 5 Mar 2013 12:34
Picon

GUsb 0.1.6 released!

GUsb is a GObject wrapper for libusb1 that makes it easy to do
asynchronous control, bulk and interrupt transfers with proper
cancellation and integration into a mainloop.

Version 0.1.6
~~~~~~~~~~~~~
Released: 2013-03-05

Bugfixes:
 - Do not use deprecated GLib functionality (Richard Hughes)
 - Remove duplicate gtk-doc check in configure (David King)
 - Unref the GMainloop after it has been run, not when just quit
(Richard Hughes)

Tarballs available here: http://people.freedesktop.org/~hughsient/releases/

Richard.
Phillip Susi | 5 Mar 2013 04:57
Favicon

Smart I/O errors when there don't seem to be


My syslog is full of entries that look like this:

Mar 3 12:06:45 faldara udisksd[2630]: Error performing housekeeping
for drive
/org/freedesktop/UDisks2/drives/WDC_WD360GD_00FNA0_WD_WMAH91337618:
Error updating SMART data: sk_disk_smart_status: Input/output error
(udisks-error-quark, 0)

And opening the disks utility shows invalid smart data, and choosing
to update the smart data also reports an I/O error. Using smartctl on
the command line though says this disk is fine:

root <at> faldara:~# smartctl -a /dev/sdc
smartctl 5.43 2012-06-30 r3573 [x86_64-linux-3.8.0-7-generic] (local
build)
Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family: Western Digital Raptor
Device Model: WDC WD360GD-00FNA0
Serial Number: WD-WMAH91337618
Firmware Version: 35.06K35
User Capacity: 37,019,566,080 bytes [37.0 GB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use: -P show]
ATA Version is: 6
ATA Standard is: Exact ATA specification draft version not indicated
Local Time is: Sun Mar 3 23:25:55 2013 EST
SMART support is: Available - device has SMART capability.
(Continue reading)

Phillip Susi | 5 Mar 2013 04:50
Favicon

External media mounts


For a long time we have been mounting external media with mount
options to make sure that the current interactive user ( if there is
one? ) is the owner of the files.  It occurs to me that this has been
the wrong approach.

Take a step back and ask yourself whether external mounts really
should be associated with a particular user.  I don't think they
should.  If I have an external disk full of family photos and I plug
it in while logged in as me, then my wife comes and switches to her
user, why should she not have access to the disk?  If she wanted to,
she could simply unplug and replug the disk, and then it would be
mounted under her uid, though obviously this is undesirable.

I think the mount should be accessible to whichever session is
currently active on the seat.  I think this can be implemented using
bind mounts.  First, instead of mounting in /run/$USER/$VOL and making
the files owned by $USER, we mount in /run/media/$SEAT/$VOL, and make
the files owned by nobody, with mode 777.  /run/media would obviously
be root.root 770.  The active session would bind mount
/run/media/$SEAT/$VOL to /media/$VOL, and when switching the active
session, all mounted volumes would be bind mounted to the new session.

This way if if I plug in the disk or happen to be the first person to
log in with it cold plugged, I have access to it, and when my wife
comes by and switches active sessions, she too has access.  On the
other hand, she can't leave a rogue program running in the background
to gain access to a private disk that I plug in after switching to my
session, and unplug before leaving the computer or switching back to
her session.
(Continue reading)

Tom Gundersen | 19 Feb 2013 18:11
Picon
Gravatar

[udisks] moving shared mounts from /media to /run/media ?

Hi David,

I noticed your commit "Introduce UDISKS_FILESYSTEM_SHARED=1 to use
/media for mounting". The feature makes sense in my opinion. However,
I wonder if it would be even better to keep this in /run/media (or
possibly in a subfolder to avoid name-clashes).

With the move from udisks1 to udisks2 we ditched /media from Arch, and
it would be nice not to have to reintroduce it. Mainly to keep the
rootfs simple, but also to avoid encouraging misuse of /media, to let
udisks mantain the /run/media folder itself, and it might also make
sense to make sure that shared mounts and private mounts are mounted
on the same kind of fs.

If you are open to the idea I'll post a patch.

Cheers,

Tom
Ivan Lezhnjov Jr. | 12 Feb 2013 11:19
Picon
Gravatar

2 users simultaneous access to udisks2 mounted drive

Hello,

I have a little problem that I'm trying to solve here.

I've got a bunch of USB drives that are automounted in GNOME with udisks2, the entire experience is
automatic at this point.
It seems udisks2 (or GNOME?) mounts a drive for a specific user by creating
/run/media/$username/$DRIVELABELorUUID mount point.

Like this

/dev/sdb1 on /run/media/ilj/9d244934-d9fa-4a8e-8dd7-5c595f5518cf type ext2 (rw,nosuid,nodev,relatime,uhelper=udisks2)

However, access to this mount point is strictly limited to just one user:

root <at> sega /home/ilj % ls -lha /run/media/
total 0
drwxr-xr-x   3 root root  60 Feb 10 19:53 .
drwxr-xr-x  24 root root 940 Feb 10 18:54 ..
drwxr-x---+  3 root root  60 Feb 12 07:41 ilj
root <at> sega /home/ilj % getfacl /run/media/ilj
getfacl: Removing leading '/' from absolute path names
# file: run/media/ilj
# owner: root
# group: root
user::rwx
user:ilj:r-x
group::---
mask::r-x
other::---
(Continue reading)

Ifai Gios | 12 Feb 2013 00:13
Picon

pm-utils dependency

pm-utils is unmaintained (last release was 2.5 years ago), buggy and has no real use in a systemd world, since suspend, hibernate and powersave are handled by the kernel, systemd and power managers. Despite that, modern upower still brings it in as a dependency, as it is used in the following places in src/linux/up-backend.c (taken from here):

- up_backend_supports_sleep_state (line 371) calls /usr/bin/pm-is-supported to determine if suspend or hibernate are available on the system. upower uses this to reply to dbus call on org.freedesktop.UPower.CanSuspend or .CanHibernate. Without pm-utils, org.freedesktop.UPower.CanSuspend or .CanHibernate always return false.

This call could be replaced by a simple "grep -q mem /sys/power/state" or "grep -q disk /sys/power/state", as nowadays everyone expects the kernel to report whether the system is able to suspend to ram/disk in the above file.

- up_backend_get_powersave_command (line 627) calls /usr/sbin/pm-powersave to apply powersaving adjustments.

The default pm-powersave quirks are obsolete today, and if one still needs such functionality there are already tons of other implementations (in all of logind, acpid, laptop-mode-tools, the KDE and GNOME power managers, etc.). So this should be dropped entirely.

If these changes are made, and pm-utils is dropped at least for HAVE_SYSTEMD, then we could get rid of an useless dependency in our systems, and simplify our stack a bit more. So, what do you say?

<div><p>pm-utils is unmaintained (last release was 2.5 years ago), buggy and has no real use in a systemd world, since suspend, hibernate and powersave are handled by the kernel, systemd and power managers. Despite that, modern upower still brings it in as a dependency, as it is used in the following places in src/linux/up-backend.c (taken from <a href="https://www.mageia.org/pipermail/mageia-dev/2012-October/019472.html">here</a>):<br><br>- up_backend_supports_sleep_state (line 371) calls /usr/bin/pm-is-supported to determine if suspend or hibernate are available on the system. upower uses this to reply to dbus call on org.freedesktop.UPower.CanSuspend or .CanHibernate. Without pm-utils, org.freedesktop.UPower.CanSuspend or .CanHibernate always return false.<br><br>This call could be replaced by a simple "grep -q mem /sys/power/state" or "grep -q disk /sys/power/state", as nowadays everyone expects the kernel to report whether the system is able to suspend to ram/disk in the above file.<br><br>- up_backend_get_powersave_command (line 627) calls /usr/sbin/pm-powersave to apply powersaving adjustments.<br><br>The default pm-powersave quirks are obsolete today, and if one still needs such functionality there are already tons of other implementations (in all of logind, acpid, laptop-mode-tools, the KDE and GNOME power managers, etc.). So this should be dropped entirely.<br><br>If these changes are made, and pm-utils is dropped at least for HAVE_SYSTEMD, then we could get rid of an useless dependency in our systems, and simplify our stack a bit more. So, what do you say?<br></p></div>
mark ellis | 10 Feb 2013 10:58

Patch submission for incorrect battery %


Hello,

First off I'm sorry if this is not clear, but it's a little hard to explain!

I have a very dodgy batter in my laptop that sometimes likes to lie about how much energy it's currently containing, or what it's charge_full and charge_full_design are. It only does this briefly, for a split second or so, but it's enough to mess up upower, which will start reporting 3% charge remaining, 5 hours left on a full battery (energy-full ends up really high for no reason, e.g. instead of 48Wh, it'll be 780Wh). The way to correct this is for me to kill upowerd and restart it, which is a pain.

So I've patched the upowerd source to reread charge_full and charge_full_design each time the battery status is refreshed. I'm not sure what the implications of this are, but I imagine it's not that big of a deal, and it fixes my issue!

Anyway I thought I'd do the honourable thing and send the patch on to yourselves, just because. I hope it's useful, if not it fixes my little problem!

Thanks,
Mark
Attachment (upower.patch): application/octet-stream, 852 bytes
<div><div dir="ltr">
<div>
<div>
<div><br></div>Hello,<br>
</div>
<div><br></div>First off I'm sorry if this is not clear, but it's a little hard to explain!<br><br>I have a very dodgy batter in my laptop that sometimes likes to lie about how much energy it's currently containing, or what it's charge_full and charge_full_design are. It only does this briefly, for a split second or so, but it's enough to mess up upower, which will start reporting 3% charge remaining, 5 hours left on a full battery (energy-full ends up really high for no reason, e.g. instead of 48Wh, it'll be 780Wh). The way to correct this is for me to kill upowerd and restart it, which is a pain.<br><br>So I've patched the upowerd source to reread charge_full and charge_full_design each time the battery status is refreshed. I'm not sure what the implications of this are, but I imagine it's not that big of a deal, and it fixes my issue!<br><br>
</div>
<div>Anyway I thought I'd do the honourable thing and send the patch on to yourselves, just because. I hope it's useful, if not it fixes my little problem!<br><br>Thanks,<br>
</div>
<div>Mark<br>
</div>
</div></div>

Gmane