[Nut-upsdev] suspend to ram

Arjen de Korte nut+users at de-korte.org
Wed Aug 15 10:25:57 UTC 2007


> i think i found a bug i wanted nut to suspend to ram instead of powering
> off

That would be a horrible idea. Imagine what happens when your UPS runs out
of battery, while you're still suspended to RAM. Could it be that you
actually mean to suspend-to-disk instead?

> so i made a script that runs the commands but i ran into a problem i
> changed the shutdown command in upsmon.conf to my suspend script and i
> tested with upsmon -c fsd everything worked fine system went into suspend
> and i woke it backup by pressing the power button, now here is where i
> noticed some problems first one is that upsmon shuts it self down when fsd
> is called so i thought i would just add a command in my scipt to restart
> it after it comes out of suspend  this worked but for some reason as soon
> as upsmon starts up it broadcasts a message and system goes into suspend
> again (it would just keep looping if i kept waking it) im not sure what
> causes the loop since there is no killpower flag, i think something from
> upsd is telling upsmon to powerdown but im not sure, i tried adding rm
> /tmp/killpower before upsmon is restarted but that didnt help,

This is documented in the docs/ideas.txt document, see near the bottom of
that file under 'Suspending to disk'.

> i found a quick fix by restarting the driver , upsd , then starting upsmon
> is there a better way to make it go into suspend or am i doing something
> wrong?

No, that's the way to do it. Shutting down the UPS is still tricky though.
I have yet to see a kernel that allows inserting commands just before it
sends the poweroff command, in order to shutdown the UPS. You might be
able to use the shutdown with delay feature of your UPS, but this becomes
hairy when the system fails to suspend for some reason and resumes. In
that case your need to be really quick to stop the shutdown command. All
in all we currently don't recommend this. As soon as kernels provide a
hook to insert the 'upsdrvctl shutdown' command, it is an interesting
option though.

Best regards, Arjen
-- 
Eindhoven - The Netherlands
Key fingerprint - 66 4E 03 2C 9D B5 CB 9B  7A FE 7E C1 EE 88 BC 57




More information about the Nut-upsdev mailing list