Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to know within the script if the job in question was killed(crashed) or stopped normaly.

I want to kill another process in post-stop script only when the current job crashed and not when it was stopped using stop "task-A"

share|improve this question

See my other answer: Customizing upstart "restart" commands

Make a task-B that has start condition as start on stopping task-A RESULT=failed and do the killing there, or just add to your to-be-killed job a stop gracefully on stop on stopping task-A RESULT=failed.

More in Cookbook.

share|improve this answer
Thanks added a new task. – Andy May 30 '13 at 12:27
If it worked for you, please accept the answer to signal you have received help. – Tuminoid May 31 '13 at 4:00

Your Answer


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.