Published:
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
'start')
sudo /usr/local/etc/rc.d/couchdb start
;;
'stop')
sudo /usr/local/etc/rc.d/couchdb stop
;;
'restart')
sudo /usr/local/etc/rc.d/couchdb stop
sudo /usr/local/etc/rc.d/couchdb start
;;
*)
echo "Usage: $0 {start|stop|restart}"
;;
esac
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
fi
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
fi
Reader Comments