udp-proxy-2020 icon indicating copy to clipboard operation
udp-proxy-2020 copied to clipboard

Add --daemon flag / pid file

Open synfinatic opened this issue 4 years ago • 8 comments

Would be nice if udp-proxy-2020 supported running as a daemon and writing a pid file to /var/run/udp-proxy-2020.pid or other user defined path.

synfinatic avatar Oct 19 '20 02:10 synfinatic

I successfully build your site-to-site version for the Unifiy UDM and it works very well 👍 . A daemonized version as you suggested would be a really nice feature

tiehfood avatar Dec 13 '20 13:12 tiehfood

FWIW, I have no idea how the UDM starts services on boot, but pretty much everything nowadays (upstart, systemd) don't require a "daemon" mode. If you do figure it out, i'd be curious to hear how you did it so I can document it for others.

synfinatic avatar Dec 13 '20 17:12 synfinatic

Quick note: Apparently daemonizing go apps is non-traditional because of how go works. But this library seems the most popular way of doing so: https://github.com/sevlyar/go-daemon

synfinatic avatar Dec 13 '20 18:12 synfinatic

As far as I know there's no easy way to run a persistent daemon on the UDM/UDMP besides a more or less hacky way abusing the way package installations are handled on these machines. But for my purpose it would be sufficient enough to start the daemon by hand every time the UDM/UDMP reboots.

tiehfood avatar Dec 13 '20 19:12 tiehfood

So my idea: ssh into the UDM/UDMP and start your tool as a daemon :)

tiehfood avatar Dec 13 '20 19:12 tiehfood

Unfortunately I have no experience in programming with go

tiehfood avatar Dec 13 '20 19:12 tiehfood

Sadly the UDM series is really limited right now. That said, it is just linux and so you should be able to write a startup script to do it for you.

synfinatic avatar Dec 13 '20 19:12 synfinatic

Yeah, got it running. Thanks again for the great tool :)

tiehfood avatar Dec 13 '20 21:12 tiehfood