synfinatic / udp-proxy-2020

A crappy UDP router for the year 2020 and beyond
MIT License
103 stars 7 forks source link

Add --daemon flag / pid file #40

Open synfinatic opened 3 years ago

synfinatic commented 3 years ago

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.

tiehfood commented 3 years ago

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

synfinatic commented 3 years ago

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 commented 3 years ago

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

tiehfood commented 3 years ago

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 commented 3 years ago

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

tiehfood commented 3 years ago

Unfortunately I have no experience in programming with go

synfinatic commented 3 years ago

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.

tiehfood commented 3 years ago

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