Other Poll to reboot?

I have a remote server behind double-NAT that I would like to reboot occasionally if it becomes unreachable. Is there a clever way to post a reboot request to a message queue on a public VPS, have the remote server poll for it, reboot when requested, and post a response afterwards?

I can hack something together with SSH and a static file, but what are some other options?
 
Maybe this ain't the help you're actually looking for, but I like unusual ideas, cause they make us reconsider, and look at a problem from another points of view.

1.) I had a somehow similar problem with my server being connected via power-LAN. Those devices may close connection when there is no traffic for a while, so I use cron to just ping the router hourly - machine stays reachable.

2.) When I understand you right the server becomes unreachable after a while, and you're looking for to reboot it remotely anyway.
Why not turn the point around?
Your server gets a little script (e.g. cronjob) to check if it's still reachable/reaches your desktop-machine, and if not, reboots itself automatically then.
 
Thanks Maturin, I need to handle that case also; if the remote server can't see the world, it will need to reboot itself (and its router).

The problem I'm trying to solve is that the remote sever opens a reverse tunnel to the VPS using autossh on boot, but the VPS eventually closes it, which leaves the remote server hanging and an open port on the VPS. I need to try out some of the ssh keepalive options on both sides, but I'm looking for fallbacks that would let me indirectly tell the remote server to reboot, open and close the reverse tunnel, and so on.

Most admin approaches assume that one can directly reach the server, but I'm trying to run these commands through an intermediary because of the double-NAT problem.
 
the remote sever opens a reverse tunnel to the VPS using autossh on boot, but the VPS eventually closes it
Isn't this simply caused by a firewall state timing out? You might want to enable "KeepAlive" (ServerAliveInterval and ServerAliveCountMax) to prevent the firewall state from timing out when the connection is idle.
 
Back
Top