initctl: add a flag to make start/stop idempotent
Bug #878322 reported by
Clint Byrum
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart |
New
|
Undecided
|
Unassigned |
Bug Description
It would be useful in scripts to simply be able to say
start job --ok-no-goal-change
Which would basically mean that if its already in a goal of 'start', just return 0. This is most useful in configuration management where one just wants to make sure the job is in a start or stop goal.
To post a comment you must log in.
For the benefit of others stumbling on this, here's my workaround:
status myjob VAR=val \
| {
set -e
read name goal_status rest
case "$goal_status" in
start/*)
# no action needed
;;
*)
start myjob VAR=val
;;
esac
}