I currently have an old laptop set up as a server in my home. I use it as a file server and media server. It’s already relatively energy-efficient, but I also have three USB hard drives connected to it and all in all, the laptop and drives consume about 35 watts when idle. Therefore, I found it desirable to put the laptop into standby mode when not in use.

The problem is that it should not go into standby mode if I’m streaming media from it or using any other services.

The small tool powernapd is perfectly suited for this. It allows you to link the standby mode to certain conditions. For example, that the server load must not exceed a certain threshold or no incoming SSH connection must exist.

One of my services that I host on the laptop is tt-rss, a feed aggregator that brings along a web service. Unfortunately, there’s no monitor included in the functionality of powernapd that monitors web server activity.

Therefore, I’ve written a monitor that watches the change date of a file and only puts the computer into standby mode if the file does not change.

With this monitor, I now monitor the access log of my tt-rss Apache VirtualHost and can thus read feeds without time pressure and without the laptop going into standby mode :-)