I have a program that under normal activation listens on some port.
I don't want the program running continuously.
Is there a "quick and dirty" way to wrap the application in a shell script or similar that will monitor the appropriate port, and start the service on demand?
The simplest approach would likely lead to the connection failing since the wrapper would have to let go of the port, and then start up the application. If the client simply connects again a short time later though, it could all work.
But it would of course be even nicer if this was all completely transparent to the client.