Author: Steven Neiland

Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

Step 7: Configure CouchDB to Start Automatically

Since we dont want to have to manually start CouchDB every time we restart the machine our next task is to create a startup script. In slackware we create this script at "/etc/rc.d/rc.couchdb". Here is my startup code.

Create Startup Script

Create "/etc/rc.d/rc.couchdb" and paste in the following code.

# Start/stop/restart the CouchDB server.
case "$1" in
sudo /usr/local/etc/rc.d/couchdb start
sudo /usr/local/etc/rc.d/couchdb stop
sudo /usr/local/etc/rc.d/couchdb stop
sudo /usr/local/etc/rc.d/couchdb start
echo "Usage: $0 {start|stop|restart}"

In order to run we must set rc.couchdb as executable.

chmod 755 /etc/rc.d/rc.couchdb

Start CouchDB from the Startup Script

Open the "/etc/rc.d/rc.M" file and paste in the following.

#start couchdb
if [ -x /etc/rc.d/rc.couchdb ]; then
. /etc/rc.d/rc.couchdb start

Stop CouchDB from the Shutdown Script

Open the "/etc/rc.d/rc.6" file and paste in the following.

#stop couchdb
if [ -x /etc/rc.d/rc.couchdb ]; then
. /etc/rc.d/rc.couchdb stop
1 2 3 4

What Do You Think?

Reader Comments

Post a Comment

Comment Etiquette:

  • Please keep comments on-topic.
  • Please do not post unrelated questions or large chunks of code.
  • Please do not engage in flaming/abusive behaviour.
  • Comments that contain or appear to be advertisments, will not be published.
  • Comments that appear to be created for the purpose of linkbuilding to commercial sites will be removed.

We are all adults here so play nice.


Archives Blog Listing

Tag Listing

Learn CF In A Week


Fork me on GitHub