Start/stop as arguments to the job

Asked by Seshu Reddy Cheedepudi

Please excuse if this is trivial/implicit/already documented. But, my question is how can I pass the start/stop as an input argument to the job in an upstart task?

Eg:
start on starting gdm
stop on stopped gdm

exec /etc/mybashscript <start/stop based on event this is executed>

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
Best Scott James Remnant (Canonical) (canonical-scott) said :
#1

They already are arguments, the events are made of environment variables, e.g.

 start on starting gdm

 exec echo $UPSTART_START_EVENTS $JOB

Revision history for this message
Seshu Reddy Cheedepudi (sreddy) said :
#2

Thanks Scott James Remnant (Canonical), that solved my question.