[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Suspend-sedation Problem



John Hasler wrote:
> I'm trying to get suspend-sedation working on my Gateway 450SX4 with
> Jessie installed.  Suspend and Hibernate work.  I'm following the
> instructions at
> 
> https://wiki.debian.org/SystemdSuspendSedation 
> 
> When I close the lid the machine suspends properly and wakes up and runs
> the script after the timeout.  However, it does not hibernate.  It
> executes the "else" clause, exits, goes back to suspend (expected as the
> lid is closed) and then repeats, leaving this in the log each time:
> 
> Jul 30 10:11:36 gateway systemd-sleep[14022]: System resumed.
> Jul 30 10:11:36 gateway systemd[1]: Requested transaction contradicts existing jobs: File exists
> Jul 30 10:11:37 gateway sh[14029]: suspend-sedation: Woke up before alarm - normal wakeup.

FWIW I had the same problem. This "Works For Me™" in Debian Jessie:

 
 ExecStart=/usr/sbin/rtcwake --seconds $ALARM_SEC --auto --mode no
 ExecStop=/bin/sh -c '\
-if [ -z "$(cat $WAKEALARM)" ]; then \
+ALARM=$(cat $WAKEALARM); \
+NOW=$(date +%%s); \
+if [ "$NOW" -ge "$ALARM" ]; then \
   echo "suspend-sedation: Woke up - no alarm set. Hibernating..."; \
   systemctl hibernate; \
 else \

Attachment: signature.asc
Description: Digital signature


Reply to: