Posted: Mon Nov 22, 2021 12:36 Post subject: Ping in cron hangs and duplicates jobs
Hi, I am using DD-WRT r47608 on TP-Link TL-WR842ND v2 and found issue that running following command in custom cron script:
ping -c 3 -W 1 192.168.1.3
in cron could hang both command and script, and each time cron rerun job - it duplicates and eats RAM until reboot. It occurs when device with specified local IP address is unavailable. I specified 3 times and do not wait more longer than 1 second for each time. But still ping hangs.
It is likely because this is not set in the busybox config for your device. Does it work as expected from command line via telnet / ssh?
# CONFIG_FEATURE_FANCY_PING is not set
Ping command runs well in telnet/ssh, in both cases:
IP is reachable, and IP is not reachable.
It even runs as expected in cron script when IP reachable. When IP address is not reachable, ping hangs and new cron job runs also start to spawn sh and ping processes which also hang
Is it possible to set CONFIG_FEATURE_FANCY_PING somehow in built(compiled) firmware?
Joined: 08 May 2018 Posts: 14224 Location: Texas, USA
Posted: Mon Nov 22, 2021 22:29 Post subject:
You can't enable that on compiled code. The problem here seems to revolve around an unreachable host. So why is there a cron job to ping this host? Perhaps we should investigate that... _________________ "Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT Pogo - A minimal level of ability is expected and needed... DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)
----------------------
Linux User #377467 counter.li.org / linuxcounter.net
You can't enable that on compiled code. The problem here seems to revolve around an unreachable host. So why is there a cron job to ping this host? Perhaps we should investigate that...
In my opinion it is expected behavior for ping command to exit if -W option specified. In my case script tracks device and sends SIGTERM to hostapd if device becomes unreachable
Joined: 08 May 2018 Posts: 14224 Location: Texas, USA
Posted: Tue Nov 23, 2021 0:08 Post subject:
Then it's something in your crontab entry or your script, nothing to do with # CONFIG_FEATURE_FANCY_PING. Some further information might help troubleshoot the actual problem here. _________________ "Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT Pogo - A minimal level of ability is expected and needed... DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)
----------------------
Linux User #377467 counter.li.org / linuxcounter.net