wrale1 | hi.. i'm looking to use an upstart job (task?) to run a program (ansible-pull) periodically, in an end-to-end fashion. that is, i want ansible-pull to run all the way through before the next run begins. also, i'd like a sleep period to expire after ansible-pull runs.. i think i understand most of what i need to know.. however, i'm unsure of how best to do the loop.. it seems respawn only works for exit non-zero.. any ideas? | 17:37 |
---|---|---|
quizme | I'm writing a custom task. In the upstart cookbook, it says that session jobs will be looked for in /usr/share/ustart/sessions, but I put a job there and it's not in the list of upstart jobs as advertised in the upstart cookbook. but if i put my job in /etc/init, it's there. :~( | 20:59 |
xnox | quizme: /usr/share/upstart/session/* jobs are only in effect in graphical user sesions. | 22:34 |
xnox | quizme: use e.g. $ initctl --system list | 22:34 |
xnox | or $ initctl --user list | 22:34 |
xnox | to tell them appart. | 22:34 |
quizme | xnox oh | 22:34 |
xnox | quizme: similarly $ initctl --system start | stop | restart, etc. | 22:35 |
quizme | xnox is there a way to enable them on the server ? | 22:35 |
xnox | quizme: not really no, but there is a hack/workaround in the cookbook as how to do it. (basically a system job that auto-launches per-user session for the users you want it for) | 22:35 |
xnox | quizme: it's a bit tricky, because on terminal login, you need to query the UPSTART_SESSION var & set it for your self & also get some other vars. | 22:36 |
xnox | but it should work =) | 22:36 |
quizme | basically, I'm writing an application-specific task that i want to run once per hour. for some reason I was thinking to use upstart instead of cron, is that wrong-headed ? | 22:37 |
quizme | well i was planning to make an upstart task, then call the upstart task from cron. Then an upstart even would fire when it was finished and run another job. | 22:39 |
quizme | "upstart event would fire" i mean | 22:39 |
quizme | xnox: what do u think? | 22:39 |
quizme | xnox should i just use bash+cron minus upstart ? | 22:40 |
xnox | quizme: there was a plan for temporal/periodic events. | 22:43 |
xnox | quizme: one thing you need to keep in mind is that - you cant start a running job again. | 22:43 |
xnox | quizme: so your cron job can be: stop myjob; sleep 10; start myjob. and cron it to run once a day or some such. | 22:44 |
xnox | quizme: cron is reliable way to do stuff. | 22:44 |
xnox | quizme: you can instead emit events if you want via cron. E.g. cron every midnight to do $ initctl emit FOX_SAYS=midnight | 22:45 |
xnox | or simly $ initctl emit midnight | 22:45 |
xnox | and then your jobs can do "star on midnight" or "start on FOX_SAYS=midnight" or "start on FOX_SAYS" | 22:46 |
quizme | oh yeah that's interesting | 22:46 |
quizme | then when upstart takes over cron, my script will already work | 22:46 |
xnox | quizme: i don't think upstart will take over cron =) instead it will provide interface akeen of "start on every 5 minutes" or "start on 10 minutes after runlevel=2" | 23:45 |
quizme | xnox oh, ok, i thought it was going to take over cron, and then the world. | 23:53 |
xnox | quizme: no, upstart is event based init system. And it does events and it does init. | 23:53 |
xnox | quizme: you may be thinking of systemd software collection, that project has an index page of daemons/commands that is does and plans to add even more http://www.freedesktop.org/software/systemd/man/ | 23:56 |
xnox | This index contains 296 entries, referring to 144 individual manual pages. | 23:56 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!