Managing events with upstart

Asked by Roger

How can I start a process by stopping another process?
The scene is the next:

I'm respawning a process that captures data from a serial port and when I killed this process I need to trigger another process automatically.

How can I do this whit upstart?

I hope someone could helpme...

Greetings...
Roger

Question information

Language:
English Edit question
Status:
Solved
For:
upstart Edit question
Assignee:
No assignee Edit question
Solved by:
Jeff Oliver
Solved:
Last query:
Last reply:
Revision history for this message
Best Jeff Oliver (jeffrey-oliver) said :
#1

In upstart 0.5.0, you can do something like.

start foo on stopping bar

This would start foo up when bar was in the process of shutting down.

I'm not sure if you can do that same in 0.3.9+.

Revision history for this message
Roger (rogerssm) said :
#2

thanks for the answer, however I make the next solution:
1.- I create an event with the next lines:

start on startup
start on runlevel [!0]

exec /path to binary1
respawn

2.- An the second event:

start on stopped binary1

exec /path to binary2

...At least this works....

Thanks anyway...

Revision history for this message
Roger (rogerssm) said :
#3

Thanks Jeff Oliver, that solved my question.