Adding a wait loop to the upstart tempalte