startup-delay in inadyn.conf
hajohoetger opened this issue · 8 comments
Hi,
i am running inadyn with spdyn and an ipv6 only system since yesterday. When i fiddled out the options for inadyn.conf, i got everything to work properly. Today, when i booted the box i found these lines in the journal:
Jul 05 20:18:16 gar inadyn[1007]: Starting DynDNS client : inadyn.
Jul 05 20:18:16 gar inadyn[1071]: Error running 'INADYN_PROVIDER="default@spdyn.de" INADYN_USER="gar.firewall-gateway.com" /bin/ip address show wlp2s0 | grep>
Jul 05 20:18:16 gar inadyn[1071]: IPv6 address fe80::208:caff:fe86:5ace is not a valid Internet address.
Jul 05 20:18:16 gar inadyn[1071]: Update needed for alias gar.firewall-gateway.com, new IP# 192.168.178.28
Jul 05 20:18:16 gar inadyn[1071]: Fatal error in DDNS server response:
Jul 05 20:18:16 gar inadyn[1071]: [404 Not Found] nohost
Jul 05 20:18:16 gar inadyn[1071]: Error response from DDNS server, exiting!
Jul 05 20:18:16 gar inadyn[1071]: Error code 48: DDNS server response not OK
The complete checkip-command is:
checkip-command = "/bin/ip address show wlp2s0 | grep inet6 | egrep -v 'mngtmpaddr|temporary' | grep 'scope global' | awk -F '[ ]+|/' '{print $3}'"
As it ran properly yesterday, i assumed, that the v6 address has not been assigned when inadyn is started. Thats why i added a sleep to the command as follows:
checkip-command = "/usr/bin/sleep 30; /bin/ip address show wlp2s0 | grep inet6 | egrep -v 'mngtmpaddr|temporary' | grep 'scope global' | awk -F '[ ]+|/' '{print $3}'"
This way, inadyn starts well. From the man page i know, there is a startup-delay option. [-t, --startup-delay SEC] I searched the inadyn.conf man page for an similar option with no success. May i have a startup-delay option in inadyn.conf?
cheers
HaJo
What's wrong with the command line delay? You can enable it by editing (on Debian/Ubuntu) /etc/default/inadyn and add:
INADYN_ARGS="--startup-delay 30"
I've tried to do combined command-line + .conf file settings before. It never ends well due to the complexity it creates, and peoples opinions on the matter. For instance, what should take precedence if you specify both command line and .conf file setting? I'm not going down that rabbit hole again. Command line options are for startup behavior and .conf file settings are for runtime behavior. Simplified, but as a general rule.
Having it in /etc/default/inadyn is a great idea and i tried it right away.
hajo@gar:~$ grep delay /etc/default/inadyn
INADYN_ARGS="--startup-delay 30"
hajo@gar:~$
Unfortunately, after a reboot i saw the old error again. It seems, the INADYN_ARGS from /etc/default/inadyn is not honored. (Tried also with --startup-delay=30)
Should not matter if you reboot or restart inadyn using systemctl
. Did you check with ps aux |grep inadyn
after reboot?
No, i ran
sudo journalctl -t inadyn -f
What happens, if inadyn is started too early is as follows:
The interface has already an ipv4 address, but no ipv6 address. Appearenty dhcp on my fritzBox takes longer for ipv6 than for v4. Having no v6 address makes my checkip-command fail. Inadyn falls back to its standard in this case and finds my v4 Address (192.168.178.28) With that address it fails with my dyn provider. inadyn is then stopped. Here the lines from my journal when it is configured fpr the error:
Jul 09 13:55:09 gar inadyn[1020]: Starting DynDNS client : inadyn.
Jul 09 13:55:09 gar inadyn[1078]: In-a-dyn version 2.10.0 -- Dynamic DNS update client.
Jul 09 13:55:09 gar inadyn[1078]: Error running 'INADYN_PROVIDER="default@spdyn.de" INADYN_USER="zen.firewall-gateway.com" ip a >/tmp/inadyn.out; /bin/ip address show wlp2s0 | grep inet6 | egrep -v 'mngtmpaddr|temporary' | grep 'scope global' | awk -F '[ ]+|/' '{print $3}'': 0 bytes read
Jul 09 13:55:09 gar inadyn[1078]: IPv6 address fe80::208:caff:fe86:5ace is not a valid Internet address.
Jul 09 13:55:09 gar inadyn[1078]: Update needed for alias zen.firewall-gateway.com, new IP# 192.168.178.28
Jul 09 13:55:09 gar inadyn[1078]: Fatal error in DDNS server response:
Jul 09 13:55:09 gar inadyn[1078]: [404 Not Found] nohost
Jul 09 13:55:09 gar inadyn[1078]: Error response from DDNS server, exiting!
Jul 09 13:55:09 gar inadyn[1078]: Error code 48: DDNS server response not OK
Jul 09 14:05:48 gar inadyn[2984]: Stopping DynDNS client: inadyn.
This is from ps when i add the sleep 30 to my checkip-command:
hajo@gar:$ grep ARGS /etc/default/inadyn$ ps aux |grep inady[n]
INADYN_ARGS="--startup-delay=60"
hajo@gar:
debian-+ 1076 0.0 0.0 11328 3092 ? Ss 17:52 0:00 /usr/bin/inadyn --pidfile /run/inadyn/inadyn.pid --config /etc/inadyn.conf --drop-privs debian-inadyn debian-inadyn
hajo@gar:~$
The inadyn.service
file I ship with In-a-Dyn supports reading an EnvironmentFile
from $sysconfdir/default/inadyn
. The variable you can set in that file can be either $INADYN_OPTS
or $INADYN_ARGS
. This is well tested and works fine to source extra command line arguments.
I do not know how you run In-a-Dyn, you've not told me, so I'm assuming you've built from a released source tarball. You seem to be running v2.10.0 and the latest is v2.11.0. If you are running a pre-packaged In-a-dyn by someone else, e.g. Debian .deb file, or RedHat/Fedora/CentOS/SuSE .rpm file, then you should report the problem to them.
It is debian bookwork, which has become stable the other day. In-a-Dyn is straight from the distribution.
hajo@gar:$ cat /etc/os-release$
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
hajo@gar:
The environment is definitely not parsed in in my service file. I'll contact the debian maintainer next week. So far it is working well with the added sleep command and i'm short on time currently. I definitely thank you very much for your prompt support. Keep on with the good work!
Hi, I have updated inadyn in Debian unstable to ship a systemd .service. But I don't have a way to test it, please inform me if it works. Thank you!
Closing as fixed downstream.