I was testing some things related to this ticket and thought I’d try using the ping reboot service.
Turns out the ping reboot service always fails (firmware 1.0.6):
Fri Jun 20 10:26:04 2025 user.notice ping_reboot.sh: Ping 8.8.8.8 failed.
Fri Jun 20 10:26:04 2025 user.notice ping_reboot.sh: Ping 1.1.1.1 failed.
even though pinging those ips works fine:
root@TSW202:/etc/opkg# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=115 time=21.460 ms
64 bytes from 8.8.8.8: seq=1 ttl=115 time=20.806 ms
...
root@TSW202:/etc/opkg# ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: seq=0 ttl=52 time=25.160 ms
64 bytes from 1.1.1.1: seq=1 ttl=52 time=24.888 ms
To debug, I found the cron job that performs the ping tests:
root@TSW202:/etc/opkg# crontab -u preboot -l
*/5 * * * * /usr/sbin/ping_reboot.sh cfg01c21d
and running this script as root works just fine (even though there’s some error output):
root@TSW202:/etc/opkg# /usr/sbin/ping_reboot.sh cfg01c21d
WARNING: Variable 'modems' does not exist or is not an array/object
Command failed: Not found
Failed to parse message data
Command failed: Not found
...
Fri Jun 20 10:33:13 2025 user.notice ping_reboot.sh: Ping 8.8.8.8 successful.
Fri Jun 20 10:33:13 2025 user.notice ping_reboot.sh: Ping 1.1.1.1 successful.
Fri Jun 20 10:33:13 2025 user.notice ping_reboot.sh: Pings successful.
However, for completness I installed sudo so I could run the script as ‘preboot’, and see the failures:
root@TSW202:/etc/opkg# sudo -u preboot /usr/sbin/ping_reboot.sh cfg01c21d
WARNING: Variable 'modems' does not exist or is not an array/object
Command failed: Not found
Failed to parse message data
/sbin/uci: I/O error
Command failed: Not found
...
Fri Jun 20 10:35:01 2025 user.notice ping_reboot.sh: Ping 8.8.8.8 failed.
Fri Jun 20 10:35:01 2025 user.notice ping_reboot.sh: Ping 1.1.1.1 failed.
Fri Jun 20 10:35:01 2025 user.notice ping_reboot.sh: 2 unsuccessful ping tries
and further debugging reveals that the ‘preboot’ user does not have permission to ping:
root@TSW202:/etc/opkg# sudo -u preboot /bin/ping -W 5 -s 56 -q -c 1 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
ping: permission denied (are you root?)