web-dev-qa-db-fra.com

Autorisation refusée (échec de la création du pid) au démarrage de SphinxSearch

Quand j'essaie de démarrer le service SphinxSearch comme ceci

/etc/init.d/sphinxsearch start

ou ca

Sudo /etc/init.d/sphinxsearch start

Je reçois l'erreur suivante

Starting sphinxsearch: Sphinx 2.0.4-id64-release (r3135)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/etc/sphinxsearch/sphinx.conf'...
FATAL: failed to create pid file '/var/run/sphinxsearch-searchd.pid': Permission denied

Voici les permissions

ls -ogp /var/run
lrwxrwxrwx 1 4 Apr 17  2014 /var/run -> /run/

ls -ogp /var/run/
total 52
-rw-r--r-- 1    4 May 12 05:13 acpid.pid
srw-rw-rw- 1    0 May 12 05:13 acpid.socket
drwxr-xr-x 2   60 May 18 04:27 Apache2/
-rw-r--r-- 1    4 May 12 05:13 atd.pid
drwxr-xr-x 2   80 May 12 05:13 cloud-init/
-rw-r--r-- 1    4 May 12 05:13 crond.pid
---------- 1    0 May 12 05:13 crond.reboot
drwxr-xr-x 2   80 May 12 05:13 dbus/
drwxr-xr-x 2   40 May 12 05:13 initramfs/
drwxrwxrwt 3   60 May 12 10:22 lock/
-rw-r--r-- 1    5 May 12 10:23 memcached.pid
-rw-r--r-- 1    0 May 12 06:47 mlocate.daily.lock
-rw-r--r-- 1    6 May 12 10:22 monit.pid
-rw-r--r-- 1  577 May 18 03:30 motd.dynamic
drwxr-xr-x 2   60 May 12 05:13 mount/
drwxr-xr-x 2   80 May 12 06:35 mysqld/
drwxr-xr-x 3  160 May 12 05:13 network/
-rw-r--r-- 1    0 May 12 05:13 network-interface-security
-rw-r--r-- 1    5 May 12 10:22 ntpd.pid
drwxr-xr-x 2   40 May 12 05:13 plymouth/
drwxr-xr-x 2   40 May 12 05:13 pppconfig/
drwxr-xr-x 3  100 May 12 05:13 resolvconf/
-rw-r--r-- 1    4 May 12 05:13 rsyslogd.pid
drwxrwxr-x 2   40 May 12 05:13 screen/
drwxr-sr-x 5  100 May 12 10:16 sendmail/
drwxr-xr-x 2   40 May 12 05:13 sendsigs.omit.d/
drwxrwxrwt 2   40 May 12 05:13 shm/
drwxr-xr-x 2   40 May 12 07:27 sphinxsearch/
drwxr-xr-x 2   40 May 12 05:13 sshd/
-rw-r--r-- 1    4 May 12 05:13 sshd.pid
drwxr-xr-x 5  100 May 12 05:13 systemd/
drwxr-xr-x 6  160 May 12 05:13 udev/
-rw-r--r-- 1    4 May 12 05:13 upstart-file-bridge.pid
-rw-r--r-- 1    4 May 12 05:13 upstart-socket-bridge.pid
-rw-r--r-- 1    4 May 12 05:13 upstart-udev-bridge.pid
drwxr-xr-x 3   60 May 12 05:13 user/
-rw-rw-r-- 1 3456 May 18 03:30 utmp

ls -la /var/run/
total 56
drwxr-xr-x 22 root         root          780 May 18 03:30 .
drwxr-xr-x 22 root         root         4096 May 12 05:13 ..
-rw-r--r--  1 root         root            4 May 12 05:13 acpid.pid
srw-rw-rw-  1 root         root            0 May 12 05:13 acpid.socket
drwxr-xr-x  2 root         root           60 May 18 04:27 Apache2
-rw-r--r--  1 root         root            4 May 12 05:13 atd.pid
drwxr-xr-x  2 root         root           80 May 12 05:13 cloud-init
-rw-r--r--  1 root         root            4 May 12 05:13 crond.pid
----------  1 root         root            0 May 12 05:13 crond.reboot
drwxr-xr-x  2 messagebus   messagebus     80 May 12 05:13 dbus
drwxr-xr-x  2 root         root           40 May 12 05:13 initramfs
drwxrwxrwt  3 root         root           60 May 12 10:22 lock
-rw-r--r--  1 root         root            5 May 12 10:23 memcached.pid
-rw-r--r--  1 root         root            0 May 12 06:47 mlocate.daily.lock
-rw-r--r--  1 root         root            6 May 12 10:22 monit.pid
-rw-r--r--  1 root         root          577 May 18 03:30 motd.dynamic
drwxr-xr-x  2 root         root           60 May 12 05:13 mount
drwxr-xr-x  2 mysql        root           80 May 12 06:35 mysqld
drwxr-xr-x  3 root         root          160 May 12 05:13 network
-rw-r--r--  1 root         root            0 May 12 05:13 network-interface-security
-rw-r--r--  1 root         root            5 May 12 10:22 ntpd.pid
drwxr-xr-x  2 root         root           40 May 12 05:13 plymouth
drwxr-xr-x  2 root         root           40 May 12 05:13 pppconfig
drwxr-xr-x  3 root         root          100 May 12 05:13 resolvconf
-rw-r--r--  1 root         root            4 May 12 05:13 rsyslogd.pid
drwxrwxr-x  2 root         utmp           40 May 12 05:13 screen
drwxr-sr-x  5 root         smmta         100 May 12 10:16 sendmail
drwxr-xr-x  2 root         root           40 May 12 05:13 sendsigs.omit.d
drwxrwxrwt  2 root         root           40 May 12 05:13 shm
drwxr-xr-x  2 sphinxsearch sphinxsearch   60 May 18 07:12 sphinxsearch
drwxr-xr-x  2 root         root           40 May 12 05:13 sshd
-rw-r--r--  1 root         root            4 May 12 05:13 sshd.pid
drwxr-xr-x  5 root         root          100 May 12 05:13 systemd
drwxr-xr-x  6 root         root          160 May 12 05:13 udev
-rw-r--r--  1 root         root            4 May 12 05:13 upstart-file-bridge.pid
-rw-r--r--  1 root         root            4 May 12 05:13 upstart-socket-bridge.pid
-rw-r--r--  1 root         root            4 May 12 05:13 upstart-udev-bridge.pid
drwxr-xr-x  3 root         root           60 May 12 05:13 user
-rw-rw-r--  1 root         utmp         3456 May 18 03:30 utmp

Remarque: il y avait un répertoire sphinxsearch vide, j’ai modifié les autorisations de l’utilisateur sphinxsearch et le chemin du PID dans sphinx, de sorte qu’il est possible d’écrire un fichier PID, mais il est supposé se trouver dans/var/run

Est-ce que quelqu'un sait comment résoudre le problème?

5
Frank S.

sphinx.conf contient les paramètres de pidfile par défaut.

on dirait

searchd                                                                                                                                                                                  
{    
pid_file = /var/run/searchd.pid
}

il suffit de changer pour

pid_file = /var/run/sphinxsearch/searchd.pid
1
Aleksey Stolyarov