Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need apache to be able to run sphinx index tool as I am building a web based interface to reindex and check various sphinx configs.

Currently I have added the following to visudo

Defaults:%apache !requiretty
Defaults:apache !requiretty
apache ALL=(sphinx) NOPASSWD: /usr/bin/indexer, /usr/bin/indexer

The command I am running is:

exec sudo -u sphinx indextool --checkconfig --config /path/to/sphinx.conf

This is being run with PHP's proc_open

array(
    'stdin' => array('pipe', 'r'),
    'stdout' => array('pipe', 'w'),
    'stderr' => array('pipe', 'w'),
)

ERROR:

sudo: no tty present and no askpass program specified
share|improve this question

1 Answer 1

up vote 2 down vote accepted

Turns out that I need to use the full path for the command

 exec sudo -u sphinx /usr/bin/indextool --checkconfig --config /path/to/sphinx.conf

Now everything works great

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.