Try inserting "logger -t TESTING XXXXX" as the second line of that script. And then look in the syslog after bootup for that message. Just to confirm that the script ran.
The lack of ntpclient is a problem for me. I know the ntp client was changed but I don't know what it was changed to. I have no way of finding that out as I don't run the same firmware as you and it's not obvious to me from the source code.
# ntp -help
ntp: invalid option -- h
BusyBox v1.25.1 (2019-07-31 13:27:26 EDT) multi-call binary.
Usage: ntp [-dnqNwtl -I IFACE] [-S PROG] [-p PEER]...
NTP client/server
-d Verbose
-n Do not daemonize
-q Quit after clock is set
-N Run at high priority
-w Do not set time (only query peers), implies -n
-t Trust network and server, no RFC-4330 cross-checks
-S PROG Run PROG after stepping time, stratum change, and every 11 mins
-p PEER Obtain time from PEER (may be repeated)
If -p is not given, 'server HOST' lines
from /etc/ntp.conf are used
-l Also run as server on port 123
-I IFACE Bind server to IFACE, implies -l
31085 admin 1432 S /usr/sbin/ntp -t -S /sbin/ntpd_synced -p us.pool.ntp.org -p time.nist.gov
echo "nameserver 192.168.10.1" > /tmp/resolv.conf
dos2unix /jffs/scripts/services-start
chmod 777 /jffs/scripts/services-start
ps w | grep ntp
869 admin 1432 S /usr/sbin/ntp -t -S /sbin/ntpd_synced -p pool.ntp.org -p 192.98.49.11
2596 admin 1412 S grep ntp
773 admin 1412 S grep ntp
I'm assuming that the ntp process was originally there because you manually started it through the GUI? And then after the reboot it wasn't.
I'm still perplexed as to why the script isn't running. As it's meant to run at the end of the boot process I can only assume that because there is no WAN that the boot sequence is waiting and never completing.
May 5 08:05:12 WAN_Connection: WAN was exceptionally disconnected.
It's just fundamental to the way the firmware was designed. You've configured it in "router mode" so it expects to be able to route. If it can't bring up a WAN interface (which could be a USB modem) it will wait until it can, meanwhile assuming there is no connection to the internet.It is difficult to understand though why the router assumes that it has to have some kind of WAN connection even when I have disabled WAN from the GUI.
#!/bin/sh
logger -t DEBUG $1 $2
ntpd -p pool.ntp.org
#!/bin/sh
echo "nameserver 192.168.10.1" > /tmp/resolv.conf
ntpd -p pool.ntp.org -p 212.7.1.131
service restart_vpnserver1
crond[219]: time disparity of 829018 minutes detected
Known 'feature'The debug log showed a simple reason: custom scripts were disabled in System -> Administration. What I cannot understand is how the openvpn-event script could still run. But it did.
# Martineau Hack - don't allow scripts if ALL JFFS CUSTOM Scripts execution is DISABLED in the GUI
if [ "$(nvram get jffs2_scripts)" == "0" ];then
echo "User openvpn-event execution DISABLED because 'Enable JFFS custom scripts and configs=NO' in Adminstration->System GUI" | logger -t $scr_name
exit 1
fi
Try putting a "sleep 10" just after the ntp command and before the vpn restart.Thus, I am almost there but it seems that ntpd -p pool.ntp.org -p 212.7.1.131 in that script is not enough for OpenVPN.
May 5 08:05:09 kernel: hub 3-0:1.0: USB hub found
May 5 08:05:09 kernel: hub 3-0:1.0: 2 ports detected
Dec 2 04:27:11 kernel: SCSI subsystem initialized
Dec 2 04:27:11 kernel: csw_retry 100
Dec 2 04:28:01 crond[219]: time disparity of 829282 minutes detected
#!/bin/sh
echo "nameserver 192.168.10.1" > /tmp/resolv.conf
service restart_time
service restart_httpd
service restart_vpnserver1
#!/bin/sh
echo "nameserver 192.168.10.1" > /tmp/resolv.conf
service restart_time
service restart_httpd
service restart_vpnserver1
service restart_time
service restart_leds
service restart_usb_idle
service restart_firewall
service restart_bhblock
#!/bin/sh
echo "nameserver 192.168.10.1" > /tmp/resolv.conf
service restart_time
service restart_httpd
service restart_vpnserver1
service restart_firewall
#!/bin/sh
echo "nameserver 192.168.10.1" > /tmp/resolv.conf
service restart_time
service restart_firewall
#!/bin/sh
if [ "$dev" = "tun21" ]; then # tun21 is OpenVPN server #1
if [ "$script_type" = "down" ]; then
iptables -t nat -D POSTROUTING -s ${ifconfig_local}/${ifconfig_netmask} -o br0 -j MASQUERADE
elif [ "$script_type" = "up" ]; then
iptables -t nat -A POSTROUTING -s ${ifconfig_local}/${ifconfig_netmask} -o br0 -j MASQUERADE
fi
fi
#!/bin/sh
if [ "$dev" = "tun21" ]; then # tun21 is OpenVPN server #1
if [ "$script_type" = "down" ]; then
iptables -t nat -D POSTROUTING -s ${ifconfig_local}/${ifconfig_netmask} -o br0 -j MASQUERADE
elif [ "$script_type" = "up" ]; then
iptables -t nat -A POSTROUTING -s ${ifconfig_local}/${ifconfig_netmask} -o br0 -j MASQUERADE
fi
fi
Welcome To SNBForums
SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.
If you'd like to post a question, simply register and have at it!
While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!