Re: [Hampshire] Intercepting shutdown

Top Page

Reply to this message
Author: Adrian Bridgett
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Intercepting shutdown
On Sat, Oct 17, 2009 at 11:56:43 +0100 (+0100), Leo wrote:
> Does anyone know if there's a way to intercept, or hook into, gnome's
> shutdown procedure?
> Basically, my computer has a tv card and occasionally I forget it's
> recording the tv and shutdown. So what I'd like is to get gnome to call
> some script of mine to run some checks and tell me not to shutdown.
> Failing that is there a way I can do this with run-levels?


I don't know of a nice elegant way, I suspect you'll need to have a
program registed with the gnome-session somehow so that instead of it
saay "do you want to save?" it can cancel the shutdown.

As long as the recording isn't within the next few mins you could set
the computer to wake up 5-15mins beforehand. I thought I'd tried this
(unsuccessfully) by poking /proc/acpi/... but can't see how ATM.
"nvram-wakeup" package might be handy.

Adrian
--
bitcube.co.uk - Linux infrastructure consultancy
Puppet, Debian, Red Hat, Ubuntu, CentOS, ...