How can I make sure an init.d-script runs after network-interfaces received their addresses over DHCP?

5,507

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:
5,507

Related videos on Youtube

flitzwald
Author by

flitzwald

I'm a software developer from Cologne, Germany.

Updated on September 17, 2022

Comments

  • flitzwald
    flitzwald almost 2 years

    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?

  • FrCr
    FrCr over 8 years
    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! unix.stackexchange.com/q/272459/84496