systemd-ngrok icon indicating copy to clipboard operation
systemd-ngrok copied to clipboard

Service gone after network error

Open magnuswikhog opened this issue 4 years ago • 3 comments

I installed ngrok and got it working on a Raspberry Pi using this library, but unfortunately it seems that if the network connection goes down for a few hours and then comes back, ngrok will not reconnect. If I run service --status-all I don't see the ngrok service.

magnuswikhog avatar Jan 10 '20 20:01 magnuswikhog

I think this issue is about ngrok.service file setting.

After looking at the After=network.target setting on [Unit] block, it has been consider using the network-online.target instead.

These are different and some descriptions are as follows:

On current systems, ordering after network.target just guarantees that the network service has been started, not that there's some actual configuration. You need to order after network-online.target and pull it in to achieve that.

Some useful references are as follows:

  • https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
  • https://www.freedesktop.org/software/systemd/man/systemd.special.html#network-online.target

peter279k avatar Apr 29 '20 17:04 peter279k

@magnuswikhog @peter279k Curious, is this still an issue, and has it been verified that using network-online.target instead of network.target fixes it?

suan avatar Feb 15 '21 17:02 suan

Yes. You can refer my posts I provide :).

I use the network-online for my Ngrok with systemd and it's worked when having the network error.

peter279k avatar Feb 16 '21 05:02 peter279k