xfce4-power-manager doesn't show in the fluxbox toolbar or work at all (even though it's running as a process) in ubuntu 12.10 unless started with strace

Bug #1074570 reported by Sabuj Pattanayek on 2012-11-03
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fluxbox
Medium
Unassigned

Bug Description

I start xfce4-power-manager from ~/.fluxbox/startup with :

xfce4-power-manager &

This would work fine in fluxbox when I was running ubuntu 12.04. It would show up in the fluxbox toolbar, and would put my laptop to sleep when I would close the lid. After I upgraded to 12.10 xfce4-power-manager no longer worked in that it seemed to be running as a process (ps aux | grep -i xfce4-power-manager showed it), but it would never show up in the toolbar in fluxbox and it wouldn't do anything if I closed the laptop lid. I even tried restarting/reloading the config in fluxbox and also re-starting xfce4-power-manager several times with :

killall xfce4-power-manager && xfce4-power-manager

and although a new process would be started (verified by looking at the before and after pid), it still wouldn't do anything. In my initial effort to strace it to see what it was trying to do on startup and to perhaps determine why it wasn't working, I noticed strangely that if I did run strace -ff with it, it would startup, show up in the fluxbox toolbar, and would send the command to suspend my laptop. I could then ctrl+c out of strace but xfce4-power-manager would keep running, which is good.

I created this wrapper (xfce4-power-manager-wrapper) around it so that I could put it into ~/.fluxbox/startup and have it startup automatically after I login :

#!/usr/bin/perl

`killall -9 xfce4-power-manager`;
if (!(fork)) {
 # child
 `strace -ff xfce4-power-manager`;
}
else {
 # parent
 sleep 5;
 `killall strace`;
}

I've seen this sort of strange behavior with completely unrelated applications under linux before, where the application doesn't show up unless started with strace. Any idea what's going on?

indium (indium) wrote :

Hi,

I had the same problem (xfce4-power-manager + fluxbox). On my macbook pro I could control the screen brightness anymore and it was not suspending anymore when I closed the lid.

By coincidence I discovered that running

xfce4-power-manager --no-daemon 2>&1 >$HOME/somefile.log &

does work. So I've put that in my $HOME/.fluxbox/startup file, logged out/in and now both brightness and suspend works.

btw: '2>&1' streams the standard error to the standard output channel and '>$HOME/somefile.log' stream those two to that particular file. You can also throw it away ('> /dev/null').

Sabuj Pattanayek (sabujp) wrote :

xfce4-power-manager --no-daemon 2>&1 > /dev/null &

does indeed work. I guess strace sort of does the same thing, but it's showing all the system calls incl stdout and stderr of the program and stdout and err of strace as well

Paul Tagliamonte (paultag) wrote :

I'll try to ack this, but it sounds like there's a race condition, and writing to stdout / stderr slows down the app just enough to fire in the correct order.

Thanks for flying fluxbox air :)

Changed in fluxbox:
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers