virgo-agent-toolkit/agent-poller-noit-parity — pull request #17 by ynachiket (2014-10-08 17:37:16+00:00)
Title: Add init script

Why:

While using supervisord the noit and stratcon processes were being started pretty much simultaneously which made a curl http://noit/handoff/journals -k -v from a remote container not receive any journals.

Solution:
A bash script with a small sleep between the 2 processes.

Workaround:
The issue with using a shell script with Docker is that as soon as the script is done executing the container exits. Even running with a -d flag does not help as the entry point itself exits.
running with -t -i /bin/bash does not start the processes in the container.

So added a
CMD /bin/bash noitstratconinit.bash && tail -f /var/log/noitd.feed/00000000 and ran container with -d flag.

To test this out

docker run -i -t -P --name postgres -d nachiket/postgres
docker run --name apache_borrowed -p 80:80 -p 443:443 -d eboraas/apache
docker run -p 32322:32322 -p 43191:43191 -p 8888:8888 -p 80:80 -ti --link postgres:postgres --link apache_borrowed:apache --name noit nachiket/noit

If you are on mac
curl http://192.168.59.103/handoff/journals (make sure you boot2docker ip is actually 192.168.59.103 )

If you are on any Linux based OS
curl http://localhost/handoff/journals

Note: You will start seeing the journals in about 3 to 5 sec after the hello message.