Add more checks and conditionalize the upstart script based on available vars.