detect which event started/stopped me

Asked by Alex Nekrasov on 2009-02-13

I have a number of events that stop a components:

stop on stopped comp1 failed
stop on stopped comp2 failed
stop on stopped comp3 failed

post-stop script
    case "$reason" in
    comp1)
    ;;
    comp2)
    ;;
    comp3)
    ;;
    esac
end script

How do I populate the $reason?

Question information

Language:
English Edit question
Status:
Solved
For:
upstart Edit question
Assignee:
No assignee Edit question
Solved by:
Scott James Remnant (Canonical)
Solved:
2009-03-02
Last query:
2009-03-02
Last reply:
2009-03-02

On Fri, 2009-02-13 at 14:22 +0000, Alex Nekrasov wrote:

> I have a number of events that stop a components:
>
> stop on stopped comp1 failed
> stop on stopped comp2 failed
> stop on stopped comp3 failed
>
> post-stop script
> case "$reason" in
> comp1)
> ;;
> comp2)
> ;;
> comp3)
> ;;
> esac
> end script
>
> How do I populate the $reason?
>
This is $UPSTART_STOP_EVENTS in 0.5

Scott
--
Scott James Remnant
<email address hidden>

Alex Nekrasov (ennnot) said : #2

what about 0.3?

On Fri, 2009-02-27 at 20:50 +0000, Alex Nekrasov wrote:

> Question #60891 on upstart changed:
> https://answers.launchpad.net/upstart/+question/60891
>
> Status: Answered => Open
>
> Alex Nekrasov is still having a problem:
> what about 0.3?
>
I'm not sure that 0.3 provides this information reliably.

Scott
--
Scott James Remnant
<email address hidden>

Alex Nekrasov (ennnot) said : #4

Thanks Scott James Remnant, that solved my question.