/srv/irclogs.ubuntu.com/2012/03/06/#upstart.txt

FourAMHello all, I'm on a system with 1.3, and I was wondering if a script I trigger with cron can somehow see env vars of a running job; right now I'm `touch`ing files to use as flags (similar to an /etc/nologin) and I think it feels messy.02:39
FourAMI know I can pass values with events/when starting and I can start on starting ENV_VAR='something' but when I trigger a job from cron i need to read the state of another job (to decide if i want the cron's job to continue)02:42
bradleyayersFourAM: just use "status foo"12:08
KiallHeya, is there somewhere that upstart keeps some kind of state? Trying to write a job and it keeps stalling while starting .. So.. I deleted the job config, re-ran stop.. and is seems to still know about the job?16:28
SpamapSKiall: yes running jobs are kept in memory16:28
KiallSpamapS: aha, so what would I need to restart?16:29
KiallI was looking for how upstart itself was started, but havent found it yet16:29
SpamapSKiall: once you stop a job that has been removed, it should cease to exist16:29
SpamapSKiall: upstart is run as the init daemon of the system16:29
SpamapSKiall: so its started before *everything else*16:30
Kiall"stop: Job has already been stopped: .."  yet, the /etc/init/.conf file as been removed. Is that normal?16:30
KiallI'm not sure if that means it still knows something about the job?16:31
SpamapSKiall: status 'job' will tell you what it knows about the job16:40
KiallSpamapS: yea, "graylog2-server stop/killed, process 15009" and "/etc/init/graylog2-server.conf: No such file or directory"16:41
Kiall(the and part was me doing an ls..)16:41
SpamapSKiall: ok, so its waiting for the process, 15009, to die16:42
KiallYea - I had thought that too, but 15009 doesnt exist16:42
SpamapSKiall: ahh, you may have used the wrong expect syntax, thats a known evil bug16:43
Kiall150* doesnt even exist16:43
Kialldooh 16:43
KiallOkay, any way to sort it without a reboot? :)16:43
SpamapSthere's a lame workaround16:43
SpamapSKiall: you have to get that pid to re-appear16:44
SpamapSKiall: so you can do it with a program that just exhausts the pid space16:45
SpamapSKiall: not exhausts, but, rolls it over16:45
KiallLol - Any suggestions for a script/tool/etc to do what? or will a while true; do echo "."; done handle that?16:46
SpamapSKiall: bug 406397 has a link to a ruby script that does it16:46
* SpamapS is looking for a python version he wrote16:46
SpamapSKiall: echo is a bash builtin, so no ;)16:46
Kiallbut the "true" is /bin/true ;)16:47
Kiallunless bash has that too -_-16:47
SpamapSKiall: yeah that might work16:47
KiallFound that ruby script anyway, it seems to stop at the right pid etc which is always handy :)16:47
SpamapSKiall: even better, just keep spawning status on your job and grepping it16:48
SpamapSKiall: while status foo | grep pid ; do : ; done16:48
Kiallwoot - "Unknown Job:" :)16:49
Kialland its all fixed+worked.. Thanks :)16:50
KiallThis would have driven me nuts for hours!16:50
SpamapSKiall: yeah its a pretty confusing bug. :(16:56
KiallThats for sure ;)16:56
KiallI was wondering why *nothing* i did in the job config would make it work.. Eventually (20-30 mins later) figured some sort of state was being kept ;_16:57
=== marrusl_ is now known as marrusl

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!