bengalih
Senior Member
I use a DDNS custom update script to update to Cloudflare. For the most part it works find. However multiple times a day it seems that the DDNS service gets in some sort of loop and even though it properly registers the address it continues to do so.
My script uses a "throttle" function so as to not overload the DNS servers with constant attempts. It does this by checking the logfile it generates and if it had a successful update within the last 300 seconds, the script will not attempt an update and will log a throttled event.
Here is an example of my ddns events from syslog, it shows 2 proper events, followed by the loop cycle, followed by one more good event (each separated by a blank line):
It appears that every 30 minutes I must be getting a new dhcp IPv6 lease as the dhcp6c service triggers a restart_ddns event.
This kicks off the service-event script (of which I have no code for this event so it should not do anything).
Then start_ddns kicks off my ddns-start script passing my address (IPv4) to it.
The log then shows it completed the update
Finally a service-event-end is kicked off (of which I also have no code for ddns in).
That all looks pretty normal to me. The issue is the event that starts at 15:43:18 above.
You can see this process is interrupted by a watchdog event. Even so it appears to complete:
But then it appears to restart the process over and over again multiple times over the next 5 minutes.
It fails because it is getting throttled and only succeeds again after the throttle timeout.
This is further reflected in my ddns-start script log (custom) where it shows the following entries corresponding the log above:
So you can see the normally functioning successful updates at 14:43 and 15:13, and then another successful one at 15:43.
And even though this registers as successful, the throttle events correspond to all the watchdog loops above.
Finally the 5 minute loop ends at 15:48.
Then the next normal event happens 30 mins later at 16:13.
Can anyone lend some insight into what is misbehaving during these instances of watchdog interfering with this process (if that is what is going on...)?
thanks
My script uses a "throttle" function so as to not overload the DNS servers with constant attempts. It does this by checking the logfile it generates and if it had a successful update within the last 300 seconds, the script will not attempt an update and will log a throttled event.
Here is an example of my ddns events from syslog, it shows 2 proper events, followed by the loop cycle, followed by one more good event (each separated by a blank line):
Code:
Apr 6 14:43:18 rc_service: dhcp6c 18256:notify_rc restart_ddns
Apr 6 14:43:18 custom_script: Running /jffs/scripts/service-event (args: restart ddns)
Apr 6 14:43:18 start_ddns: update CUSTOM , wan_unit 0
Apr 6 14:43:18 custom_script: Running /jffs/scripts/ddns-start (args: XX.XX.XX.XX)
Apr 6 14:43:20 ddns: Completed custom ddns update
Apr 6 14:43:20 custom_script: Running /jffs/scripts/service-event-end (args: restart ddns)
Apr 6 15:13:18 rc_service: dhcp6c 23328:notify_rc restart_ddns
Apr 6 15:13:18 custom_script: Running /jffs/scripts/service-event (args: restart ddns)
Apr 6 15:13:18 start_ddns: update CUSTOM , wan_unit 0
Apr 6 15:13:18 custom_script: Running /jffs/scripts/ddns-start (args: XX.XX.XX.XX)
Apr 6 15:13:20 ddns: Completed custom ddns update
Apr 6 15:13:20 custom_script: Running /jffs/scripts/service-event-end (args: restart ddns)
Apr 6 15:43:18 rc_service: dhcp6c 28346:notify_rc restart_ddns
Apr 6 15:43:18 custom_script: Running /jffs/scripts/service-event (args: restart ddns)
Apr 6 15:43:19 start_ddns: update CUSTOM , wan_unit 0
Apr 6 15:43:19 custom_script: Running /jffs/scripts/ddns-start (args: XX.XX.XX.XX)
Apr 6 15:43:20 watchdog: start ddns.
Apr 6 15:43:20 rc_service: watchdog 396:notify_rc start_ddns
Apr 6 15:43:20 rc_service: waitting "restart_ddns" via ...
Apr 6 15:43:20 ddns: Completed custom ddns update
Apr 6 15:43:20 custom_script: Running /jffs/scripts/service-event-end (args: restart ddns)
Apr 6 15:43:21 custom_script: Running /jffs/scripts/service-event (args: start ddns)
Apr 6 15:43:22 start_ddns: update CUSTOM , wan_unit 0
Apr 6 15:43:22 custom_script: Running /jffs/scripts/ddns-start (args: XX.XX.XX.XX)
Apr 6 15:43:22 ddns: Custom ddns update failed
Apr 6 15:43:22 custom_script: Running /jffs/scripts/service-event-end (args: start ddns)
Apr 6 15:43:51 watchdog: start ddns.
Apr 6 15:43:51 rc_service: watchdog 396:notify_rc start_ddns
Apr 6 15:43:51 custom_script: Running /jffs/scripts/service-event (args: start ddns)
Apr 6 15:43:52 start_ddns: update CUSTOM , wan_unit 0
Apr 6 15:43:52 custom_script: Running /jffs/scripts/ddns-start (args: XX.XX.XX.XX)
Apr 6 15:43:52 ddns: Custom ddns update failed
Apr 6 15:43:52 custom_script: Running /jffs/scripts/service-event-end (args: start ddns)
Apr 6 15:44:21 watchdog: start ddns.
Apr 6 15:44:21 rc_service: watchdog 396:notify_rc start_ddns
Apr 6 15:44:21 custom_script: Running /jffs/scripts/service-event (args: start ddns)
Apr 6 15:44:22 start_ddns: update CUSTOM , wan_unit 0
Apr 6 15:44:22 custom_script: Running /jffs/scripts/ddns-start (args: XX.XX.XX.XX)
Apr 6 15:44:22 ddns: Custom ddns update failed
Apr 6 15:44:22 custom_script: Running /jffs/scripts/service-event-end (args: start ddns)
Apr 6 15:44:51 watchdog: start ddns.
Apr 6 15:44:51 rc_service: watchdog 396:notify_rc start_ddns
Apr 6 15:44:51 custom_script: Running /jffs/scripts/service-event (args: start ddns)
Apr 6 15:44:52 start_ddns: update CUSTOM , wan_unit 0
Apr 6 15:44:52 custom_script: Running /jffs/scripts/ddns-start (args: XX.XX.XX.XX)
Apr 6 15:44:52 ddns: Custom ddns update failed
Apr 6 15:44:52 custom_script: Running /jffs/scripts/service-event-end (args: start ddns)
Apr 6 15:45:21 watchdog: start ddns.
Apr 6 15:45:21 rc_service: watchdog 396:notify_rc start_ddns
Apr 6 15:45:21 custom_script: Running /jffs/scripts/service-event (args: start ddns)
Apr 6 15:45:22 start_ddns: update CUSTOM , wan_unit 0
Apr 6 15:45:22 custom_script: Running /jffs/scripts/ddns-start (args: XX.XX.XX.XX)
Apr 6 15:45:22 ddns: Custom ddns update failed
Apr 6 15:45:22 custom_script: Running /jffs/scripts/service-event-end (args: start ddns)
Apr 6 15:45:51 watchdog: start ddns.
Apr 6 15:45:51 rc_service: watchdog 396:notify_rc start_ddns
Apr 6 15:45:51 custom_script: Running /jffs/scripts/service-event (args: start ddns)
Apr 6 15:45:52 start_ddns: update CUSTOM , wan_unit 0
Apr 6 15:45:52 custom_script: Running /jffs/scripts/ddns-start (args: XX.XX.XX.XX)
Apr 6 15:45:52 ddns: Custom ddns update failed
Apr 6 15:45:52 custom_script: Running /jffs/scripts/service-event-end (args: start ddns)
Apr 6 15:46:21 watchdog: start ddns.
Apr 6 15:46:21 rc_service: watchdog 396:notify_rc start_ddns
Apr 6 15:46:21 custom_script: Running /jffs/scripts/service-event (args: start ddns)
Apr 6 15:46:22 start_ddns: update CUSTOM , wan_unit 0
Apr 6 15:46:22 custom_script: Running /jffs/scripts/ddns-start (args: XX.XX.XX.XX)
Apr 6 15:46:22 ddns: Custom ddns update failed
Apr 6 15:46:22 custom_script: Running /jffs/scripts/service-event-end (args: start ddns)
Apr 6 15:46:51 watchdog: start ddns.
Apr 6 15:46:51 rc_service: watchdog 396:notify_rc start_ddns
Apr 6 15:46:51 custom_script: Running /jffs/scripts/service-event (args: start ddns)
Apr 6 15:46:52 start_ddns: update CUSTOM , wan_unit 0
Apr 6 15:46:52 custom_script: Running /jffs/scripts/ddns-start (args: XX.XX.XX.XX)
Apr 6 15:46:52 ddns: Custom ddns update failed
Apr 6 15:46:52 custom_script: Running /jffs/scripts/service-event-end (args: start ddns)
Apr 6 15:47:21 watchdog: start ddns.
Apr 6 15:47:21 rc_service: watchdog 396:notify_rc start_ddns
Apr 6 15:47:21 custom_script: Running /jffs/scripts/service-event (args: start ddns)
Apr 6 15:47:22 start_ddns: update CUSTOM , wan_unit 0
Apr 6 15:47:22 custom_script: Running /jffs/scripts/ddns-start (args: XX.XX.XX.XX)
Apr 6 15:47:22 ddns: Custom ddns update failed
Apr 6 15:47:22 custom_script: Running /jffs/scripts/service-event-end (args: start ddns)
Apr 6 15:47:51 watchdog: start ddns.
Apr 6 15:47:51 rc_service: watchdog 396:notify_rc start_ddns
Apr 6 15:47:51 custom_script: Running /jffs/scripts/service-event (args: start ddns)
Apr 6 15:47:52 start_ddns: update CUSTOM , wan_unit 0
Apr 6 15:47:52 custom_script: Running /jffs/scripts/ddns-start (args: XX.XX.XX.XX)
Apr 6 15:47:52 ddns: Custom ddns update failed
Apr 6 15:47:52 custom_script: Running /jffs/scripts/service-event-end (args: start ddns)
Apr 6 15:48:21 watchdog: start ddns.
Apr 6 15:48:21 rc_service: watchdog 396:notify_rc start_ddns
Apr 6 15:48:21 custom_script: Running /jffs/scripts/service-event (args: start ddns)
Apr 6 15:48:22 start_ddns: update CUSTOM , wan_unit 0
Apr 6 15:48:22 custom_script: Running /jffs/scripts/ddns-start (args: XX.XX.XX.XX)
Apr 6 15:48:23 ddns: Completed custom ddns update
Apr 6 15:48:23 custom_script: Running /jffs/scripts/service-event-end (args: start ddns)
Apr 6 16:13:18 rc_service: dhcp6c 1405:notify_rc restart_ddns
Apr 6 16:13:18 custom_script: Running /jffs/scripts/service-event (args: restart ddns)
Apr 6 16:13:19 start_ddns: update CUSTOM , wan_unit 0
Apr 6 16:13:19 custom_script: Running /jffs/scripts/ddns-start (args: XX.XX.XX.XX)
Apr 6 16:13:20 ddns: Completed custom ddns update
Apr 6 16:13:20 custom_script: Running /jffs/scripts/service-event-end (args: restart ddns)
It appears that every 30 minutes I must be getting a new dhcp IPv6 lease as the dhcp6c service triggers a restart_ddns event.
This kicks off the service-event script (of which I have no code for this event so it should not do anything).
Then start_ddns kicks off my ddns-start script passing my address (IPv4) to it.
The log then shows it completed the update
Finally a service-event-end is kicked off (of which I also have no code for ddns in).
That all looks pretty normal to me. The issue is the event that starts at 15:43:18 above.
You can see this process is interrupted by a watchdog event. Even so it appears to complete:
Code:
Apr 6 15:43:20 ddns: Completed custom ddns update
But then it appears to restart the process over and over again multiple times over the next 5 minutes.
It fails because it is getting throttled and only succeeds again after the throttle timeout.
This is further reflected in my ddns-start script log (custom) where it shows the following entries corresponding the log above:
Code:
2023-04-06 14:43:20 UPDATE_SUCCESS {"result:{(data removed}}
2023-04-06 15:13:20 UPDATE_SUCCESS {"result:{(data removed}}
2023-04-06 15:43:20 UPDATE_SUCCESS {"result:{(data removed}}
2023-04-06 15:43:22 UPDATE_THROTTLED
2023-04-06 15:43:52 UPDATE_THROTTLED
2023-04-06 15:44:22 UPDATE_THROTTLED
2023-04-06 15:44:52 UPDATE_THROTTLED
2023-04-06 15:45:22 UPDATE_THROTTLED
2023-04-06 15:45:52 UPDATE_THROTTLED
2023-04-06 15:46:22 UPDATE_THROTTLED
2023-04-06 15:46:52 UPDATE_THROTTLED
2023-04-06 15:47:22 UPDATE_THROTTLED
2023-04-06 15:47:52 UPDATE_THROTTLED
2023-04-06 15:48:23 UPDATE_SUCCESS {"result:{(data removed}}
2023-04-06 16:13:20 UPDATE_SUCCESS {"result:{(data removed}}
So you can see the normally functioning successful updates at 14:43 and 15:13, and then another successful one at 15:43.
And even though this registers as successful, the throttle events correspond to all the watchdog loops above.
Finally the 5 minute loop ends at 15:48.
Then the next normal event happens 30 mins later at 16:13.
Can anyone lend some insight into what is misbehaving during these instances of watchdog interfering with this process (if that is what is going on...)?
thanks