Package: sphinxsearch
Version: 0.9.9+2.0.1beta-1
Severity: grave
Justification: renders package unusable

Dear Maintainer,

The postinit script creates the /var/run/sphinxsearch directory and assigns
permissions, but after a reboot, /var/run is wiped.  The initd script does
not check to make sure /var/run/sphinxsearch exists.  Thus the initd script
fails to start searchd (with its pid_file set to 
/var/run/sphinxsearch/sphinx.pid).

Observed behaviour after a reboot:

------
$ service sphinxsearch start
Starting sphinxsearch: Sphinx 2.0.1-beta (r2792)
Copyright (c) 2001-2011, Andrew Aksyonoff
Copyright (c) 2008-2011, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/etc/sphinxsearch/sphinx.conf'...
WARNING: compat_sphinxql_magics=1 is deprecated; please update your application 
and config
FATAL: failed to create pid file '/var/run/sphinxsearch/searchd.pid': No such 
file or directory
------

The package works as expected before the initial reboot, but fails after
all subsequent restarts.

The issue appears to have been introduced in 0.9.9-9.  I have tested both 
0.9.9-9 and
0.9.9+2.0.1beta1 packages, and verified the issue exists in both packages.

Below is a patch, which solves the issue by creating the /var/run/sphinxsearch 
directory with the correct permissions in the init script.  I have rebuilt the
package with this patch, and verified that it corrects the issue.


diff --git a/debian/init.d b/debian/init.d
index fc60e47..42013ed 100644
--- a/debian/init.d
+++ b/debian/init.d
@@ -47,6 +47,15 @@ fi

 set -e

+# Make sure the pidfile directory exists with correct permissions
+piddir=`dirname "$PIDFILE"`
+if [ ! -d "$piddir" ]; then
+    mkdir -p "$piddir"
+    chown -R sphinxsearch "$piddir"
+    chgrp -R sphinxsearch "$piddir"
+fi
+
+
 running_pid()
 {
    # Check if a given process pid's cmdline matches a given name


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-1-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages sphinxsearch depends on:
ii  adduser           3.113           
ii  libc6             2.13-21         
ii  libexpat1         2.0.1-7         
ii  libgcc1           1:4.6.1-4       
ii  libmysqlclient16  5.1.58-1        
ii  libpq5            9.1.1-1         
ii  libstdc++6        4.6.1-4         
ii  libstemmer0d      0+svn546-2      
ii  zlib1g            1:1.2.3.4.dfsg-3

sphinxsearch recommends no packages.

sphinxsearch suggests no packages.

-- Configuration Files:
/etc/default/sphinxsearch changed [not included]

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to