Sphinx/Searchd: Supervisord autorestart not working

227 views Asked by At

We are running sphinx through supervisord inside docker. We are trying to enable autorestart, but it does work. We are trying to verify this by manually killing the searchd process.

Below is the configuration

[program:sphinx]
command=searchd --pidfile --config "config/sphinx.conf"
autostart=true
autorestart=unexpected
startsecs=5
startretries=3
exitcodes=0

We also attempted other configuration

program:sphinx] 
command= rake ts:stop 
command= rake ts:configure
command= rake ts:start 
autostart=true 
exitcodes=0,2
autorestart=unexpected

Are we missing something?

Dockerfile

FROM ruby:2.3
RUN apt-get update

#Install Sphinx

RUN wget -P /tmp http://sphinxsearch.com/files/sphinx-2.3.2-beta.tar.gz

RUN mkdir /opt/sphinx_src
RUN tar -xzvf /tmp/sphinx-2.3.2-beta.tar.gz -C /opt/sphinx_src
WORKDIR /opt/sphinx_src/sphinx-2.3.2-beta
RUN ./configure  --with-pgsql  --with-mysql
RUN make
RUN make install
RUN apt-get install -q -y supervisor cron
ADD  supervisor-cron.conf /etc/supervisor/conf.d/cron.conf
RUN service supervisor stop
RUN apt-get install -y net-tools telnet
WORKDIR /opt/app
ADD start.sh /usr/local/sbin/start
RUN chmod 755 /usr/local/sbin/start
EXPOSE 9312
CMD ["/usr/local/sbin/start"]

start.sh

#!/bin/sh

export set BUNDLE_GEMFILE=Gemfile
cd /opt/app
bundle install

echo "About to perform Sphinx Start"
cp /opt/app/supervisor-sphinx.conf /etc/supervisor/conf.d/sphinx.conf
supervisord -n
0

There are 0 answers