Some time ago, my server stopped creating backups except when restarting, saying the server is always idle. Now I've finally figured out why.
I have SERVER_PUBLIC=false and PUID=something-non-root, so the idle check uses tcpdump. The problem is that only root can do tcpdump and when it fails, the script assumes that the server is idle when it's actually not:
tcpdump: eth0: You don't have permission to capture on that device
(socket: Operation not permitted)
Log gives the following, even though I am on the server at that moment and have also been on the 29th.
Sep 30 23:00:09 supervisord: valheim-backup DEBUG - [71] - Received signal to backup world
Sep 30 23:00:09 supervisord: valheim-backup DEBUG - [71] - Not running backup as there has been no server activity since Tue 28 Sep 2021 10:32:04 PM UTC
We should at least make it so that when tcpdump fails for other reasons than "no packets", it is assumed that the server is NOT idle. I'll try to look into that, but I wanted to post this issue first.
Some time ago, my server stopped creating backups except when restarting, saying the server is always idle. Now I've finally figured out why.
I have SERVER_PUBLIC=false and PUID=something-non-root, so the idle check uses
tcpdump
. The problem is that only root can dotcpdump
and when it fails, the script assumes that the server is idle when it's actually not:Log gives the following, even though I am on the server at that moment and have also been on the 29th.
We should at least make it so that when
tcpdump
fails for other reasons than "no packets", it is assumed that the server is NOT idle. I'll try to look into that, but I wanted to post this issue first.