Handle os signals
Added db flushing commands