Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 2 down vote accepted

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.
share|improve this answer
I have a problem with if-up scripts being run before DHCP. All my services are starting up while there's no DNS server in /etc/resolv.conf! – Danny Tuppeny Mar 27 at 19:50

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.