I have recently installed ocserv on my TL-WR1043ND with CC 15.05.1, running with a dynamic DNS obtained with DHCP, and the auto-start always failed, despite being enabled and working when called fron the console with "/etc/init.d/ocserv start". I suspect that when ocserv was launched the WAN interface hadn't yet received its IP address from the provider's DHCP server, because inserting a 1 second pause appears to fix the problem. To play it safe, in /etc/init.d/ocserv I suggest to replace the line
service_start /usr/sbin/ocserv -c /var/etc/ocserv.conf
with:
for a in 1 2 3 4 5 6 7 8 9 10
do
service_start /usr/sbin/ocserv -c /var/etc/ocserv.conf
if [ $? == 0 ]; then break; fi
logger -t ocserv "ocserv start failed, status: $? - waiting 1s before retry"
sleep 1
done
Also, the command "/etc/init.d/ocserv restart" fails with error:
bind() failed: Address already in use
bind() failed: Address already in use
Could not listen to any TCP or UNIX ports
I fixed this by inserting a "sleep 1" after the call to "service_stop /usr/sbin/ocserv" in the stop() function:
stop() {
service_stop /usr/sbin/ocserv
sleep 1
}
Enzo