Skip to main content

Thread: Upstart job: Run task once per event instead of just once


note: asked question here without answer: http://askubuntu.com/questions/22119...once-per-event .

i'm little confused regarding how jobs start on upstart events. illustrate misunderstanding, have 4 upstart jobs following:

job 1:
code:
start on local-filesystems  task  script     echo "job 1 ran" >> /tmp/job1 end script
job 2:

code:
start on (local-filesystems , net-device-added)  task  script     echo "job 2 ran" >> /tmp/job2 end script
job 3:

code:
start on (local-filesystems , bluetooth-device-added)  task  script     echo "job 3 ran" >> /tmp/job3 end script
job 4:

code:
start on local-filesystems or (local-filesystems , net-device-added) or (local-filesystems , bluetooth-device-added)  task  script     echo "job 4 ran" >> /tmp/job4 end script
i expect following file contents after reboot:

/tmp/job1:

code:
job 1 ran
/tmp/job2:

code:
job 2 ran
/tmp/job3:

code:
job 3 ran
/tmp/job4:

code:
job 4 ran job 4 ran job 4 ran
i expect job 4 have ran 3 times because can started 3 separate sets of events, of occur proven other jobs. expectations incorrect; files contain following:

/tmp/job1:

code:
job 1 ran
/tmp/job2:

code:
job 2 ran
/tmp/job3:

code:
job 3 ran
/tmp/job4:

code:
job 4 ran
why job4 being run once, though 3 sets of events occurring? there way achieve behavior of running job whenever of signals occur, regardless of how many times job runs? if helps, edited print out $upstart_events variable see events causing job 4, , it's local-filesystems.

summarize: job 4 run on local-filesystems event, , on net-device-added event (as long local_filesystems has occurred well), , on bluetooth-device-added event (as long local_filesystems has occurred). how make happen?

thank you!



Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] Upstart job: Run task once per event instead of just once


Ubuntu

Comments

Popular posts from this blog

Is this Captcha code corrupt?

How to Grab email address from webform and insert into form action

Thread: lower arc in openoffice draw