[OpenWrt-Devel] can netifd automatically restart a service?

Bruno Randolf br1 at einfach.org
Thu Jun 11 04:20:59 EDT 2015


On 06/11/2015 07:32 AM, Nikos Mavrogiannopoulos wrote:
> In issue 574 [0] there is a big discussion of the behavior of
> transmission in openwrt. To summarize it:
> * By default when transmission downloads, it may crash the router due to
> high memory consumption and OOB. That crash may lead to reboot or not.
> * To avoid that, some memory limitations can be set (such as disabling
> overcommit), and then transmission will exit, but the router would be
> functional.
> 
> I think the 2nd is quite a reasonable approach as it is more important
> to keep the router up and running than transmission (or any other
> individual service). However, a way to reduce the impact would be for
> netifd to restart transmission if crashed. Can that be done already, or
> inittab is the only option?

procd can do that. E.g. a sample init.d/service file:

#!/bin/sh /etc/rc.common

START=99

USE_PROCD=1
PROG=/usr/sbin/yourprog
CONFFILE=/etc/your.conf

start_service() {
	procd_open_instance
	procd_set_param command $PROG
	procd_set_param file $CONFFILE
	procd_set_param respawn
	procd_close_instance
}

bruno
_______________________________________________
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