[OpenWrt-Devel] Q: procd / respawn if process dies

Bastian Bittorf bittorf at bluebottle.com
Tue Dec 8 09:33:42 EST 2015


while trying to understand the procd
respawn-trigger, I wrote this testscript:

#!/bin/sh /etc/rc.common
START=50
USE_PROCD=1
PROG=/tmp/test.sh

start_service()
{
	{
		echo '#!/bin/sh'
		echo 'logger START-$0 $$'
		echo 'sleep 10'
		echo 'logger READY-$0 $$'
	} >$PROG
	chmod +x $PROG

	procd_set_param respawn ${threshold:-20} ${timeout:-5} ${retry:-3}
	procd_open_instance
	procd_set_param command "$PROG"
	procd_close_instance
}

The script starts and ends, i can see it in syslog, but
it is not automatically restarted. Changing the exitcode
to != 0 does not change this and kill -9 $$ also does not
trigger a restart. What i'am doing wrong? when reading
https://wiki.openwrt.org/inbox/procd-init-scripts
it should work this way.

bye, bastian
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list