/srv/irclogs.ubuntu.com/2013/11/28/#upstart.txt

wrale1hi.. 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
quizmeI'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
xnoxquizme: /usr/share/upstart/session/* jobs are only in effect in graphical user sesions.22:34
xnoxquizme: use e.g. $ initctl --system list22:34
xnoxor $ initctl --user list22:34
xnoxto tell them appart.22:34
quizmexnox oh22:34
xnoxquizme: similarly $ initctl --system start | stop | restart, etc.22:35
quizmexnox is there a way to enable them on the server ?22:35
xnoxquizme: 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
xnoxquizme: 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
xnoxbut it should work =)22:36
quizmebasically, 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
quizmewell 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 mean22:39
quizmexnox: what do u think?22:39
quizmexnox should i just use bash+cron minus upstart ?22:40
xnoxquizme: there was a plan for temporal/periodic events.22:43
xnoxquizme: one thing you need to keep in mind is that - you  cant start a running job again.22:43
xnoxquizme: 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
xnoxquizme: cron is reliable way to do stuff.22:44
xnoxquizme: you can instead emit events if you want via cron. E.g. cron every midnight to do $ initctl emit FOX_SAYS=midnight22:45
xnoxor simly $ initctl emit midnight22:45
xnoxand then your jobs can do "star on midnight" or "start on FOX_SAYS=midnight" or "start on FOX_SAYS"22:46
quizmeoh yeah that's interesting22:46
quizmethen when upstart takes over cron, my script will already work 22:46
xnoxquizme: 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
quizmexnox oh, ok, i thought it was going to take over cron, and then the world.23:53
xnoxquizme: no, upstart is event based init system. And it does events and it does init.23:53
xnoxquizme: 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
xnoxThis 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!