Skip to content
This repository has been archived by the owner on Jan 1, 2020. It is now read-only.

Debian init-script fails #723

Closed
jagardaniel opened this issue May 11, 2014 · 2 comments
Closed

Debian init-script fails #723

jagardaniel opened this issue May 11, 2014 · 2 comments

Comments

@jagardaniel
Copy link

Hello!

If you are using the init-scripts that are included in the debian sensu package and add them to start during boot (with update.rc-d), sensu-server, sensu-api and sensu-client will fail to start.

Debian GNU/Linux 7
Sensu 0.12.6-4

startup

If you check the logs, it is because rabbitmq-server and redis-server isn't started yet:

sensu-server.log

{"timestamp":"2014-05-09T23:42:06.967583+0200","level":"fatal","message":"redis connection error","error":"unable to connect to redis server"}
{"timestamp":"2014-05-09T23:42:06.967747+0200","level":"warn","message":"stopping"}
{"timestamp":"2014-05-09T23:42:06.967818+0200","level":"warn","message":"unsubscribing from keepalive and result queues"}
{"timestamp":"2014-05-09T23:42:06.967893+0200","level":"info","message":"completing handlers in progress","handlers_in_progress_count":0}
{"timestamp":"2014-05-09T23:42:06.968081+0200","level":"error","message":"[amqp] Detected TCP connection failure"}
{"timestamp":"2014-05-09T23:42:06.968154+0200","level":"fatal","message":"rabbitmq connection error","error":"failed to connect"}

sensu-client.log

{"timestamp":"2014-05-09T23:42:06.967855+0200","level":"error","message":"[amqp] Detected TCP connection failure"}
{"timestamp":"2014-05-09T23:42:06.968019+0200","level":"fatal","message":"rabbitmq connection error","error":"failed to connect"}
{"timestamp":"2014-05-09T23:42:06.968072+0200","level":"warn","message":"stopping"}
{"timestamp":"2014-05-09T23:42:06.968117+0200","level":"warn","message":"unsubscribing from client subscriptions"}
{"timestamp":"2014-05-09T23:42:06.968173+0200","level":"info","message":"completing checks in progress","checks_in_progress":[]}
{"timestamp":"2014-05-09T23:42:07.509580+0200","level":"warn","message":"stopping reactor"}

To solve this, I just added the require services that has to be running for the init-script that fails.

--- /etc/init.d/sensu-server.orig       2014-05-09 23:55:44.885033536 +0200
+++ /etc/init.d/sensu-server    2014-05-10 00:30:40.341328098 +0200
@@ -5,8 +5,8 @@

 ### BEGIN INIT INFO
 # Provides:       sensu-server
-# Required-Start: $remote_fs $network
-# Required-Stop:  $remote_fs $network
+# Required-Start: $remote_fs $network rabbitmq-server redis-server
+# Required-Stop:  $remote_fs $network rabbitmq-server redis-server
 # Default-Start:  2 3 4 5
 # Default-Stop:   0 1 6
 # Description:    Sensu monitoring framework server
--- /etc/init.d/sensu-api.orig  2014-05-09 23:55:59.065034045 +0200
+++ /etc/init.d/sensu-api       2014-05-10 00:30:53.253328561 +0200
@@ -5,8 +5,8 @@

 ### BEGIN INIT INFO
 # Provides:       sensu-api
-# Required-Start: $remote_fs $network
-# Required-Stop:  $remote_fs $network
+# Required-Start: $remote_fs $network rabbitmq-server redis-server
+# Required-Stop:  $remote_fs $network rabbitmq-server redis-server
 # Default-Start:  2 3 4 5
 # Default-Stop:   0 1 6
 # Description:    Sensu monitoring framework api
--- /etc/init.d/sensu-client.orig       2014-05-09 23:55:53.389033838 +0200
+++ /etc/init.d/sensu-client    2014-05-09 23:56:22.253034888 +0200
@@ -5,8 +5,8 @@

 ### BEGIN INIT INFO
 # Provides:       sensu-client
-# Required-Start: $remote_fs $network
-# Required-Stop:  $remote_fs $network
+# Required-Start: $remote_fs $network rabbitmq-server
+# Required-Stop:  $remote_fs $network rabbitmq-server
 # Default-Start:  2 3 4 5
 # Default-Stop:   0 1 6
 # Description:    Sensu monitoring framework client

And then let update-rc.d take care of the "boot-reorder" again:

root@monitor:/etc/init.d# update-rc.d sensu-server defaults
root@monitor:/etc/init.d# update-rc.d sensu-api defaults
root@monitor:/etc/init.d# update-rc.d sensu-client defaults

I'm not sure if this is the best solution, but it works for me. Still in the learning phase :)

/Daniel

@portertech
Copy link
Contributor

@jagardaniel Thanks for reporting the issue 👍 I've labeled this issue w/ "Wrong Repo", since it has more to do w/ sensu-build, here is a similar issue sensu/sensu-build#73

@jagardaniel
Copy link
Author

I saw that earlier this week. Sorry, didn't know that repo existed :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants