Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

searchd (Sphinx) run file:

set -e

exec chpst -u $TARGET_USER /usr/bin/searchd --pidfile --nodetach --config $APP_PATH/current/config/production.sphinx.conf 

tail /var/log/sphinx/current

2014-06-07_18:13:56.87885 precached 9 indexes in 0.497 sec
2014-06-07_18:13:57.13740 precached 9 indexes in 0.497 sec
2014-06-07_18:13:57.88113 precached 9 indexes in 0.497 sec
2014-06-07_18:13:57.89167 precached 9 indexes in 0.497 sec
2014-06-07_18:13:59.75555 precached 9 indexes in 0.497 sec
2014-06-07_18:13:59.81554 precached 9 indexes in 0.497 sec
2014-06-07_18:14:00.33466 precached 9 indexes in 0.497 sec
... it continues to write the same line until sv stop sphinx ...

Everything works fine, seachd starts and responds to the queries. But how to make logs to be less repetitive? When I start Sphinx manually it prints the "precached 9 indexes" just once.

share|improve this question
I misunderstood the question, went back and re-read it, and I think you have something else going on. When you start it by hand, is it continuously running in the background? When you start it with runit, using pstree do you see just the one searchd instance, or multiple ones? – Avery Payne Aug 20 '14 at 18:43

I'm pretty certain your problem is that searchd forks and daemonizes, which to runit looks like it exited. So runsv will keep restarting searchd, and each time it's started it will log a message.

The solution is to tell searchd to stay in the foreground by way of the --nodetach switch.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.