Script error - see log below

Asked by Peter Eliopoulos

2020-06-13T23:34:45.054717 [Detail] Interval Loop End

2020-06-13T23:34:45.054726 [Detail] ---------------------------------------------------------
2020-06-13T23:34:45.054733 [Detail] Interval Loop Started
2020-06-13T23:34:45.055046 [Detail] Starting nap for 20 seconds...
2020-06-13T23:35:05.127300 [Detail] CPU load for interval: 0.17%
2020-06-13T23:35:05.127346 [Detail] Highest speed selected: 860.9 bytes/second
2020-06-13T23:35:05.136393 [Info] ERROR: Failed to determine desktop idle time using 'dbus'!
2020-06-13T23:35:05.136418 [Info] WARNING: Continuing with network traffic and CPU load only for resiliency...
2020-06-13T23:35:05.136473 [Info] FORCE SUSPEND: Counting-down to FORCED suspend...0.6999999999999993
2020-06-13T23:35:05.136485 [Info] FORCE SUSPEND: Force Suspending...
2020-06-13T23:35:05.161131 [Info] FORCE SUSPEND: Unexpected error! Command: 'systemctl suspend' failed.
2020-06-13T23:35:05.161156 [Info] FORCE SUSPEND: Attempting alternative command: 'dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend'...
2020-06-13T23:35:05.165143 [Info] FORCE SUSPEND: Backup alternative command: 'dbus-send --print-reply --system --dest=org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower.Suspend' failed as well!
2020-06-13T23:35:05.165176 [Info] FORCE SUSPEND: Keep.Awake exiting in ERROR state...

Question information

Language:
English Edit question
Status:
Solved
For:
Keep.Awake Edit question
Assignee:
DanglingPointer Edit question
Solved by:
Peter Eliopoulos
Solved:
Last query:
Last reply:
Revision history for this message
Peter Eliopoulos (peliopoulos) said :
#1

Figured it out. I created a service in the /etc/systemd/user folder for this, when I should have used a User service and put it in ~/.config/systemd/user folder.

Here is my command to make this work from start to finish from a regular command prompt in Ubuntu 20.04. Copy and paste the whole thing (everything between the "----" marks) in one go - it will install Keep.Awake in a folder in the Home folder, create other needed folders, create a .service file, create a script file (easier to find and tweak) and install the service file to run at startup :

----

sudo apt install -y brz libxss-dev libx11-dev libffi-dev python3-pip python3-netifaces python3-psutil python3-distro xz-utils && brz branch lp:keep.awake && mkdir -p /home/$USER/.config/systemd/user && bash -c "cat > /home/$USER/.config/systemd/user/keep.awake.service" <<'EOF1' && bash -c "cat > /home/$USER/.config/keep.awake.sh" <<'EOF2' && chmod +x /home/$USER/keep.awake/keep.awake.sh && systemctl --user enable keep.awake && systemctl --user start keep.awake
[Unit]
[Service]
ExecStart=/home/$USER/keep.awake/keep.awake.sh
[Install]
WantedBy=default.target
EOF1
#!/bin/bash
/home/$USER/keep.awake/v4/keepawake.py -s 100000 -l /home/$USER/keep.awake/ -v Detail -r
EOF2

----

Revision history for this message
DanglingPointer (ferncasado) said :
#2

Yes that makes sense since I designed this to work under a user, with a desktop, in user-space.

Good stuff you got it working with systemD!