I just installed couchdb on a debian5 system and added symlinks to the /etc/init.d/couchdb-script. Unfortunately, this script gets triggered on startup before the network interface received the address over DHCP that the couchdb-server tries to bind to - which leaves the instance defunct.

I kind of solved this, by executing dhclient in the start script, but there just HAS to be a better way...? Is there?

2 Answers 2


Yes, there is a better way: place your couchdb init script in /etc/network/if-up.d/ so it will run after your network is set up.

Pay attention to:

   Filenames should consist entirely of upper and lower case
   letters, digits, underscores, and hyphens. Subdirectories  
   of directory and files with other names will be silently ignored.

On CentOS and probably RedHat it checks to see if there is a file /sbin/ifup-local and will execute that if it is available.

to create it:

sudo touch /sbin/ifup-local
sudo chmod +x /sbin/ifup-local

Then edit it to contain what you would like

# your commands or calls to your script here

Hope that helps. I like Debian's .d directory better but this seems to be the closest equivalent on CentOS.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .