add a startup script

fix bugs related to re-initiating leader election
after election is hold by a process with higher ID