Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I run into an issue with upstart where I want to update an init config, but just restarting the job doesn't apply the changes.

For example:

  • I've got job xyz running
  • I modify the /etc/init/xyz.conf to do something in pre-stop.
  • The job gets restarted with restart xyz
  • pre-stop part is not executed

I tried reloading the config with initctl reload-configuration, but it didn't have any effect. If I manually stop and start the job in two separate steps, things work as expected.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

According to the documentation, the pre-stop stanza is only executed before a stop command, not during a (warm) restart.

Description: Command executed when a job in running state gets stopped (initctl stop or stop on event). 

Depending on what you are trying to do you may not be able to avoid this behavior.

share|improve this answer
    
well spotted, thanks –  viraptor Apr 12 '12 at 15:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.