Posted By

noah on 10/03/10


http network port debugging ci tools sniff sysadmin cron nmap nc netcat Hudson ops infrastructure

Versions (?)

verify a service is up and running with netcat and Hudson

 / Published in: Bash

Use the -z option to netcat so you don\\\\'t have to bother with piping input into the port once opened. All you want to know is if the service is up!\r\n\r\nThen, if you are running this checker inside of Hudson, you need to set the BUILDID env var to something abitrary like BUILDID=dontKill\r\n\r\nKludgy, but it works

  1. # attempt to start apache only if it's not already running on port 80
  3. nc -vz localhost 80 || apachectl start
  6. # for hudson
  8. BUILD_ID=allow_to_run_as_daemon nc -vz localhost 80 || apachectl start

Report this snippet  

You need to login to post a comment.