detect which event started/stopped me

Asked by Alex Nekrasov

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:
Last query:
Last reply:
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) said :
#1

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>

Revision history for this message
Alex Nekrasov (ennnot) said :
#2

what about 0.3?

Revision history for this message
Best Scott James Remnant (Canonical) (canonical-scott) said :
#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>

Revision history for this message
Alex Nekrasov (ennnot) said :
#4

Thanks Scott James Remnant, that solved my question.