Starting Kibana as a RHEL service failing

Hi

I have Kibana installed and running on RHEL6 and am connecting to an ES client node on the same machine. I have created an entry in /etc/init.d/ to start Kibana as a service (including a check to ensure ES is communicating before starting) and when i am logged in and use 'sudo service kibana start' it works fine.

When the box is rebooted then the Kibana start up fails (ES succeeds) with the following error.
{"@timestamp":"2015-05-12T13:03:24.463Z","level":"fatal","message":"Service Unavailable","node_env":"production","error":{"message":"Service Unavailable","name":"Error","stack":"Error: Service Unavailable\n at respond (/opt/kibana/src/node_modules/elasticsearch/src/lib/transport.js:235:15)\n at checkRespForFailure (/opt/kibana/src/node_modules/elasticsearch/src/lib/transport.js:203:7)\n at HttpConnector. (/opt/kibana/src/node_modules/elasticsearch/src/lib/connectors/http.js:156:7)\n at IncomingMessage.bound (/opt/kibana/src/node_modules/elasticsearch/node_modules/lodash-node/modern/internals/baseBind.js:56:17)\n at IncomingMessage.emit (events.js:117:20)\n at _stream_readable.js:944:16\n at process._tickCallback (node.js:442:13)\n"}}

That looks like it cannot connect to ES for some reason.
Are you sure ES starts up?

ES was starting up ok - a colleague helped debug and it seems like the script i had to detect when it had come up was not being executed properly. This must have interfered with the Kibana start during the boot initiation, although i think the logon was also relevant as it ran ok when being manually started.