add on_exit hook
sync documentation

generally speakiing people shouldn't update the settings.rst but make
sure that settings.p is correctly filled.