Ddns services not running using luci-app-ddns and ddns-scripts-cloudflare

This is non flint 2 related but I'm having a problem with ddns-scripts-cloudflare 2.8.2-12 and luci-app-ddns git-22.123.50005-9139ad4.

The problem is the ddns service for each domain is always "Not Running" after a reboot. I've tried different firmwares initially and then left this problem whilst dealing with VPN stuff.

I'm currently on 4.6.0 beta 3.

If I manually press reload on each ddns service for each domain then the process runs correctly if an update is required, however nothing runs automatically upon boot of the router.

Running root@GL-MT6000:/etc/init.d# /etc/init.d/ddns enabled returns nothing so I think something service wise isn't coming up properly?

There are no log files to check because nothing gets processed.

In terms of config here is what I have

root@GL-MT6000:/etc/config# cat ddns 

config ddns 'global'
	option ddns_dateformat '%F %R'
	option ddns_loglines '250'
	option ddns_rundir '/var/run/ddns'
	option ddns_logdir '/var/log/ddns'
	option cacert '/etc/ssl/certs'
	option upd_privateip '1'

config service 'domain1_com'
	option use_ipv6 '0'
	option service_name 'cloudflare.com-v4'
	option lookup_host 'domain1.com'
	option retry_unit 'seconds'
	option force_unit 'minutes'
	option check_unit 'minutes'
	option domain 'domain1.com'
	option check_interval '5'
	option username 'username'
	option use_https '1'
	option cacert '/etc/ssl/certs'
	option ip_source 'network'
	option password 'password'
	option use_syslog '2'
	option enabled '1'
	option ip_network 'wan'
	option interface 'wan'

config service 'domain2_com'
	option use_ipv6 '0'
	option service_name 'cloudflare.com-v4'
	option lookup_host 'domain2'
	option retry_unit 'seconds'
	option force_unit 'minutes'
	option ip_network 'wan'
	option check_unit 'minutes'
	option domain 'domain2'
	option check_interval '5'
	option username 'username'
	option use_https '1'
	option cacert '/etc/ssl/certs'
	option ip_source 'network'
	option password 'password'
	option use_syslog '1'
	option enabled '1'
	option interface 'wan'

config service 'domain3_com'
	option use_ipv6 '0'
	option service_name 'cloudflare.com-v4'
	option lookup_host 'domain2'
	option retry_unit 'seconds'
	option force_unit 'minutes'
	option ip_network 'wan'
	option check_unit 'minutes'
	option domain 'domain2'
	option check_interval '5'
	option username 'username'
	option use_https '1'
	option cacert '/etc/ssl/certs'
	option ip_source 'network'
	option password 'password'
	option use_syslog '1'
	option enabled '1'
	option interface 'wan'

It looks like me and you are running the same kind of setup. I too have cloudflare and duckdns running via the ddns script. There were a few things I needed to edit for cloudflare to work but are you sure yours is actually working? If you force reload and click edit on cloudflare then what does the log say under "log file viewer" after clicking "the read" button. you should have a log if you forced it and it's running.

Yep that's it. When I run it manually as you said everything works as expected and an update is sent to cloudflare successfully. The trouble is getting that working upon a reboot and so on without having to press reload.

Maybe it's something in the firmware for your particular model, mine works fine after a reboot.

I found a thread over on the official openwrt forum that might help.

Found the issue.

This is the script used for all ddns.

root@GL-MT6000:~# cat /etc/init.d/ddns
#!/bin/sh /etc/rc.common
set -x
START=95
STOP=10

PROG=/usr/lib/ddns/dynamic_dns_updater.sh
bypassvpn=`uci -q get vpnpolicy.global.service_policy`

if [ $bypassvpn = 1 ];then
	PROG="sudo -g nonevpn /usr/lib/ddns/dynamic_dns_updater.sh"
else
	PROG=/usr/lib/ddns/dynamic_dns_updater.sh
fi



boot() {
	return 0
}

reload() {
	$PROG -- reload
	return 0
}

restart() {
	$PROG -- stop
	sleep 1 # give time to shutdown
	enable=`uci -q get ddns.glddns.enabled`
	if [ "$enable" = 1 ];then
		$PROG -- start
	fi
}

start() {
	enable=`uci -q get ddns.glddns.enabled`
	if [ "$enable" = 1 ];then
		$PROG -- start
	fi
}

stop() {
	$PROG -- stop
	return 0
}

The start function doesn't execute because uci -q get ddns.glddns.enabled returns nothing because I'm not using glddns. But even when I have enabled glddns that command still returns nothing.

So to workaround this for now I added /usr/lib/ddns/dynamic_dns_updater.sh -- start to startup. After a reboot I can see the ddns services are running.

Device: Flint 2
Firmware: 4.6.0 Beta 3 but I've experienced this on all firmware I've tried so far.

I remember on one firmware image I needed to delete the package: gl-sdk4-ddns because it was conflicting and then reinstall ddns and cloudflare. Maybe the reason for uninstalling the package was due to the code you highlighted. By removing the package it also removed some links inside the client GUI however my ddns worked then. The newer firmware I've flashed was good from the off so I didn't need to do anything.

Here was the original post for context:

opkg depends gl-sdk4-ddns
cat /etc/opkg/distfeeds.conf
Please post the output of this command

GL.iNet download center Please update and use. I have tested the latest 4.6.0 0619 and 4.6.0-op24, which have been fixed.

root@GL-MT6000:~# opkg depends gl-sdk4-ddns
gl-sdk4-ddns depends on:
	libc
	jansson4
	gl-sdk4-uci
	gl-sdk4-log
	gl-sdk4-utils
root@GL-MT6000:~# cat /etc/opkg/distfeeds.conf
src/gz glinet_core https://fw.gl-inet.com/releases/mt798x/kmod-4.5.7/aarch64_cortex-a53/mediatek/mt7986
src/gz glinet_gli_pub https://fw.gl-inet.com/releases/mt798x/packages-4.5/aarch64_cortex-a53/glinet
src/gz glinet_gli_packages https://fw.gl-inet.com/releases/mt798x/packages-4.5/aarch64_cortex-a53/packages

interesting but I'm sticking with the beta thanks.

If i had another flint 2 I'd test that

The wrong version of ddns-scripts has been removed. Please execute it when the network is normal:

opkg remove ddns-scripts
opkg remove ddns-scripts-services
opkg update
opkg install ddns-scripts
1 Like

On a fresh install of 4.6.0 beta 2024-06-20 12:48:14 (UTC+00:00)

root@GL-MT6000:~# opkg remove ddns-scripts
all ddns-scriptsNo packages removed.
Updating database.
Database update completed.
root@GL-MT6000:~# opkg remove ddns-scripts-services
No packages removed.
Updating database.
Database update completed.
root@GL-MT6000:~# opkg update
Downloading https://fw.gl-inet.com/releases/mt798x/kmod-4.5.7/aarch64_cortex-a53/mediatek/mt7986/Packages.gz
Updated list of available packages in /var/opkg-lists/glinet_core
Downloading https://fw.gl-inet.com/releases/mt798x/packages-4.5/aarch64_cortex-a53/glinet/Packages.gz
Updated list of available packages in /var/opkg-lists/glinet_gli_pub
Downloading https://fw.gl-inet.com/releases/mt798x/packages-4.5/aarch64_cortex-a53/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/glinet_gli_packages
Updating database.
Database update completed.
root@GL-MT6000:~# opkg install ddns-scripts
Installing ddns-scripts (2.8.2-43) to root...
Downloading https://fw.gl-inet.com/releases/mt798x/packages-4.5/aarch64_cortex-a53/packages/ddns-scripts_2.8.2-43_all.ipk
Collected errors:
 * opkg_download: Failed to download https://fw.gl-inet.com/releases/mt798x/packages-4.5/aarch64_cortex-a53/packages/ddns-scripts_2.8.2-43_all.ipk, wget returned 8.
 * opkg_install_pkg: Failed to download ddns-scripts. Perhaps you need to run 'opkg update'?
 * opkg_install_cmd: Cannot install package ddns-scripts.


Please update again.

same issue


The software package is located in Amazon's CDN. Due to cache effects, you need to wait for synchronization or try first:

/etc/init.d/dnsmasq restart

I can't download the file from another device using my home broadband, UK or USA vpn.

Not sure what is going on with the CDN.

Where is the CDN hosted? Can you PM me your region and I can try a VPN there?

Same here

root@GL-MT6000:~# wget https://fw.gl-inet.com/releases/mt798x/packages-4.5/aarch64_cortex-a53/packages/ddns-scripts_2.8.2-43_all.ipk
--2024-06-24 15:36:42--  https://fw.gl-inet.com/releases/mt798x/packages-4.5/aarch64_cortex-a53/packages/ddns-scripts_2.8.2-43_all.ipk
Resolving fw.gl-inet.com... 3.165.239.3, 3.165.239.109, 3.165.239.90, ...
Connecting to fw.gl-inet.com|3.165.239.3|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-06-24 15:36:42 ERROR 404: Not Found.

I'm able to find an old version here: (but not yet tried)

https://dl.openwrt.ai/packages-23.05/aarch64_generic/kiddin9/old/ddns-scripts_2.8.2-36_all.ipk

they deleted version .43 and uploaded .12 again.
Have you tried again now?

Package: ddns-scripts
Version: 2.8.2-12
Depends: libc, ddns-scripts-services
License: GPL-2.0
Section: net
Architecture: all
Installed-Size: 23778
Filename: ddns-scripts_2.8.2-12_all.ipk

This is the official package inside https://fw.gl-inet.com/releases/mt798x/packages-4.5/aarch64_cortex-a53/packages/Packages.gz
However it wants to install the 2.8.2-43 version

root@GL-MT6000:~# opkg install ddns-scripts
Installing ddns-scripts (2.8.2-43) to root...

Only gl staff can help here :slight_smile:

src/gz glinet_core http://download.gl-inet.com/releases/mt798x/kmod-4.5.7/aarch64_cortex-a53/mediatek/mt7986

src/gz glinet_gli_pub http://download.gl-inet.com/releases/mt798x/packages-4.5/aarch64_cortex-a53/glinet

src/gz glinet_gli_packages http://download.gl-inet.com/releases/mt798x/packages-4.5/aarch64_cortex-a53/packages


change the OPKG Configuration setting to the above command and it will work.