Upstart provides support for starting jobs based on an events arguments:
start on custom-event NAME=foo
This will only start the job when custom-event
is emitted and the argument NAME
has the value foo
.
It also provides as way to start on a set of arguments:
start on custom-event QUANTITY=[12]
This will only start the job when custom-event
is emitted argument QUANTITY
has either value 1
or 2
.
I can't figure out how to provide a relation operator:
start on coretemp TEMP>60
stop on coretemp TEMP<50
The idea here is to start this job (a task really) when the cpu core temp gets too large.
I would not be surprised if upstart did not yet support arithmetic relation operators. However this syntax does not work either.
start on coretemp TEMP=[60,61,62,63,...,79,80]
stop on coretemp TEMP=[30,31,32,33,...,49,50]
Am I way off base, trying to make upstart do something it was never meant to do?
So far my only workable solution is to have my temperature monitoring daemon emit custom events:
coretemp-above-60
coretemp-below-50