/srv/irclogs.ubuntu.com/2012/09/27/#upstart.txt

j4m3si'm trying to set the priority of a process in my upstart script with nice and it doesn't appear to be taking04:16
j4m3swhere does one typically put the 'nice <priority>' setting in an upstart script?04:26
=== ion_ is now known as ion
=== zz_Kiall is now known as Kiall
=== Kiall is now known as zz_Kiall
=== zz_Kiall is now known as Kiall
SpamapSj4m3s: its a root level keyword, so just put it anywhere outside a script stanza.14:50
MFeni'm trying to set up an upstart job for bip15:18
MFeni've carefully studied http://upstart.ubuntu.com/cookbook/#implications-of-misspecifying-expect and even did the test described here.. http://upstart.ubuntu.com/cookbook/#how-to-establish-fork-count which demonstrated that bip forks twice (is a daemon)15:18
SpamapSMFen: ^5 for reading the cookbook. :)15:19
MFenso i'm using expect daemon. according to that chart, i shouldn't be getting a hang (even if i'm wrong), but i am15:19
MFenany double-secret troubleshooting tips available? :)15:19
MFenSpamapS: ltns :) ... i think we used to chat in #linux15:20
MFenloooong ago15:20
SpamapSor #linuxhelp15:20
MFenyeah15:20
SpamapSwhich I still lurk in, just in case somebody wants to reminisce ;)15:21
SpamapSMFen: do you have the output of your fork test handy?15:21
MFenno but i'll run it again15:21
MFenwell, yeah. the output was "2" :)15:21
SpamapSI mean the strace.log15:22
MFensure15:22
SpamapSthe grep for fork/clone may be wrong15:22
MFenok15:22
SpamapSHave seen at least one program that does clone that is actually doing threads15:22
MFenoh, heh. gotta log in to irc directly if i'm going to do this. brb15:23
SpamapSMFen: also, about 90% of daemons fork way too soon anyway, and so the 'expect fork|daemon' is actually not really accurate.. does bip have a "run without daemonizing" mode?15:23
SpamapSMFen: just use pastebinit ?15:23
MFenbip has a -n15:23
MFeni'll pastebin it, but bip is an irc multiplexer that i'm using right now15:24
SpamapSOh hah ok15:24
SpamapSMFen: hang on tho15:24
MFenk15:24
SpamapSMFen: consider just using -n15:24
MFentried that too (with no expect)15:24
MFeniirc what happens in that case is it hangs on stop15:24
SpamapSMFen: the only drawback to that over expect fork/daemon is that the job will be considered "started" as soon as it forks/execs bip15:24
MFenit was doing a weird thing where it would hang, but stop anyway15:24
SpamapSMFen: does it not respect SIGTERM ?15:25
MFenso i ^C then stop again and it says it's already stopped15:25
MFenit does when i run it straight from a command line15:25
SpamapS^C is SIGINT , which is often handled differently than SIGTERM, which is what upstart sends before SIGKILL15:25
MFenoh i see. ok, i can find out what SIGTERM does15:26
MFenbrb15:26
=== moonfallen is now known as mfen
mfen alll right15:29
mfenkill -15 works fine on bip -n15:30
SpamapSalright15:31
SpamapSmfen: then the only other thing to consider is that things that want to 'start on started bip' may not actually be able to contact bip's network port... so if you want to support that type of behavior, you have to add a post-start which polls bip until its actually available.15:31
SpamapSmfen: note that even sshd suffers from that race.. so don't feel like you have to add a post-start15:32
SpamapSmfen: also test SIGHUP15:32
SpamapSmfen: as that is what reload sends15:32
mfenthe strace.log is 22k lines15:33
SpamapSmfen: pastebinit < strace.log ;)15:33
mfendid not know that15:34
SpamapSits a beautiful tool15:35
SpamapSwish we had it 10 years ago in #linuxhelp15:35
mfenkill -HUP has no effect15:36
mfenhmm. i got http://paste.ubuntu.com/ as the output of pastebinit15:37
mfeni'm guessing that was supposed to have a unique identifier in it15:37
mfeni'll just put it in dropbox15:37
mfenhttps://dl.dropbox.com/u/19400544/goonmill.org/strace.log15:38
mfenbah, that can't be right15:38
SpamapSmfen: its possible the pastebin didn't like 22k lines ;)15:39
mfenyeah15:39
mfendropbox doesn't either afaict15:40
SpamapS21730 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xf72f2968) = 2173115:40
SpamapSThats a thread15:40
mfenok15:40
mfenso is this actually a fork?15:40
SpamapSProbably need to update the cookbook15:40
SpamapSmfen: no15:40
mfenthe thing is, i've tried all three15:41
SpamapSwell it might be15:41
SpamapSI have never understood how clone turns into fork15:41
SpamapSit does.. sometimes.. but ... whenever I see it.. expect doesn't work. I think ptrace gets confused15:41
SpamapSmfen: you're better off with -n15:42
mfenall right, here's the whole bip.conf now:15:42
mfensetuid cdodt15:42
mfenchdir /home/cdodt15:42
mfenexec bip -n15:42
mfenthat hangs when i start15:43
mfeneven simpler version. just this: exec sudo -u cdodt -i bip -n ... also hangs when i start15:46
mfeni tried strace -fF -p 1 ...... i'm seeing read(3, ...)  = -1 EAGAIN 16:00
mfenlots of those repeated16:00
mfenthat's when i try to start bip16:01
mfencustom upstart jobs seem to work fine, e.g. "exec sleep 10000" works as i expect it to work16:18
mfenthis is a virtual server, i've seen some suggestions that virtual servers have issues, but nothing else is having an issue but bip16:18
mfeni'm going to try wrapping it in a script, perhaps that script will behave better16:18
mfenall right, here's a possible clue.. every time i run bip status, it gives me the status for process 466716:21
mfeni think it started with that pid at some point when i was working on this yesterday16:21
mfenin all the attempts since then, status bip hasn't looked at a different pid16:21
mfeni'm rebooting to see if i can clear it16:21
mfenahhhhhhhhhhhhhhh it works now16:24
mfenok so here's what i think happened: i started bip with no expect yesterday. it did its thready-fork thing, and upstart lost track of it, but remembered the pid of 466716:25
mfenafter that point, upstart was trying to operate on that pid and getting confused16:25
mfenthis looks like a bug in upstart to me.. i don't see any way to truly clear the status of a job16:25
MFenso there ya go.16:28
SpamapSMFen: thats a well known, very old bug17:18
SpamapS:(17:18
SpamapSMFen: if you get expect wrong, you get a mis-remembered pid17:19
SpamapSMFen: and as yet, there's no way to tell upstart to forget said pid17:19
* jMCg subscribes to upstart-devel@22:21

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