job upstart para o sidekiq não funcionar

4

Abaixo está o script de upstart para o sidekiq. Correndo upstart

sudo service sidekiq start

Obtém o seguinte erro

sidekiq: unrecognized service

A seguir está o sidekiq.conf content

# Just a custom description for our Job
description "Sidekiq Background Worker"

# On which conditions the job should start. In this case it's very simple: On the system startup (this is basically when the system is booted)
#start on startup
start on runlevel [2345]

# On which conditions the job should stop. In this case when the system reboot (http://upstart.ubuntu.com/cookbook/#runlevels)
stop on runlevel [06]

# This are the User and User Group that will be used to run the Job. On our case it should be the user that we have set on our capistrano script for instance.
# You can check at 'config/deploy/<environment>.rb' on this line 'server <some_ip_addreess>, user: <deploy_user>'

setuid ubuntu
setgid ubuntu

# This indicate that we want to restart the Job if it crashes
respawn
respawn limit 3 30

# TERM is sent by sidekiqctl when stopping sidekiq.  Without declaring these as normal exit codes, it just respawns.
normal exit 0 TERM

script
# this script runs in /bin/sh by default
# respawn as bash so we can source in RVM
exec /bin/bash <<EOT
  # use syslog for logging
  exec &> /dev/kmsg

  # Jump into the capistrano deployment directory
  cd /home/ubuntu/myproject/

  # Start Sidekiq through RVM. Note that I'm using the standard Capistrano paths
  exec ~/.rvm/bin/rvm-shell -c 'bundle exec sidekiq -C ./config/sidekiq.yml --environment production --logfile /home/ubuntu/myproject/log/sidekiq.log'

EOT

end script

Nenhum registro é exibido em syslog .

    
por Ajeet Khan 01.02.2016 / 12:31

1 resposta

1

Você pode criar um link simbólico de seu arquivo upstart de /etc/init/sidekiq.conf para /etc/init.d/sidekiq e, em seguida, executar sudo service sidekiq start .

A melhor maneira de depurar seu script inicial é colocar o pré e o pós-bloco como mencionado aqui link .

Aqui está um link do sidekiq.conf de amostra .

Coloque o código abaixo na sua parte exec para enviar toda a saída e erros para um arquivo.

exec 2> /tmp/rc.local.log  # send stderr from this file to a log file
exec 1>&2                      # send stdout to the same log file
set -x   
    
por Ankit Kulkarni 01.02.2016 / 13:36

Tags