DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Start a Service and Wait Until It's Up


In this case the GcpServer is a background service. If the port 5556 is listening, that means the service start successfully.

chmod 755 GcpServerCore/cmd/*.sh
cd GcpServerCore/cmd;./start.sh;cd -
while ! nc -zv localhost 5556; do sleep 5; done

This solution based on the netcat utility.

Ref: bash: how to start a service and wait until it's up.



Published

Mar 3, 2014

Last Updated

Mar 3, 2014

Category

Tech

Tags

  • Linux 158
  • netcat 3
  • Port 3
  • Shell 46

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor