このようにSphinxSearchサービスを開始しようとすると
/etc/init.d/sphinxsearch start
またはこれ
Sudo /etc/init.d/sphinxsearch start
次のエラーが表示されます
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
ここに権限があります
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
注:空のsphinxsearch dirがあり、sphinxsearchユーザーのアクセス許可を変更し、sphinxのPIDパスを変更しました。PIDファイルを書き込むことができるようになっていますが、/ varにあるはずです/ run
誰も問題を解決する方法を知っていますか?
デフォルトのsphinx.conf searchdにpidfile設定があります。このオプションを扱います。
のように見える
searchd
{
pid_file = /var/run/searchd.pid
}
に変更するだけです
pid_file = /var/run/sphinxsearch/searchd.pid