[Pm-utils] Writing a sleep.d hook that accepts user input?

Dan Nicholson dbn.lists at gmail.com
Tue Mar 16 06:18:41 PDT 2010

On Tue, Mar 16, 2010 at 5:38 AM, Vale Cofer-Shabica
<vale.cofershabica at gmail.com> wrote:
> Hi,
> I use loop-aes to encrypt all the partitions on my machine. I would
> like to be able to unmount some directories (e.g. /home) on suspend
> and then be required to enter a password to remount on resume. Finding
> open files, syncing and unmounting isn't a problem, but resuming is.
> Is there a way to get user input into a process spawned by a hook? In
> the case that X is running, it's almost trivial since I can create an
> xterm with the command I need, but since I'm not always running X, I
> need a solution that doesn't rely on it. All I need to be able to do
> is call "#mount /home" and then enter a password at a prompt. Any
> thoughts?

It would be really tough since the hook is running as root outside the
user's session. The only really sensible way to do this would be to
wait in the user session for a dbus signal sent from a hook or from
HAL/upower on resume. But then you're in the user session and past the
time when /home would probably need to be mounted.

pm-utils isn't prepared to handle interactive sessions, but I also
don't think the resume process in general could handle it without
custom patching.


More information about the Pm-utils mailing list