added HAYSTACK_SIGNAL_PROCESSOR and building indexes in before_restart