On Wed, 25 Feb 2015 13:51:59 +0000, carlo von lynX wrote: ...
What is useful here is if I can use existing $app with existing tor router and just have a shell script drop the glue instructions into the tor unix socket.
One way to do that would be to tie the hidden service to the existence of the PID of your app - just exec the app in the script after setting up the HS. (I seem to remember that being an option in some form already.)
Alternatively tor could check whether the listener the HS is accessing is still open, and discard the HS when that is no longer the case. (Possibly new idea.)
(And hopefully your application isn't giving extended authority to clients connecting from 127.0.0.1.)
Andreas