Ping in cron hangs and duplicates jobs

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Author Message
jester322
DD-WRT Novice


Joined: 27 Jul 2021
Posts: 11

PostPosted: Mon Nov 22, 2021 12:36    Post subject: Ping in cron hangs and duplicates jobs Reply with quote
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.

What could be the reason for such behavior?
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12889
Location: Netherlands

PostPosted: Mon Nov 22, 2021 16:22    Post subject: Reply with quote
I have transferred your thread to the Atheros forum.

See the forum guidelines with helpful pointers about how to research your router, where and what to download, where and how to post and many other helpful tips:
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14224
Location: Texas, USA

PostPosted: Mon Nov 22, 2021 17:44    Post subject: Reply with quote
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

_________________
"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
jester322
DD-WRT Novice


Joined: 27 Jul 2021
Posts: 11

PostPosted: Mon Nov 22, 2021 21:58    Post subject: Reply with quote
kernel-panic69 wrote:
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?
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14224
Location: Texas, USA

PostPosted: Mon Nov 22, 2021 22:29    Post subject: Reply with quote
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
jester322
DD-WRT Novice


Joined: 27 Jul 2021
Posts: 11

PostPosted: Mon Nov 22, 2021 22:53    Post subject: Reply with quote
kernel-panic69 wrote:
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
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14224
Location: Texas, USA

PostPosted: Tue Nov 23, 2021 0:08    Post subject: Reply with quote
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
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum