I've written some code that should run as a server and wrapped it with Daemons as Daemons.run('myserver.rb'). When I run it as ./daemon.rb start it works but it is not informative at all, i.e. if myserver.rb throws an exception I will not even know my server did not start, Daemons will exit with exit code 0. Is there any way to tell Daemons to return a non-zero exit code if the wrapped script fails to start? Or perhaps another way for me to know if my server started successfully?
try
d=Daemons.run('myserver.rb')
exit d.applications.length > 0 ? 0 : 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With