Thanks, I got it.
We faced a situation when agent didn't update configuration. I've found
cause here:
[image: image.png]
This statement always returns True: ($CURRENT_CHECKSUM != $REMOTE_CHECKSUM).
When I deleted "/tmp/openwisp/checksum" then config updated (here I
confused with variables... yes, it's not $TEST_CHECKSUM).
As I understand the current algorithm of agent one cycle iteration:
1. get checksum from /tmp/openwisp/checksum to variable $CURRENT_CHECKSUM
2. request checksum from controller
3. save controller's checksum response to /tmp/openwisp/checksum (checksum
overwriting)
4. get checksum from /tmp/openwisp/checksum to variable $REMOTE_CHECKSUM
5.1. $CURRENT_CHECKSUM == $REMOTE_CHECKSUM : OK, next iteration of cycle
5.2. $CURRENT_CHECKSUM != $REMOTE_CHECKSUM: need to update configuration
6. apply configuration
7. test if we can reach controller and get test checksum
7.1. the controller was reached: OK
7.2. the controller wasn't reached: restore a backup, but checksum at
/tmp/openwisp/checksum already had overwritten. *Next configuration_changed
returns 0*.

пт, 21 сент. 2018 г. в 15:18, Federico Capoano <[email protected]>:

> See here:
>
> CONFIGURATION_CHECKSUM="$WORKING_DIR/checksum"
> TEST_CHECKSUM="$WORKING_DIR/test_checksum"
>
> TEST_CHECKSUM is not the same checksum used to understand when it's time
> to download a new config.
> The removal of the test checksum is done just to keep the in-memory
> filesystem in /tmp clean.
> Moreover, If your custom script does not download the checksum but
> performs other checks it won't need to remove it.
>
> I hope this clarifies.
> Thanks
> Fed
>
>
> On Thursday, September 20, 2018 at 10:28:16 PM UTC+2, BlancLoup wrote:
>>
>> Hi.
>> When we use custom test script instead perform_default_test() we must set
>> mandatory action: remove last checksum at /tmp/openwisp/checksum.
>> Default test function preform it at 383 line.
>> Otherwise agent will never update again (though we can change device
>> configuration at controller).
>> In my mind it's part of common logic that independent from test
>> script/function.
>> "rm $TEST_CHECKSUM" need to be setted at 352 line.
>>
>>
>> --
> 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.

Reply via email to