[OpenWrt-Devel] Automatic service reload

Florian Eckert eckert.florian at googlemail.com
Wed Sep 23 02:22:42 EDT 2015


You have call the shell script in der /sbin/reload_config
Am 23.09.2015 4:56 vorm. schrieb "Lars Boegild Thomsen" <
lth at bright-things.com>:

> Hi Everybody,
>
>
>
> I am struggling a bit with triggering automatic service reload based on
> configuration change.
>
>
>
> Latest trunk and all that jazz. New software package called "mqttbridge"
> which basically is meant to publish ubus method results to mqtt. Init is in
> /etc/init.d/mqttbridge, config in /etc/config/mqttbridge.
>
>
>
> In the "olden days" this was all defined in /etc/config/ucitrack -
> something along this line:
>
>
>
> config mqttbridge
>
> option init mqttbridge
>
>
>
> However, according to this:
>
>
>
>
> http://wiki.openwrt.org/inbox/procd-init-scripts#procd_triggers_on_config_filenetwork_interface_changes
>
>
>
> It would appear that ucitrack is no longer used? I have also tried the
> service_triggers in the init script:
>
>
>
> root at pm2:/etc/config# cat /etc/init.d/mqttbridge
>
> #!/bin/sh /etc/rc.common
>
>
>
> START=90
>
>
>
> USE_PROCD=1
>
> NAME=mqttbridge
>
> PROG=/usr/sbin/mqttbridge
>
>
>
> start_service()
>
> {
>
> procd_open_instance
>
> procd_set_param respawn
>
> procd_set_param command "$PROG"
>
> procd_close_instance
>
> }
>
>
>
> service_triggers()
>
> {
>
> procd_add_reload_trigger "mqttbridge"
>
> }
>
>
>
> The thing is - neither approach (or rather both of them) works. Manual
> "/etc/init.d/mqttbridge" restart works fine, but automatic reload is never
> triggered on configuration change.
>
>
>
> What did I miss and what is the correct approach.
>
>
>
> --
>
> Lars Bøgild Thomsen
>
> Public Key: http://bright-things.com/lars-bogild-thomsen/
>
> _______________________________________________
> 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/20150923/72d393ad/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