couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Candler (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COUCHDB-302) Permissions problems under Ubuntu
Date Mon, 23 Mar 2009 13:23:51 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688285#action_12688285
] 

Brian Candler commented on COUCHDB-302:
---------------------------------------

Fix for the "1: 0: not found" errors:

--- bin/couchdb.tpl.in	(revision 757393)
+++ bin/couchdb.tpl.in	(working copy)
@@ -140,15 +140,15 @@
         exit $SCRIPT_ERROR
     fi
     message_prefix="Apache CouchDB needs a regular"
-    if `echo 2> /dev/null >> $PID_FILE; echo $?` -gt 0; then
+    if test `echo 2> /dev/null >> $PID_FILE; echo $?` -gt 0; then
         echo "$message_prefix PID file: $PID_FILE" >&2
         exit $SCRIPT_ERROR
     fi
-    if `echo 2> /dev/null >> $STDOUT_FILE; echo $?` -gt 0; then
+    if test `echo 2> /dev/null >> $STDOUT_FILE; echo $?` -gt 0; then
         echo "$message_prefix STDOUT file: $STDOUT_FILE" >&2
         exit $SCRIPT_ERROR
     fi
-    if `echo 2> /dev/null >> $STDERR_FILE; echo $?` -gt 0; then
+    if test `echo 2> /dev/null >> $STDERR_FILE; echo $?` -gt 0; then
         echo "$message_prefix STDERR file: $STDERR_FILE" >&2
         exit $SCRIPT_ERROR
     fi


I notice that the README tells you to chown the /usr/local/var/lib/couchdb and /usr/local/var/log/couchdb
directories. IMO this would be better done automatically by 'make install'.

Suggested fix for pidfile permission errors: move the pidfile into a /usr/local/var/run/couchdb/
directory with correct ownership. (This would then be a third directory which needs to be
created correctly). Or else into the log directory.

--- bin/couchdb.tpl.in	(revision 757393)
+++ bin/couchdb.tpl.in	(working copy)
@@ -27,7 +27,7 @@
 DEFAULT_INI_FILE=%localconfdir%/%defaultini%
 LOCAL_INI_FILE=%localconfdir%/%localini%
 
-PID_FILE=%localstatedir%/run/couchdb.pid
+PID_FILE=%localstatedir%/run/couchdb/couchdb.pid
 
 STDOUT_FILE=couchdb.stdout
 STDERR_FILE=couchdb.stderr


> Permissions problems under Ubuntu
> ---------------------------------
>
>                 Key: COUCHDB-302
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-302
>             Project: CouchDB
>          Issue Type: Bug
>    Affects Versions: 0.9
>         Environment: r757147
> Ubuntu Hardy
>            Reporter: Brian Candler
>
> Couchdb install scripts not setting correct permissions under Ubuntu. First I did a complete
wipe of all couchdb-related files and directories:
> $ sudo rm -rf /usr/local/var/lib/couchdb
> $ sudo rm -rf /usr/local/lib/couchdb /usr/local/share/couchdb /usr/local/var/log/couchdb
/usr/local/var/run/couchdb.pid /usr/local/etc/init.d/couchdb /usr/local/etc/logrotate.d/couchdb
/usr/local/etc/default/couchdb /usr/local/bin/couch{db,js}
> Then after a 'make install':
> $ sudo /usr/local/etc/init.d/couchdb start
>  * Starting database server couchdb                                             Apache
CouchDB needs write permission on the PID file: /usr/local/var/run/couchdb.pid
>                                                                          [fail]
> So I created the pidfile by hand:
> $ sudo touch /usr/local/var/run/couchdb.pid
> $ sudo chown couchdb:couchdb /usr/local/var/run/couchdb.pid
> $ sudo /usr/local/etc/init.d/couchdb start
>  * Starting database server couchdb                                             /usr/local/bin/couchdb:
1: 0: not found
> /usr/local/bin/couchdb: 1: 0: not found
> /usr/local/bin/couchdb: 1: 0: not found
>                                                                          [ OK ]
> Despite the "not found" errors, couchdb was running. Now:
> $ curl -X PUT http://localhost:5984/db1
> {"error":"error","reason":"eacces"}
> I found that /usr/local/var/lib/couchdb had been recreated with owner 0:0
> It seems to work OK after this:
> $ sudo chown couchdb:couchdb /usr/local/var/lib/couchdb

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message