3

I am using a netbook as Plex Media Server.

I use wake on lan to start Ubuntu when I feel like watching a movie. Windows prevents my pc from going into hibernation when Plex is streaming a video to a client. Ubuntu does not, after say 20 minutes ubuntu goes into sleep/hibernation.

Generally my CPU is above 40% when streaming to a client. I would consider ubuntu as not being idle but obviously ubuntu is. Is there a workaround? Something that prevents ubuntu from hibernating if a process or all processes together are using more then 40% of the cpu?

Caffeine is not going to solve my problem because Plex Media Server is running as a service/daemon so I cannot set it to keep ubuntu awake if a certain process is running because it would never hibernate.

Any solution would be really helpful!

1 Answer 1

0

I had a similar problem, I needed the backup server to stay awake for a long backup before suspending to ram.

You can use Keep.Awake https://launchpad.net/keep.awake.
However it doesn't work yet with hibernate and only works with suspend to ram.

I will be updating the program to allow hibernation as well in the near future. There's still no snap or deb package because I haven't gotten around to packaging it up but you can download the program here.
Just uncompress and run the python3 program.

It works like a proper command. Type --help to see a full listing of what can be done. The examples underneath are only a few:

./keepawake.py --help

To run interactively:

./keepawake.py

To run as a background service:

nohup ./keepawake.py -r > /dev/null 2>&1 &

To run as background service and set 15 min (900 sec) as the user activity idle time before it determines that the user is idle:

nohup ./keepawake.py -u 900 -r > /dev/null 2>&1 &

To run as background service and set minimum CPU load as 13%:

nohup ./keepawake.py -c 13 -r > /dev/null 2>&1 &

To run as background service and set minimum network traffic as 5KB (5120 bytes):

nohup ./keepawake.py -s 5120 -r > /dev/null 2>&1 &

To run all three settings above (network, CPU, User idle) in the one go:
nohup ./keepawake.py -s 5120 -c 13 -u 900 -r > /dev/null 2>&1 &

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .