I think it's because the configuration options are passed as arguments to the process in the init.d script and probably when the process is reloaded the arguments are not updated. We may need to read the configuration directly in the process instead of doing it in the init.d script. In retrospective, doing it into the init.d script was probably a bad idea since the agent only works with OpenWRT. If the agent had to work with other systems as well it should have converted the UCI config to an internal config which would have had to be read by the process. Since at the moment the agent only works with OpenWRT we can probably just read the UCI config directly when the process starts.
I'm not 100% this is the reason so we'll need further investigation. Fed On Fri, Oct 19, 2018 at 4:59 PM Oliver Kraitschy <[email protected]> wrote: > Hi Federico, > > that's my impression as well. > > I will have a look as soon as I have the time. > > Greetings, > Oliver > > On Fri, Oct 19, 2018 at 03:38:13PM +0200, Federico Capoano wrote: > > I guess the reload_service function in the init.d script is not working > as > > expected :( > > > > > > Il ven 19 ott 2018, 13:21 Oliver Kraitschy <[email protected]> ha > scritto: > > > > On Thu, Oct 18, 2018 at 09:31:35AM -0700, Federico Capoano wrote: > > > > > the easiest way you can do what you want is to have a template in > > OpenWISP > > > which modifies the interval of the agent with the following > template > > (flagged > > > as default): > > > > > > { > > > "openwisp": [ > > > { > > > "config_name": "controller", > > > "config_value": "http", > > > "interval": 43200 > > > } > > > ] > > > } > > > > Hi Federico, > > > > did you test this? I just tried this but it doesn't work as expected. > > > > When a new device is registered at the controller, the template is > applied > > and the interval in the openwisp config is set to the value defined > in the > > template. > > But the new interval is not used until I manually restart > > openwisp-config. > > > > Greetings, > > Oliver > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "OpenWISP" group. > > To unsubscribe from this group and stop receiving emails from it, > send an > > email to [email protected]. > > For more options, visit https://groups.google.com/d/optout. > > > > -- > > You received this message because you are subscribed to the Google Groups > > "OpenWISP" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email > > to [email protected]. > > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "OpenWISP" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "OpenWISP" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
