6

When I try to start the SphinxSearch service like this

/etc/init.d/sphinxsearch start

or this

sudo /etc/init.d/sphinxsearch start

I get the following error

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

Here are the 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

Note that: there was an empty a sphinxsearch dir, I changed the permissions to the sphinxsearch user and changed the PID path in sphinx, like that it is able to write a PID file, but it's supposed to be in /var/run

Does anyone know how to solve the issue?

9
  • Try a sudo rm /var/run/sphinxsearch-searchd.pid and a sudo /etc/init.d/sphinxsearch restart
    – A.B.
    May 18, 2015 at 10:49
  • When I try to restart I get the same error as before, sphinxsearch-searchd.pid does not get created. rm: cannot remove '/var/run/sphinxsearch-searchd.pid': No such file or directory
    – RandomGuy
    May 18, 2015 at 10:50
  • Post the output of ls -ogp /var/run and ls -ogp /var/run/ – Note the difference in the end of the commands
    – A.B.
    May 18, 2015 at 10:54
  • @FrankS. take a look at this, it's may help
    – Bilal
    May 18, 2015 at 10:56
  • @FrankS. Have you noticed that OP has already tried it with sudo?
    – A.B.
    May 18, 2015 at 10:58

2 Answers 2

1

there is pidfile settings in default sphinx.conf searchd treate this option

it looks like

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

just change it to

pid_file = /var/run/sphinxsearch/searchd.pid
-1

You can only write to /var/run as a user with an effective user ID of 0 (ie as root).

You should change the ownership to the user/group under which you wish to run the process.

check this article.

3
  • Have you read this? OP tried sudo /etc/init.d/sphinxsearch start
    – A.B.
    May 18, 2015 at 11:05
  • @A.B. yes i read it, but he should change the ownership to the user/group under which he wish to run the process.
    – Bilal
    May 18, 2015 at 11:12
  • Are you suggesting that the OP change the permissions of /var/run?
    – terdon
    May 18, 2015 at 12:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .