0

searchd (Sphinx) run file:

#!/bin/sh
set -e

APP_PATH=/srv/application
TARGET_USER=user
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.

Eugene
  • 101
  • 1
  • 1
    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

1 Answers1

0

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.

András Korn
  • 651
  • 5
  • 15