Hello,
I'm writing daemon on java, can you share best practices about daemon developing? I use tmux, however want to make it correctly.
1. I don't need root privileges at all. How should I drop privileges? With
2. Main thread is in endless loop now to keep all threads alive. It's OK to service to be killed in any time. However, should I handle some signals to ensure graceful termination?
If you know some java daemons in port tree, links are welcome.
I'm writing daemon on java, can you share best practices about daemon developing? I use tmux, however want to make it correctly.
1. I don't need root privileges at all. How should I drop privileges? With
su
command in rc.d script ? Probably, I'd be scared to run anything java under root.2. Main thread is in endless loop now to keep all threads alive. It's OK to service to be killed in any time. However, should I handle some signals to ensure graceful termination?
If you know some java daemons in port tree, links are welcome.