0

I am trying to use upstart to keep a service running: rabbitmq-server.

I have written an upstart configuration file in /etc/init/rabbitmq.conf

  1
  2 start on runlevel [2345]
  3 stop on runlevel [016]
  4
  5 respawn
  6 exec /etc/init.d/rabbitmq-server start

The problem is that this script thinks that rabbitmq-server has crashed right after it runs and it continues to try and restart it until upstart determines it has restarted too many times and ultimatly exits:

Aug 29 19:01:47 WORKER1 kernel: [ 1334.301258] init: rabbitmq main process ended, respawning
Aug 29 19:01:48 WORKER1 kernel: [ 1334.740770] init: rabbitmq main process ended, respawning
Aug 29 19:01:48 WORKER1 kernel: [ 1335.227660] init: rabbitmq main process ended, respawning
Aug 29 19:01:49 WORKER1 kernel: [ 1335.721948] init: rabbitmq respawning too fast, stopped

How can I write an upstart script to keep a service running?

2
  • Fix whatever is causing it to crash. Aug 30, 2016 at 0:02
  • It's not crashing I just want to have a safeguard in case it does
    – John Foley
    Aug 30, 2016 at 0:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.