What is scripts/network/exdhcp/dnsmasq_edithosts.sh ?

I noticed that master is already patched to hup, but it's missing the
dhcp_release that dennis just put in a review for.


On Wed, May 1, 2013 at 1:43 PM, Marcus Sorensen <shadow...@gmail.com> wrote:

> oops, minus my two 'echo' debugging lines in there
>
>
>
> On Wed, May 1, 2013 at 1:41 PM, Marcus Sorensen <shadow...@gmail.com>wrote:
>
>> I'm not sure how we'd handle older versions if they don't have the
>> dhcp_release util, but how about this going forward?
>>
>> diff --git a/patches/systemvm/debian/config/root/edithosts.sh
>> b/patches/systemvm/debian/config/root/edithosts.sh
>> index 9f21f20..f6e09d6 100755
>> --- a/patches/systemvm/debian/config/root/edithosts.sh
>> +++ b/patches/systemvm/debian/config/root/edithosts.sh
>> @@ -71,6 +71,7 @@ DHCP_HOSTS=/etc/dhcphosts.txt
>>  DHCP_OPTS=/etc/dhcpopts.txt
>>  DHCP_LEASES=/var/lib/misc/dnsmasq.leases
>>  HOSTS=/etc/hosts
>> +ROUTER_VERSION=$(cat /etc/debian_version | cut -d. -f1)
>>
>>  source /root/func.sh
>>
>> @@ -99,6 +100,14 @@ wait_for_dnsmasq () {
>>
>>  logger -t cloud "edithosts: update $1 $2 $3 to hosts"
>>
>> +if [ $ROUTER_VERSION -gt 6 ]
>> +then
>> +  #release previous dhcp lease if present
>> +  echo releasing $ipv4
>> +  dhcp_release lo $ipv4 $(grep $ipv4 $DHCP_LEASES | awk '{print $2}')
>> >/dev/null 2>&1
>> +  echo released $ipv4
>> +fi
>> +
>>  [ ! -f $DHCP_HOSTS ] && touch $DHCP_HOSTS
>>  [ ! -f $DHCP_OPTS ] && touch $DHCP_OPTS
>>  [ ! -f $DHCP_LEASES ] && touch $DHCP_LEASES
>> @@ -200,7 +209,12 @@ fi
>>  pid=$(pidof dnsmasq)
>>  if [ "$pid" != "" ]
>>  then
>> -  service dnsmasq restart
>> +  if [ $ROUTER_VERSION -gt 6 ]
>> +  then
>> +    kill -s 1 $pid
>> +  else
>> +    service dnsmasq restart
>> +  fi
>>  else
>>    if [ $no_redundant -eq 1 ]
>>    then
>>
>>
>>
>>
>> On Wed, May 1, 2013 at 12:33 PM, Chip Childers <chip.child...@sungard.com
>> > wrote:
>>
>>> On Wed, May 01, 2013 at 12:29:32PM -0600, Marcus Sorensen wrote:
>>> > How do we go about requesting that dnsmasq-utils be installed on the
>>> new
>>> > system VM?
>>>
>>> The code to create system VMs is in the repo now.  You should be able to
>>> just make the change and / or submit a patch suggesting the change.
>>>
>>> See:
>>>
>>> tools/appliance/definitions
>>>
>>
>>
>

Reply via email to