We have moved to a new Sailfish OS Forum. Please start new discussions there.
4

systemd.timer not fireing when time elapses and phone in deep sleep - use timedclient-qt5 instead [duplicate]

asked 2014-09-22 12:36:38 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2014-12-01 20:19:31 +0300

simo gravatar image

Hej,

I am facing a rather annoying issue and I don't know wether it is by design, or it is a simple bug.

I set up some timed services with systemd. When issuing the command in terminal: "systemctl start myservice.service", all works fine. Then I start and enable the timer, put down the phone and wait for the timer to elapse.

Here comes the issue: A) If the phone was active (i.e.: screen was on - even only the LPM screen), the timer fires and the service runs. B) If the phone was sleeping (i.e.: screen was off, phone was put down), the timer never fires.

I tried to put "WakeSystem=true" in the timer, but SailfishOS seems to be not understanding it, "systemctl status myservice.timer -l" reveals it.

Edit: Converted to Wiki.

timedclient-qt5 --help has the answer. ;)

Thanks, LVPVS

edit retag flag offensive reopen delete

The question has been closed for the following reason "duplicate question" by rainisto
close date 2014-09-22 17:38:31.333796

Comments

1

show your config files for your timer. I have a setvice that pings google dns every 45 seconds and it wirks fine even in deep sleep.

droll ( 2014-09-22 12:46:17 +0300 )edit

Hej,

One of the timer files is this:

[Unit]
Description=Backup Android Storage to SDCard.

[Timer]
#OnBootSec=Wait 2 minutes before start
OnBootSec=120
#OnCalendar=daily at 0200
OnCalendar=*-*-* 2:00

[Install]
WantedBy=multi-user.target

And the corresponding service file:

[Unit]
Description=Backup Android storage to SDCard.

[Service]
ExecStart=/home/nemo/.scripts/rsync.sh

Thank you!

LVPVS ( 2014-09-22 12:56:40 +0300 )edit

how are you checking the run status of your timer?

droll ( 2014-09-22 14:10:01 +0300 )edit

With these:

# systemctl status mytimer.timer -l

and

# systemctl --fail
LVPVS ( 2014-09-22 14:13:03 +0300 )edit

http://www.freedesktop.org/software/systemd/man/systemd.timer.html

try using Persistent= and AccuracySec= and see if they help.

droll ( 2014-09-22 16:17:24 +0300 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2014-09-22 17:38:00 +0300

rainisto gravatar image

dublicate of https://together.jolla.com/question/54271/timer-slows-down-when-screen-is-off/

edit flag offensive delete publish link more

Comments

I don't see how this is a duplicate. This is about systemd timers, and the other one is about qml timers. Can you use libiphb or nemokeepalive to make the systemd timer wakeup the system?

Acce ( 2014-09-22 20:41:33 +0300 )edit

Actually, I want this script to be as simple as possible. I don't want coding, or third party apps to run my scripts on time... Any thoughts?

LVPVS ( 2014-09-22 21:07:30 +0300 )edit
1

@Acce: all timers are suspended while device is suspended, qml and systemd timers are both suspended. Only way to wake up is by libiphb or nemokeepalive. So its duplicate still even if you don't like my answer.

rainisto ( 2014-09-22 21:24:51 +0300 )edit

Crap. I don't want to shoot myself in the leg. I wanted to disable some radios while I am sleeping, but turn them back on before I wake up, to conserve some power... I will move the backup to my active hours. Thanks for everyone contributing! Cheers.

LVPVS ( 2014-09-22 21:31:36 +0300 )edit

@rainisto: I never said I don't like your answer, and the minus vote is not from me. But now it's clear that the only way to wake up is by libiphb or nemokeepalive, meaning that it is not possible with systemd timers. I think that's good for clarification, I don't think it's obvious that the systemd and application level timers are alike.

Acce ( 2014-09-22 21:34:30 +0300 )edit

Question tools

Follow
5 followers

Stats

Asked: 2014-09-22 12:36:38 +0300

Seen: 1,400 times

Last updated: Sep 23 '14