dyndns problems
Moderator: Moderators
-
- Posts: 51
- Joined: Thu Dec 18, 2008 1:11 pm
Re: dyndns problems
Hm, this is still not working for me
http://pastebin.com/m4d1338c9
This is my log from this morning so my connection was clearly restarted. But still, my dyndns account isn't updated (it worked last time I tested manually, so I really have no clue why it now again failed). The last successful update was 2 days ago when I tested your changes. Since then, nothing happened. Might this be a problem with your dyndns client ? I am pretty sure if I would now restart the thing manually (i.e. having it killed and restarted) would update everything now.
http://pastebin.com/m4d1338c9
This is my log from this morning so my connection was clearly restarted. But still, my dyndns account isn't updated (it worked last time I tested manually, so I really have no clue why it now again failed). The last successful update was 2 days ago when I tested your changes. Since then, nothing happened. Might this be a problem with your dyndns client ? I am pretty sure if I would now restart the thing manually (i.e. having it killed and restarted) would update everything now.
Re: dyndns problems
Hmmm... Well, there are two possibilities: (1) The ddns client isn't functioning properly and (2) The hotplug script isn't being run. The fact you saw no command line output (as I do) when you tried restarting the wan manually makes me suspect that the problem may be (2). Also, since I can't replicate the problem, and the only difference is that you're using pppoe, while I have a cable modem makes me think this is more likely.
However, there's a way to test this. Edit /etc/hotplug.d/iface/25-ddns, so that whenever it runs it creates a file in /tmp, telling you that it ran, and when it ran. Adjust the code so it looks like this (adding the date command, which redirects to /tmp/ddns-hotplug-test):
Now we'll have a record of any time we tried to update ddns with this script. If you run ifdown wan ; sleep 2 ; ifup wan ; does /tmp/ddns-hotplug-test get created? Does your ip get updated?
If everything seems to work (file gets created and ip is updated), then try resetting your cron job to execute right away (or wait until tomorrow morning if you're lazy), so you can test if there's some difference if cron is running the commands instead of you. You may want to delete /etc/ddns-hotplug-test, if it exists, before you do this so you don't have to check the time in the file and see if it matches when cron ran -- you can just see if it exists.
If you're seeing the file get created at the proper time, but the ip is not updated (when an update is necessary) it's definitely a problem with the client. If the file isn't getting created, that means that the script isn't being run, and the problem is not the client.
However, there's a way to test this. Edit /etc/hotplug.d/iface/25-ddns, so that whenever it runs it creates a file in /tmp, telling you that it ran, and when it ran. Adjust the code so it looks like this (adding the date command, which redirects to /tmp/ddns-hotplug-test):
Code: Select all
#!/bin/sh
config_load "network"
config_get wan_proto "wan" "proto"
if [ "$INTERFACE" = "wan" ] && [ "$ACTION" = "ifup" ]
then
date > /tmp/ddns-hotplug-test
/usr/bin/ddns_gargoyle -P /etc/ddns_providers.conf -C /etc/ddns_gargoyle.conf
fi
If everything seems to work (file gets created and ip is updated), then try resetting your cron job to execute right away (or wait until tomorrow morning if you're lazy), so you can test if there's some difference if cron is running the commands instead of you. You may want to delete /etc/ddns-hotplug-test, if it exists, before you do this so you don't have to check the time in the file and see if it matches when cron ran -- you can just see if it exists.
If you're seeing the file get created at the proper time, but the ip is not updated (when an update is necessary) it's definitely a problem with the client. If the file isn't getting created, that means that the script isn't being run, and the problem is not the client.
-
- Posts: 51
- Joined: Thu Dec 18, 2008 1:11 pm
Re: dyndns problems
Hm, you were right with assumption (2) (of course *g*):
I restarted my connection, and the file wasn't created - so it seems the script never gets called.
Code: Select all
#!/bin/sh
config_load "network"
config_get wan_proto "wan" "proto"
if [ "$INTERFACE" = "wan" ] && [ "$ACTION" = "ifup" ]
then
date > /tmp/ddns-hotplug-test
/usr/bin/ddns_gargoyle -P /etc/ddns_providers.conf -C /etc/ddns_gargoyle.conf
fi
Re: dyndns problems
Ok, next step is to figure out if the script is not getting called at all, or if it's getting called with the wrong interface name (e.g. 'ppp' instead of 'wan').
Edit the same /etc/hotplug.d/iface/25-ddns script again, adding a line that will echo to a file whenever it is run:
Note that we're appending data to the /tmp/hotplug-status file this time, so we'll know every time the script gets called. We should see it once when the interface goes down and once when it comes up, though the if statement only updates ddns/echoes to the second test file in the second case.
If you make these changes, and try again does /tmp/hotplug-status get created, and if so, what is in it?
Edit the same /etc/hotplug.d/iface/25-ddns script again, adding a line that will echo to a file whenever it is run:
Code: Select all
#!/bin/sh
echo "iface=$INTERFACE, action=$ACTION" >> /tmp/hotplug-status
config_load "network"
config_get wan_proto "wan" "proto"
if [ "$INTERFACE" = "wan" ] && [ "$ACTION" = "ifup" ]
then
date > /tmp/ddns-hotplug-test
/usr/bin/ddns_gargoyle -P /etc/ddns_providers.conf -C /etc/ddns_gargoyle.conf
fi
If you make these changes, and try again does /tmp/hotplug-status get created, and if so, what is in it?
-
- Posts: 51
- Joined: Thu Dec 18, 2008 1:11 pm
Re: dyndns problems
Argh, this is probably not the result we wanted to see:
root@router:~# ifdown wan && sleep 3 && ifup wan
root@router:~# ls /tmp/
TZ ddns-hotplug-test fstab last_ddns_updates log resolv.conf.auto spool
data dhcp.leases hotplug-status lock resolv.conf run state
root@router:~# cat /tmp/ddns-hotplug-test
Tue Mar 10 20:01:16 STD 2009
root@router:~# cat /tmp/hotplug-status
iface=wan, action=ifdown
iface=wan, action=ifup
This somehow correlates with my finding that it sometimes works and sometimes doesn't. There was still no console message of the ddns client though, but Dyndns this time HAS updated to the correct ip.
root@router:~# ifdown wan && sleep 3 && ifup wan
root@router:~# ls /tmp/
TZ ddns-hotplug-test fstab last_ddns_updates log resolv.conf.auto spool
data dhcp.leases hotplug-status lock resolv.conf run state
root@router:~# cat /tmp/ddns-hotplug-test
Tue Mar 10 20:01:16 STD 2009
root@router:~# cat /tmp/hotplug-status
iface=wan, action=ifdown
iface=wan, action=ifup
This somehow correlates with my finding that it sometimes works and sometimes doesn't. There was still no console message of the ddns client though, but Dyndns this time HAS updated to the correct ip.
Re: dyndns problems
I guess all I can recommend is to clear the /tmp files, set up your cron job as before, and then report back the result of the test files if/when the ip update fails. I have no idea what could cause such intermittent behavior.
-
- Posts: 51
- Joined: Thu Dec 18, 2008 1:11 pm
Re: dyndns problems
Oh noes - random strike yet again. My ip was updated now for about a week I would say and now today it didn't. I tried the following today before restarting the dns service:
I manually started the ddns app:
root@router:~# /usr/bin/ddns_gargoyle -P /etc/ddns_providers.conf -C /etc/ddns_gargoyle.conf
update of ddns_1 failed
Unfortunately nothing more. Then I did the following:
root@router:~# killall ddns_gargoyle
root@router:~# /usr/bin/ddns_gargoyle -P /etc/ddns_providers.conf -C /etc/ddns_gargoyle.conf
update of myddnsdomain successful.
So this really seems to be a problem with your ddns client stopping to work for some reason, although I dont know why.
This was while the service was not working:
root@router:~# free
total used free shared buffers
Mem: 14356 13828 528 0 752
Swap: 0 0 0
Total: 14356 13828 528
Not much, but still some free ram there - that was what I was suspecting first. Any ideas ?
I manually started the ddns app:
root@router:~# /usr/bin/ddns_gargoyle -P /etc/ddns_providers.conf -C /etc/ddns_gargoyle.conf
update of ddns_1 failed
Unfortunately nothing more. Then I did the following:
root@router:~# killall ddns_gargoyle
root@router:~# /usr/bin/ddns_gargoyle -P /etc/ddns_providers.conf -C /etc/ddns_gargoyle.conf
update of myddnsdomain successful.
So this really seems to be a problem with your ddns client stopping to work for some reason, although I dont know why.
This was while the service was not working:
root@router:~# free
total used free shared buffers
Mem: 14356 13828 528 0 752
Swap: 0 0 0
Total: 14356 13828 528
Not much, but still some free ram there - that was what I was suspecting first. Any ideas ?
Re: dyndns problems
Hmm... that does look like a problem with the client.
It typically displays the "failed to update" message when it can't connect to the dynamic dns website to do the update (because the network is down), or if the wrong user/password is supplied. I'll see if I can discover what is going on, but I should warn you that this bug looks like it's going to be difficult to find due to it's intermittent nature. I don't think I can fix this one within a few hours, or even a few days, but I'll definitely spend some time trying to figure it out (and post here as soon as I do).
The most helpful thing you can do is to figure out how to replicate the issue consistently. If I can figure out exactly when this happens, I'm 90% of the way to solving it. So far, I haven't even seen it once, so this will be tricky...
One other thing: It looks like you killed the ddns daemon and never restarted it. If you don't add a -d flag it will quit as soon as it runs (or, if the daemon is running, communicate to the daemon that it should do an update, output the results, and then quit). Right now no updates are being performed on your router because no daemon is running.
It typically displays the "failed to update" message when it can't connect to the dynamic dns website to do the update (because the network is down), or if the wrong user/password is supplied. I'll see if I can discover what is going on, but I should warn you that this bug looks like it's going to be difficult to find due to it's intermittent nature. I don't think I can fix this one within a few hours, or even a few days, but I'll definitely spend some time trying to figure it out (and post here as soon as I do).
The most helpful thing you can do is to figure out how to replicate the issue consistently. If I can figure out exactly when this happens, I'm 90% of the way to solving it. So far, I haven't even seen it once, so this will be tricky...
One other thing: It looks like you killed the ddns daemon and never restarted it. If you don't add a -d flag it will quit as soon as it runs (or, if the daemon is running, communicate to the daemon that it should do an update, output the results, and then quit). Right now no updates are being performed on your router because no daemon is running.
-
- Posts: 51
- Joined: Thu Dec 18, 2008 1:11 pm
Re: dyndns problems
Yeah, as a temporary workaround because I might need dyndns to work the next few days I just added a cronjob shortly after my wan restart that restarts the whole ddns init script - and thus kills and restarts it in daemon mode (at least I hoped it will do that *g*). At the moment I am out of ideas what I can do to try and reproduce it and unfortunately I won't have much time the next few weeks, but I will try and see if I can reproduce it after my university exams are over. No worries though, don't spend too much time on it - if I really need the functionality I will probably just write me a cronjob that starts a script that checks the status hourly and if it fails does a one time restart of the service or something.