[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: starting the same daemon twice -- HOW?



Here is what I have in my /etc/init.d/diald:

A function for running an instance of diald:

  run_diald() {
    site=$1 ; shift
    local_ip=$1 ; shift
    authname=$1

    ppp_opts="${local_ip}:"
    [ "$authname" ] && ppp_opts="name ${authname} ${local_ip}:"

    start-stop-daemon --start --verbose --pidfile /var/run/diald/${site}.pid \
      --exec /usr/sbin/diald -- \
      -f /etc/diald/options-${site} pidfile diald/${site}.pid     \
      fifo /var/run/diald/${site}.fifo                    \
      connect "/etc/ppp/ppp-diald-chat ${site}"           \
      -- ${ppp_opts}
  }

The important bit being the --pidfile setting being different for each 
instance.

Then in the start) case I have lines like this (the IP addresses have been 
changed):

    start)
      run_diald rjb        193.137.230.229
      run_diald penrith    10.150.14.33
      run_diald celtic     193.137.242.200
      run_diald isi        193.195.134.1
      run_diald astro      10.194.154.20
      run_diald hearsay    10.56.228.253
      run_diald britcorp   10.128.0.20
      run_diald ting       10.236.182.20
      run_diald isp        156.23.82.20    hands
    ;;

Hope that helps.

Cheers, Phil.


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: