! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Allow the user to execute commands on suspend/hibernate/resume/thaw.
Status:
RESOLVED: WONTFIX
Severity:
enhancement
Product:
Xfce4-power-manager
Component:
General

Comments

Description Victor Pablos Ceruelo 2011-08-10 16:56:17 CEST
Hi, 

I am trying to restart pdnsd (a dns cache) when I resume or thaw, because it needs to clean up its cache.

I've looking for a folder where to put some kind of script for doing that with no luck. Disabling it (and using acpi or pm-utils) is an ugly mechanism I do not like and by using xfce-power-manager I can not execute any script.

It's just an enhancement so we get the best of both worlds: a gui interface and the possibility to execute our own scripts to shutdown/restart special apps.

Thanks.

Victor.
Comment 1 Ali Abdallah editbugs 2011-09-09 11:02:36 CEST
This is more on the backend part (upower, pmutils), i can't add these low level options to xfpm.
Comment 2 Victor Pablos Ceruelo 2011-09-11 14:48:00 CEST
I think you are right. Acpi uses CheckPolicy()
to see if a power manager is running:

-------------------------------------------------------------------------
# The (not very aptly named) function CheckPolicy checks if the current X
# console user is running a power management daemon that handles suspend/resume
# requests. This is used in various places to determine if we need to handle
# something ourselves or if we need to pass the info on to a power management
# daemon (e.g. through a fake key press).

CheckPolicy() {
        local PMS

        getXconsole
        PMS="/usr/bin/gnome-power-manager /usr/bin/kpowersave /usr/bin/xfce4-power-manager"
        PMS="$PMS /usr/bin/guidance-power-manager /usr/lib/dalston/dalston-power-applet"
        if pidof -x $PMS > /dev/null ||
           (test "$XUSER" != "" && pidof dcopserver > /dev/null && test -x /usr/bin/dcop && /usr/bin/dcop --user $XUSER kded kded loadedModules | grep -q klaptopdaemon) ||
           PowerDevilRunning ; then
                echo 0;
        else
                echo 1;
        fi
}
-------------------------------------------------------------------------

And then it decides to do nothing and let the power-manager do it.
 
I wanted to ask how the xfce4 power manager decides to use a backend
(which command line it executes, how it works when it receives a msg 
telling him, for example, that power button is pressed).

Do you think I could change this command by an script doing what I need?

Thanks.

Bug #7878

Reported by:
Victor Pablos Ceruelo
Reported on: 2011-08-10
Last modified on: 2011-09-11

People

Assignee:
Ali Abdallah
CC List:
1 user

Version

Attachments

Additional information