save state to file when signaled using SIGUSR1