[LEDE-DEV] procd init script questions ...
Dirk Brenken
dibdot at gmail.com
Wed Nov 30 12:47:16 PST 2016
Am Mittwoch, den 30.11.2016, 21:29 +0100 schrieb Jo-Philipp Wich:
Hi Jo,
thank you very much for clarification and a quite good example.
br
dirk
> 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
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
>
More information about the Lede-dev
mailing list