update-manager starts gnome-power-manager

Bug #714356 reported by Alan Porter on 2011-02-07
26
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gnome-power-manager (Ubuntu)
Low
Unassigned
update-manager (Ubuntu)
Low
Unassigned

Bug Description

Binary package hint: update-manager

When update-manager asks for my password, it also starts up gnome-power-manager.

I have my "startup applications" set so that gnome-power-manager does NOT start. I don't like the way it continuously sets my backlight intensity, over-riding what I have set it to at the moment. However, if I update my packages, gnome-power-manager starts up anyway. It seems a little odd that these two are related.

A clumsy work-around: "sudo chmod -x /usr/bin/gnome-power-manager"

Alan Porter

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: update-manager 1:0.142.22
ProcVersionSignature: Ubuntu 2.6.35-25.44-generic 2.6.35.10
Uname: Linux 2.6.35-25-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Sun Feb 6 20:35:47 2011
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
PackageArchitecture: all
ProcEnviron:
 LC_COLLATE=C
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: update-manager

Alan Porter (alan.porter) wrote :
RedSingularity (redsingularity) wrote :

Will the power manager start up if you update via apt-get?

Changed in update-manager (Ubuntu):
status: New → Incomplete
Alan Porter (alan.porter) wrote :

No, gnome power manager starts when the gksudo-like password prompt pops up. It does not happen during the apt-get download phase.

If I do 'apt-get update && apt-get dist-upgrade' from a shell, gnome power manager does not start up.

The problem does not seem to be related to the actual upgrading of packages, but in the presentation of the password prompt.

Alan

RedSingularity (redsingularity) wrote :

Well we can test that too. Try this from a terminal:

sudo update-manager

This command will allow you to run update-manager as sudo but you will not get the gksu password prompt since you will enter your password in the terminal window. See if that brings up the power manager.

Alan Porter (alan.porter) wrote :

Weird... when I ran "sudo update-manager", the power manager did start -- and it used a brightness settings from somewhere unexpected, like maybe root's profile, because the backlight came on MUCH brighter than when I do a plain "update-manager".

In both cases, the power manager started right as I pressed [install updates].

Out of curiosity, I ran "strace update-manager", and buried in the flood of output was this:
sendmsg(3, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\0\1 \0\0\0\6\0\0\0\210\0\0\0\1\1o\0\25\0\0\0/org/fre"..., 152}, {"\26\0\0\0org.gnome.PowerManager\0\0\0\0\0\0", 32}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 184

Alan

RedSingularity (redsingularity) wrote :

As i expected it is a feature attached to the update-manager. When you go to update, the update-manager uses gnome-power-manager to see if the machine is using an external power source or a battery. Case in point, you ever get the message to "plug in" the machine or "continue anyway" when checking/installing updates while running on battery power? Usually I would suggest that we mark this as a wishlist item but not in this case as the feature you are experiencing is a "safety net" to prevent a system failure due to a computer running out of battery while in the middle of installing software. Have you thought about removing the power-manager altogether since you dont use it?

Alan Porter (alan.porter) wrote :

When I ran my tests, I did notice that it had a little warning about the fact that I was running on batteries, suggesting that it might be safer to plug in.

You suggest removing the power manager. I had considered removing the gnome-power-manager package, but I was under the *mistaken* impression that it would also remove a whole list of other things because of cascading dependencies. I tried again just now, and I see that apt simply removes two packages: gnome-power-manager itself and also "ubuntu-desktop", a meta-package that brings in all of the basic GNOME stuff in a single sweep. This is to be expected, since I am removing one of its dependencies.

So now I have removed the gnome-power-manager completely with no ill effects. Thanks for the suggestion. Now I have two completely suitable work-arounds ("sudo chmod -x /usr/bin/gnome-power-manager" and "sudo apt-get remove gnome-power-manager"). Both of these solutions work for me, because I am on a single-user machine, and so it's OK for me to make my preferences global.

However, this bug report is not about "fixing my system" but about making update-manager work better. So below, I will focus on that.

After removing g-p-m completely, I ran update-manager again. I was surprised that it still gave me the "it's safer to connect the computer to AC power before updating" message. So apparently it is smart enough to figure that out even if gnome-power-manager is not running (or even installed).

So the bottom line for this particular bug is that if you have gnome-power-manager INSTALLED but it's not currently running, for whatever reason, update-manager will run it for you. Note that on a multi-user system, it might be perfectly normal for g-p-m to be installed, but started by some users and not started by others. In fact, now I am curious what would happen if a different user (say, my wife) were logged in using a different desktop environment, something besides GNOME.

So I am not sure if having update-manager start up g-p-m is what one would expect. In fact, the way that update-manager is currently reporting my own battery/AC state even after I removed the g-p-m package suggests that it might not be entirely necessary to query g-p-m at all.

Alan

RedSingularity (redsingularity) wrote :

Good find. The update-manager does seem to have its own way of determining the power status. I am going to contact the dev's on this matter and see if there is a reason U-M is trying to access G-P-M. I will get back to you regarding this issue as soon as I get a response. Marking Confirmed for now.

Changed in update-manager (Ubuntu):
status: Incomplete → Confirmed
RedSingularity (redsingularity) wrote :

The issue can be fixed in either gnome-power-manager or update-manager. Its up to the developers at this point. Added the package "gnome-power-manager".

Changed in gnome-power-manager (Ubuntu):
status: New → Confirmed
Changed in update-manager (Ubuntu):
status: Confirmed → Triaged
Changed in gnome-power-manager (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Low
Changed in update-manager (Ubuntu):
importance: Undecided → Low
Jarno Suni (jarnos) wrote :

I have both lubuntu-desktop and xubuntu-desktop installed; they use xfce4-power-manager and gnome-power-manager, respectively. If xfce4-power-manager is running, maybe update-manager could use it, instead.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers