On 23 May 2011, at 17:47, till wrote:

> I think su -c foo etc. is fundamentally wrong.

Why?

> In the end, it's why there's start-stop-daemon.

This is one solution to the problem of starting and stopping daemons. There are 
many solutions. We have one already. One that has been working for a number of 
years. The system infrastructure has been one of the most stable parts of 
CouchDB since it was originally added.

> foo:~# su couchdb -c /usr/local/bin/couchdb -b -o /dev/null -e /dev/null -r 5

In the script, we have:

su $COUCHDB_USER -c "$command" 

So your example will fail because it is not quoted.

> foo:~# su couchdb -c "/usr/local/bin/couchdb -b -o /dev/null -e /dev/null -r 
> 5"
> foo:~# echo $?
> 127

So there's an error starting CouchDB. What is it?

Try this instead, and report back what you see:

su couchdb -c "/usr/local/bin/couchdb -b -o couchdb.out -e couchdb.err -r 5"
echo $?
cat couchdb.out
cat couchdb.err


Reply via email to