LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-06-2017, 10:20 AM   #1
iFunction
Member
 
Registered: Nov 2015
Posts: 248

Rep: Reputation: Disabled
Starting couchdb 2.0 as a service


Hi,

I now have couchdb 2.0 set up on a headless Raspberry pi running raspbian lite and I am trying to get it to start up on boot by running it as a service using systemd. Here is what I have done so far:

raspbian jessie lite - latest release Nov 2016
Static ip - 192.168.1.10
Couchdb 2.0 installed in /usr/bin/
bind address - 192.168.1.10

starts fairly easily though takes 2 or 3 times to start but runs fine after that no problem and can easily by accessed from another computer, in a browser using Fauxton.

Setting up couchdb as a service is where the problem lies, after some research and the help from this article: https://www.jamescoyle.net/how-to/25...pt-for-couchdb
The article was good but missed off the [install] section which is required to enable or disable the service it seems, and this is not a one shot service as far as I am aware, though some clarification on that would be appreciated. Here is the system file I ended up with:
Code:
[Unit]
Description=Couchdb service
After=network.target

[Service]
Type=simple
User=couchdb
ExecStart=/usr/bin/couchdb/bin/couchdb -o /dev/stdout -e /dev/stderr
Restart=always

[Install]
WantedBy=multi-user.target
I went through the systemctl reload start and enable process and this now does appear to work to an extent, it starts and:
Code:
service couchdb status
gives the following:
Code:
● couchdb.service - Couchdb service
   Loaded: loaded (/etc/systemd/system/couchdb.service; enabled)
   Active: active (running) since Fri 2017-01-06 08:03:50 GMT; 4s ago
 Main PID: 3530 (beam.smp)
   CGroup: /system.slice/couchdb.service
           ├─3530 /usr/bin/couchdb/bin/../erts-6.2/bin/beam.smp -K true -A 16...
           └─3539 /usr/bin/couchdb/bin/../erts-6.2/bin/epmd -daemon
However, now it can't be accessed remotely in a browser, yet stop the service and start couchdb with:
Code:
sudo /usr/bin/couchdb/bin/couchdb
It starts fine, what part of the process have I missed? it feels so close yet no cigar.

UPDATE: Ok, so just rebooted again, and waited for a few minutes and it is actually running, Fauxton is accessable, however, the database that is in there is not showing up. and the url is showing the following:
Code:
192.168.1.10:5984/_utils/#login?urlback=
currently, couchdb is still running in admin party mode, so there shouldn't need to be a login should there?

Last edited by iFunction; 01-06-2017 at 10:47 AM.
 
Old 01-09-2017, 02:27 AM   #2
iFunction
Member
 
Registered: Nov 2015
Posts: 248

Original Poster
Rep: Reputation: Disabled
Hi,

Despite the overwhelming replies I received to this post, I have now solved the problem, all works not, the only change needed was in the service file, where the user should have been root and not couchdb which is the account set up for running couchdb. As couchdb was set up in /usr, it needs to be started as root the service file now looks like this:
Code:
[Unit]
Description=Couchdb service
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/bin/couchdb/bin/couchdb -o /dev/stdout -e /dev/stderr
Restart=always

[Install]
WantedBy=multi-user.target

Last edited by iFunction; 01-09-2017 at 02:48 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
starting snmpd service in088309 Fedora 7 07-01-2012 05:09 AM
starting this as a service. dkc_ace Linux - General 15 12-27-2004 09:31 PM
Won't Boot - Starting Printer Service - Starting CUPS jeansond Linux - Newbie 0 10-11-2004 06:39 PM
starting one service before the other in Rh jayakrishnan Linux - General 2 11-19-2003 12:32 AM
starting up a service Robin01 Linux - Newbie 3 08-31-2003 05:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration