mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: David Fries <david@fries.net>
Cc: Michael Tokarev <mjt@tls.msk.ru>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: hibernate/suspend-to-disk: to turn power or not?
Date: Mon, 14 Jul 2008 07:43:52 +0200	[thread overview]
Message-ID: <20080714054351.GB20258@elf.ucw.cz> (raw)
In-Reply-To: <20080713232636.GA1916@spacedout.fries.net>

On Sun 2008-07-13 18:26:36, David Fries wrote:
> On Thu, Jan 31, 2008 at 03:40:30PM +0100, Pavel Machek wrote:
> > > Back to the original question and a proposed solution.
> > > 
> > > I'm looking at the uswsusp source (while the kernel compiles),
> > > and have a question here.  Is it possible to call some external
> > > application (typically a shell script) to do the final work after
> > > when the image has been written?  I mean in principle - I
> > > understand there are some limitations here, but I don't know
> > > which exactly.
> > 
> > No, you can't exec() anything. That would write mtime back to disk and
> > cause badness.
> 
> SysRq-U remounts the disks readonly.  Why not make the disks readonly
> once the kernel state is in swap, why not let any program run and give
> an error to writes?

IIRC sysrq-U does not contain all the locking that's neccessary to
make it completely safe. OTOH, it tends to work...

> I know, long dead thread, but I too would like to tell the UPS to turn
> off once the system state is resting safely in swap.  Currently my
> modified apcupsd scripts tell the UPS to turn off, then tells the
> kernel to hibernate, and hopes the kernel finishes in time.  I would
> much rather do things the other way, but `echo disk > /sys/power/disk`
> doesn't return until power is back on if everything goes well.

If you use s2disk, you can execute C code at the point you want...

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2008-07-14  5:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-30 19:18 Michael Tokarev
2008-01-30 20:12 ` Bruno Prémont
2008-01-30 21:03   ` Michael Tokarev
2008-01-30 21:11 ` Rafael J. Wysocki
2008-01-30 23:30   ` Michael Tokarev
2008-01-31 14:40     ` Pavel Machek
2008-02-01  7:17       ` Michael Tokarev
2008-02-01 11:35         ` Rafael J. Wysocki
2008-07-13 23:26       ` David Fries
2008-07-14  5:43         ` Pavel Machek [this message]
2008-01-30 21:25 ` Nigel Cunningham
2008-01-30 23:37   ` Michael Tokarev
2008-01-30 23:58     ` Nigel Cunningham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080714054351.GB20258@elf.ucw.cz \
    --to=pavel@suse.cz \
    --cc=david@fries.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjt@tls.msk.ru \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®