[OpenWrt-Devel] Q: procd / respawn if process dies
Yousong Zhou
yszhou4tech at gmail.com
Tue Dec 8 09:53:19 EST 2015
Am 08.12.2015 22:45 schrieb "Bastian Bittorf" <bittorf at bluebottle.com>:
>
> 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
respawn is an instance attribute, moving that statement inside the
open/close instance block should do the job
yousong
> }
>
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20151208/61762ff8/attachment.htm>
-------------- next part --------------
_______________________________________________
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