A server needs to provide several huge (consuming lots of RAM) tcp-based services. What I want to achieve is, that they are started on-demand (lazy), and stopped after either the connection is closed or runs into a timeout. The different services are identified by their ports. If there is another connection and the server is already running, it should be directly forwarded without spawning another instance.

I know that I can lazily start services using (x)inetd. But it seems there is no way to detect a timeout or shutdown the service if the connection is closed, right?

Do you have any hint how such a service startup behavior could be realized using Debian Jessie?

  • You need to explain how the TCP-based services actually work. Because whether the particular service even looks for inherited open file descriptors for sockets in the first place, and what (if so) it expects the open file descriptors to be (listening socket or accepted socket), constrains what one can do. – JdeBP Mar 22 '15 at 16:27
  • @JdeBP there are two different types of services that should be handled that way, both are realized as docker images, and starting them means to run a container based on them. One image is a tightvnc server running on an Ubuntu-based image, and the other one is a JBoss AS 7. How can I find out how those services work in order to answer your question? – muffel Mar 22 '15 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.