[LEDE-DEV] procd init script questions ...

Jo-Philipp Wich jo at mein.io
Wed Nov 30 12:29:30 PST 2016


Hi Dirk,

> That does not work for me. 
> 
> root at adb2go:/etc/config$ uci set firewall. at zone[1].mtu_fix='0'
> root at adb2
> go:/etc/config$ uci changes firewall
> firewall.cfg06dc81.mtu_fix='0'
> root@
> adb2go:/etc/config$ uci commit firewall

there is no inotify-esque tracking of those files.

What the trigger does is registering the uci file as change source for
the service so that an "/etc/init.d/firewall reload" or an
"reload_config" would trigger a firewall restart in case the
/etc/config/firewall got changed since the last reload.

>>> 3. Is it possible to replace normal hotplug-script functionality
>>> with
>>> 'service_triggers', i.e for iface/ifup events?
>>
>> yes
> 
> a working example would help a lot.

See package/utils/busybox/files/sysntpd, it does the following to reload
the Busybox ntpd in case any netifd-tracked interface changes:

procd_add_interface_trigger "interface.*" $n /etc/init.d/$name reload

Which translates to:

For any ubus event "interface.*" (e.g. interface.up, or interface.down)
where the value of the event's "interface" attribute is "$n", issue the
"/etc/init.d/$name reload" command.


HTH,
Jo



More information about the Lede-dev mailing list