I found temporary solution by reinstalling cloudflared service.
/etc/init.d/cloudflared stop
mv /etc/init.d/cloudflared /etc/init.d/cloudflared.old
cloudflared service install
/etc/init.d/cloudflared start
The problem is that when its started its working in background but you cannot use /etc/init.d/cloudflared stop
to stop it, as installed file is not compatible with OpenWrt as it come from Red Hat.
To stop it you need to kill it manually kill -9 <PID>
.
But, I found out the issue.
the ps
command in OpenWrt do not have same funcionality as in other systems, so in /etc/init.d/cloudflared
I replaced the following:
is_running() {
[ -f "$pid_file" ] && ps $(get_pid) > /dev/null 2>&1
}
to
is_running() {
[ -f "$pid_file" ] && ps | grep $(get_pid) | grep -v grep > /dev/null 2>&1
}
An stop
, status
and restart
started working.
Usage: /etc/init.d/cloudflared {start|stop|restart|status}
Hope that help in further development.