You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Mark Hahn <ma...@hahnca.com> on 2011/12/24 09:13:11 UTC

starting couch on linux boot from build-couchdb

I have a stand-alone build-couchdb installation.  I can start couch
manually with

    . /root/build-couchdb/build/env.sh
    /root/build-couchdb/build/bin/couchdb -b

However, I can't get this to work from an init script at boot.  I'm
specifically putting the command in /etc/rc.local in my ubuntu lucid
server.  After booting a ps shows no couch process running.

I am directing the rc.local script's stdout to an output log and I see
"Apache CouchDB has started, time to relax." after the statements shown
above.  However, when I sleep for a while and then do

    /root/build-couchdb/build/bin/couchdb -s

I get nothing but a blank output.

Can someone who knows couch and linux better than I please give me a hint
on what to do?

Re: starting couch on linux boot from build-couchdb

Posted by Mark Hahn <ma...@hahnca.com>.
Thanks for the help.  This worked in my init script ...

    /root/build-couchdb/build/etc/init.d/couchdb start
I didn't know about the init.d/couchdb file.  I didn't find it in my
googling.  I guess I should have browsed through the whole build
directory tree.

I'm still not able to find my log file anywhere on my disk.  The
configuration page in futon agrees with what I put in my local.ini
file.

    log
    ---
    file                 /mnt/db/couch.log
    include_sasl   false
    level               debug

This is what I get from your _log suggestion at boot and even when
starting it manually ...

     curl http://root:tbgcomps2@localhost:5984/_log
    {"error":"badmatch","reason":"{error,enoent}"}

Could this be a permission problem?  I set up everything as root and
the couch config says to run couch as root, which it does.  How else
could permission fail for something as simple as writing a log?

Re: starting couch on linux boot from build-couchdb

Posted by Mark Hahn <ma...@hahnca.com>.
Thank you very much for your trouble.  I will go through these one by one.

On Sat, Dec 24, 2011 at 11:00 AM, Marcello Nuccio <marcello.nuccio@gmail.com
> wrote:

> I have only a few sparse thoughts:
>
> - you can get latest log lines at http://localhost:5984/_log
>
> - have a look at /root/build-couchdb/build/etc/init.d/couchdb or
> consider using upstart (I have posted here a sample startup script a
> few days ago)
>
> - first check if default configuration works fine, then change one
> configuration option and check again. Iterate until the problem shows
> up.
>
> - being root is not enough to avoid permission problems.
>
> HTH,
>  Marcello
>
> 2011/12/24 Mark Hahn <ma...@hahnca.com>:
> >> Have you looked into
> /root/build-couchdb/build/var/log/couchdb/couch.log ?
> >
> > Thanks for pointing that out. That file only has old info in it since I
> > changed /root/build-couchdb/build/etc/couchdb/local.ini to the settings
> > shown here.
> >
> > ---------------  local.ini --------------
> > [couchdb]
> > database_dir    = /mnt/db/couch_dbs
> > view_index_dir  = /mnt/db/couch_views
> > uri_file             = /mnt/db/couch.uri
> >
> > [httpd]
> > bind_address = 0.0.0.0
> >
> > [couch_httpd_auth]
> > secret = xxxxxxxxxxxxxxxxxxxxxx
> > require_valid_user = true
> >
> > [log]
> > level = debug
> > include_sasl = false
> > file = /mnt/db/couch.log
> >
> > [admins]
> > root = -xxxxxxxxxxxxxxxxxxxxxxxxxx
> >
> > [uuids]
> > algorithm = utc_random
> >
> >
> > After booting, /mnt/db/ is there, but the log file is missing.  It isn't
> > being created.  There is no permission issue since everything is running
> as
> > root.
> >
> > I just now discovered that when I run couchdb manually, futon works fine
> > but I'm still not getting a log file created.
> >
> > Is it possible this log problem is the root of the big problem?  Can I
> > debug to find out where the log is ending up?  I did a find / -name
> > *couchdb.log and only the one old location showed up.  Can couch run
> > without a log file?
> >
> > I looked at the db configuration using futon and it matched my local.ini
> > file.
> >
> > Have I given any new hints to the problem?  I need more help.
>

Re: starting couch on linux boot from build-couchdb

Posted by Marcello Nuccio <ma...@gmail.com>.
I have only a few sparse thoughts:

- you can get latest log lines at http://localhost:5984/_log

- have a look at /root/build-couchdb/build/etc/init.d/couchdb or
consider using upstart (I have posted here a sample startup script a
few days ago)

- first check if default configuration works fine, then change one
configuration option and check again. Iterate until the problem shows
up.

- being root is not enough to avoid permission problems.

HTH,
 Marcello

2011/12/24 Mark Hahn <ma...@hahnca.com>:
>> Have you looked into /root/build-couchdb/build/var/log/couchdb/couch.log ?
>
> Thanks for pointing that out. That file only has old info in it since I
> changed /root/build-couchdb/build/etc/couchdb/local.ini to the settings
> shown here.
>
> ---------------  local.ini --------------
> [couchdb]
> database_dir    = /mnt/db/couch_dbs
> view_index_dir  = /mnt/db/couch_views
> uri_file             = /mnt/db/couch.uri
>
> [httpd]
> bind_address = 0.0.0.0
>
> [couch_httpd_auth]
> secret = xxxxxxxxxxxxxxxxxxxxxx
> require_valid_user = true
>
> [log]
> level = debug
> include_sasl = false
> file = /mnt/db/couch.log
>
> [admins]
> root = -xxxxxxxxxxxxxxxxxxxxxxxxxx
>
> [uuids]
> algorithm = utc_random
>
>
> After booting, /mnt/db/ is there, but the log file is missing.  It isn't
> being created.  There is no permission issue since everything is running as
> root.
>
> I just now discovered that when I run couchdb manually, futon works fine
> but I'm still not getting a log file created.
>
> Is it possible this log problem is the root of the big problem?  Can I
> debug to find out where the log is ending up?  I did a find / -name
> *couchdb.log and only the one old location showed up.  Can couch run
> without a log file?
>
> I looked at the db configuration using futon and it matched my local.ini
> file.
>
> Have I given any new hints to the problem?  I need more help.

Re: starting couch on linux boot from build-couchdb

Posted by Mark Hahn <ma...@hahnca.com>.
> Have you looked into /root/build-couchdb/build/var/log/couchdb/couch.log ?

Thanks for pointing that out. That file only has old info in it since I
changed /root/build-couchdb/build/etc/couchdb/local.ini to the settings
shown here.

---------------  local.ini --------------
[couchdb]
database_dir    = /mnt/db/couch_dbs
view_index_dir  = /mnt/db/couch_views
uri_file             = /mnt/db/couch.uri

[httpd]
bind_address = 0.0.0.0

[couch_httpd_auth]
secret = xxxxxxxxxxxxxxxxxxxxxx
require_valid_user = true

[log]
level = debug
include_sasl = false
file = /mnt/db/couch.log

[admins]
root = -xxxxxxxxxxxxxxxxxxxxxxxxxx

[uuids]
algorithm = utc_random


After booting, /mnt/db/ is there, but the log file is missing.  It isn't
being created.  There is no permission issue since everything is running as
root.

I just now discovered that when I run couchdb manually, futon works fine
but I'm still not getting a log file created.

Is it possible this log problem is the root of the big problem?  Can I
debug to find out where the log is ending up?  I did a find / -name
*couchdb.log and only the one old location showed up.  Can couch run
without a log file?

I looked at the db configuration using futon and it matched my local.ini
file.

Have I given any new hints to the problem?  I need more help.

Re: starting couch on linux boot from build-couchdb

Posted by Marcello Nuccio <ma...@gmail.com>.
Have you looked into /root/build-couchdb/build/var/log/couchdb/couch.log ?

Marcello

2011/12/24 Mark Hahn <ma...@hahnca.com>:
> I have a stand-alone build-couchdb installation.  I can start couch
> manually with
>
>    . /root/build-couchdb/build/env.sh
>    /root/build-couchdb/build/bin/couchdb -b
>
> However, I can't get this to work from an init script at boot.  I'm
> specifically putting the command in /etc/rc.local in my ubuntu lucid
> server.  After booting a ps shows no couch process running.
>
> I am directing the rc.local script's stdout to an output log and I see
> "Apache CouchDB has started, time to relax." after the statements shown
> above.  However, when I sleep for a while and then do
>
>    /root/build-couchdb/build/bin/couchdb -s
>
> I get nothing but a blank output.
>
> Can someone who knows couch and linux better than I please give me a hint
> on what to do?