It doesn't work however, if I change the radio channel from luci (or by editing config file and reloading wifi) the service isn't triggered (nothing in the log). I see wlan0 going down and coming back up with the new configuration, but my server isn't triggered. What do I need to do to have service triggered by the change in wireless configuration?
Second question, while looking up PROCD articles I found a lot of examples where procd_open_trigger/procd_close_trigger are not used. What's the correct use of the procd_open_trigger/procd_close_trigger? Is it only needed for some triggers and not the others?
From my point of view the additional procd_open/close_trigger stuff is not needed. If you check procd.sh you'll see that trigger open/close calls are already part of the procd_close_service function.
I do not fully understand what you're trying to achieve, therefore only some general remarks:
your "service" (/bin/echo) isn't running, you can always check that with (verbosity prints the trigger settings, too) ... ubus call service list '{"name":"test","verbose": true}'
maybe you have a wrong expectation regarding reload trigger (like me in 2016 ), see here Jo's answer on the mailing list
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.
Set PROCD_DEBUG=1 to see debugging information when starting or stopping a procd init script.