ddclient 4 changes

After a 4-hour power outage today (crews were working on the power lines), my home IP address changed, perhaps for the first time in over a year. I also noticed ddclient was no longer installed on my host. This blog post outlines changes from the original article.

In this post:

Of note, since the previous post:

  • the default location for the configuration file (ddclient.conf) has moved from /usr/local/etc/ to /usr/local/etc/ddclient/
  • The old cache file is no longer compatible: Mar 11 17:58:23 gw01 ddclient[8133]: WARNING: [file /var/tmp/ddclient.cache, line 1]> program version mismatch; ignoring
  • Command line arguments have changed from single-dash to double-dash (e.g. -ip is now –ip) – at first I thought my original documentation was wrong… because I was reading it to get things back up and running.

I had to update my Ansible playbook to install the configuration file to the new location. Then I ran my update:

[18:39 ansible root /usr/local/etc/ansible] # ansible-playbook gateway.yml --limit=gw01.int.unixathome.org --tags=ddclient


PLAY [gateways] *********************************************************************************************************************************************************************************************************

TASK [Gathering Facts] **************************************************************************************************************************************************************************************************
ok: [gw01.int.unixathome.org]

TASK [ddclient : Install on Debian] *************************************************************************************************************************************************************************************
skipping: [gw01.int.unixathome.org]

TASK [ddclient : Install on RedHat] *************************************************************************************************************************************************************************************
skipping: [gw01.int.unixathome.org]

TASK [ddclient : Install on FreeBSD] ************************************************************************************************************************************************************************************
included: /usr/local/etc/ansible/roles/ddclient/tasks/setup-FreeBSD.yml for gw01.int.unixathome.org

TASK [ddclient : Install ddclient.] *************************************************************************************************************************************************************************************
ok: [gw01.int.unixathome.org]

TASK [ddclient : ansible.builtin.set_fact] ******************************************************************************************************************************************************************************
ok: [gw01.int.unixathome.org]

TASK [ddclient : Install from source] ***********************************************************************************************************************************************************************************
skipping: [gw01.int.unixathome.org]

TASK [ddclient : Configure ddclient] ************************************************************************************************************************************************************************************
included: /usr/local/etc/ansible/roles/ddclient/tasks/configure.yml for gw01.int.unixathome.org

TASK [ddclient : Create the ddclient configuration folder] **************************************************************************************************************************************************************
ok: [gw01.int.unixathome.org]

TASK [ddclient : Create configuration file] *****************************************************************************************************************************************************************************
changed: [gw01.int.unixathome.org]

TASK [ddclient : Create the cache directory] ****************************************************************************************************************************************************************************
ok: [gw01.int.unixathome.org]

TASK [ddclient : Create the systemd file] *******************************************************************************************************************************************************************************
skipping: [gw01.int.unixathome.org]

TASK [ddclient : List some items] ***************************************************************************************************************************************************************************************
ok: [gw01.int.unixathome.org] => {
    "msg": [
        "__ddclient_configuration_directory: /usr/local/etc/ddclient",
        "__ddclient_configuration_location:  /usr/local/etc/ddclient/ddclient.conf",
        "__ddclient_cache_director:          /var/cache/ddclient"
    ]
}

PLAY RECAP **************************************************************************************************************************************************************************************************************
gw01.int.unixathome.org    : ok=9    changed=1    unreachable=0    failed=0    skipped=4    rescued=0    ignored=0   

Exit hooks

I also know the exit hook needs to be updated, because of the command line argument changes. That diff is:

[18:47 ansible root /usr/local/etc/ansible] # svn di host_vars/gw01.int.unixathome.org/freebsd-netif.yaml
Index: host_vars/gw01.int.unixathome.org/freebsd-netif.yaml
===================================================================
--- host_vars/gw01.int.unixathome.org/freebsd-netif.yaml	(revision 3015)
+++ host_vars/gw01.int.unixathome.org/freebsd-netif.yaml	(working copy)
@@ -150,7 +150,7 @@
     - /usr/local/sbin/he-notify.sh
     -    
     - "# configure dynamic dns"
-    - /usr/local/sbin/ddclient -syslog -use=ip -ip="$new_ip_address" -verbose -daemon=0
+    - /usr/local/sbin/ddclient --syslog --use=ip --ip="$new_ip_address" --verbose --daemon=0
     -
     - "# we're done: log it."
     - 'logger "dhclient-exit-hooks is done"'
[18:47 ansible root /usr/local/etc/ansible] # 

That update was pushed top the host via:

[18:47 ansible root /usr/local/etc/ansible] # ansible-playbook gateway.yml --limit=gw01.int.unixathome.org --tags=netif


PLAY [gateways] *********************************************************************************************************************************************************************************************************

TASK [Gathering Facts] **************************************************************************************************************************************************************************************************
ok: [gw01.int.unixathome.org]

TASK [freebsd-netif : install /etc/rc.conf.d/netif] *********************************************************************************************************************************************************************
ok: [gw01.int.unixathome.org]

TASK [freebsd-netif : install scripts] **********************************************************************************************************************************************************************************
ok: [gw01.int.unixathome.org] => (item={'name': 'he-net.sh', 'destdir': '/usr/local/sbin'})
ok: [gw01.int.unixathome.org] => (item={'name': 'he-notify.sh', 'destdir': '/usr/local/sbin'})

TASK [freebsd-netif : install /etc/dhclient-exit-hooks] *****************************************************************************************************************************************************************
changed: [gw01.int.unixathome.org]

TASK [freebsd-netif : List the cloned_interfaces] ***********************************************************************************************************************************************************************
ok: [gw01.int.unixathome.org] => {
    "msg": [
        "cloned_interfaces: vlan2 vlan3 vlan4 vlan7 vlan8 vlan219 tun2 gif0",
        "ip4: [{'ip': 'DHCP', 'nic': 'igc0', 'desc': 'Default'}]"
    ]
}

PLAY RECAP **************************************************************************************************************************************************************************************************************
gw01.int.unixathome.org    : ok=5    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

The cache file

To stop the compatibility messages, I did this:

[18:50 gw01 dvl /usr/local/etc] % sudo mv /var/tmp/ddclient.cache /var/tmp/ddclient.cache-ddclient-3.11.2

Launching ddclient

To run ddclient, I did this:

[17:54 gw01 dvl ~] % sudo ddclient --syslog --use=ip --ip= 203.0.113.120 --daemon=0 --verbose

where 203.0.113.120 is my current IP address (that’s not really what it was).

Now it’s running:

[19:02 gw01 dvl /usr/local/etc] % ps auwwx | grep ddclient     
root    10788   0.1  0.1   32628 19100  -  Ss   18:07     0:00.65 ddclient - sleeping for 60 seconds (perl)
dvl     17227   0.0  0.0   14164  2680  0  S+   19:02     0:00.00 grep ddclient

And logging:

Mar 11 19:05:51 gw01 ddclient[10788]: SUCCESS: [MyBSDHost]> skipped update because IPv4 address is already set to 203.0.113.120
Mar 11 19:05:51 gw01 ddclient[10788]: SUCCESS: [bast.example.net]> skipped update because IPv4 address is already set to 203.0.113.120
Mar 11 19:05:51 gw01 ddclient[10788]: SUCCESS: [unixathome.example.net]> skipped update because IPv4 address is already set to 203.0.113.120

And…

I won’t know for sure if this is all working until the next time my IP address changes.

I still don’t know how ddclient got removed in the first place.

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

Leave a Comment

Scroll to Top