Permissão negada (falha ao criar pid) ao iniciar o SphinxSearch

5

Quando tento iniciar o serviço SphinxSearch como este

/etc/init.d/sphinxsearch start

ou isto

sudo /etc/init.d/sphinxsearch start

Eu recebo o seguinte erro

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

Aqui estão as permissões

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

Observe que:              havia um diretório vazio sphinxsearch, eu mudei as permissões para o usuário sphinxsearch e mudei o caminho PID na sphinx, assim ele é capaz de escrever um arquivo PID, mas ele deveria estar em / var / run

Alguém sabe como resolver o problema?

    
por Frank S. 18.05.2015 / 12:42

2 respostas

1

há configurações de pidfile no padrão sphinx.conf searchd treate esta opção

parece

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

apenas mude para

pid_file = /var/run/sphinxsearch/searchd.pid
    
por Aleksey Stolyarov 26.10.2017 / 08:15
-1

Você só pode escrever para / var / run como um usuário com um ID de usuário efetivo de 0 (ou seja, como root).

Você deve alterar a propriedade para o usuário / grupo sob o qual deseja executar o processo.

verifique este artigo .

    
por Bilal 18.05.2015 / 13:03