Opened 9 years ago

Last modified 20 months ago

#8177 new enhancement

ds-backup uses "sleep()", won't wake out of idle suspend.

Reported by: cjb Owned by: martin.langhoff
Priority: normal Milestone:
Component: school server Version: not specified
Keywords: Cc: gregorio
Blocked By: Blocking:
Deployments affected: Action Needed: never set
Verified: no


We should make ds-backup set a wakeup alarm for the time it chooses to perform the backup, else it won't happen in the presence of idle suspend.

Change History (14)

comment:1 Changed 9 years ago by martin.langhoff

Happy to do so. Any hints on how to do that?

ISTR asking about sleep() @1CC, but didn't get much clarity as what the appropriate code would be...

comment:2 Changed 9 years ago by cjb

  • Milestone changed from Not Triaged to Future Release

Ah, I was thinking in the 9.1 timeframe -- the main reason I'm writing this is to add it to a tracker bug of things to fix before turning on idle suspend by default.

The generic code for setting a wakeup alarm is of the form "rtcwake +20m". I think we're going to wrap this in a python library for setting and managing alarms. Is ds-backup able to use Python libraries okay?

Sorry for filing this without mentioning when/how it should be done; wanted to make sure I didn't lose track of it. :)

comment:3 Changed 9 years ago by martin.langhoff

Ah, I didn't understand initially.

Python is good - ds-backup can use it - but it decides to sleep while in bash (therefore having a lot smaller mem footprint.

If there is a tiny C proggie around that can be called from shell cheaply as well as the python libs, then we can keep a bit more memory for end users and whatever it is that they do with their laptops :-)

comment:4 Changed 9 years ago by pgf

the "rtcwake" that cjb refers to is a standalone program, so i think it's what you're looking for.

comment:5 Changed 9 years ago by kimquirk

  • Milestone changed from Future Release to 9.1.0
  • Type changed from defect to enhancement

comment:6 Changed 8 years ago by gregorio

  • Cc gregorio added

Hi Guys,

Just came across this one in a clean up of the roadmap. It looks important. Should we track it in the power work?

Definitely do not want backups to fail in an ugly way due to sleep modes coming on.


Greg S

comment:7 Changed 7 years ago by martin.langhoff

  • Milestone changed from 9.1.0 to 1.5-F11

This issue needs revisiting for the F11 builds. CJB - what's the situation w the idle wake for our F11 builds?

comment:8 follow-up: Changed 7 years ago by Quozl

testing using the following shell command:

time rtcwake --mode mem --utc --seconds 90

results by model and build:

test unitmodelbuildresult
QUOZL E C2XO-1F9 802slept for 92 seconds then woke
QUOZL A C2XO-1F11 os8slept for 92 seconds then woke
QUOZL G B2XO-1.5F11 os33slept for 93 seconds then woke
QUOZL F B2XO-1.5F11 os33slept for 91 seconds then woke

rtcwake currently looks functional.

comment:9 in reply to: ↑ 8 Changed 7 years ago by Quozl

Replying to Quozl:

Same result on os34.

comment:10 Changed 7 years ago by martin.langhoff

Once suspend/resume kinks are ironed out, what I will test here is that the /bin/sleep -> libc -> kernel internals stack does the right thing and (a) allows the machine to suspend and (b) sets an appropriate rtc wakeup.

So test plan:

  1. set all "aggressive suspend" options to On
  2. run a test shell script from Terminal.xo and VT
    #!/bin/bash -x 
    echo Starttime `date -u ` >> /tmp/testsleep
    sleep 180
    echo `date -u `
    sleep 180
    echo Endtime `date -u `

Then start the script, leave machine idle (free to suspend - verify dmesg output) and return after 7 minutes.

comment:11 Changed 7 years ago by dsd

I don't think we're expecting sleep to set a wakeup point.

And we also think that only one rtcwake point can be installed at any one time. So even if you set one to coincide with that wakeup, someone else might set another one afterwards.

I guess we have work to do here.

comment:12 Changed 7 years ago by triagebot

  • Milestone changed from 1.5-software to 1.5-software-update

changed by irc user Quozl:

comment:13 Changed 7 years ago by cjb

We aren't going to get this done for 1.5-final, so we need a workaround. (What does olpc-update-query do? Probably want to do that.)

comment:14 Changed 20 months ago by Quozl

  • Milestone 1.5-software-later deleted

Milestone 1.5-software-later deleted

Note: See TracTickets for help on using tickets.