=== robbiew is now known as robbiew-afk === juan__ is now known as RiotingPacifist [02:27] Hello all. [02:29] I'm trying to puzzle out what the difference between 'expect fork' and 'expect daemon' is in an upstart config. [02:30] I'm writing a config for tpmd (TPM emulator daemon). When exec'd, it backgrounds itself. Using 'expect daemon' makes the start/stop commands hang, whereas 'expect fork' starts and stops the daemon as expected. [02:30] what is the actual difference between these two expects? [02:32] I'm not sure but this entry seams relevant http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/ [02:36] well, that talks about daemons and how to track them in general. I'm more looking for the distinction upstart makes between 'fork' and 'daemon'. === Md is now known as Guest11618 === Guest11618 is now known as Md === pocek_ is now known as pocek === Md is now known as Guest465 === Guest465 is now known as Md === robbiew-afk is now known as robbiew [15:10] hello [15:10] i'm trying to write an upstart job to run when my system starts up, but it never seems to run. I can run it after the system is booted and everything is fine, but i really need this to run at startup. Can someone help me out? [15:12] I don't think you will get some helpful information here. I asked some question like you a few days ago without any help. maybe you should try the mailling list next ... [15:12] rats [15:12] have you made an upstart job that has worked at boot? [15:12] I feel like im missing something that is probably obvious [15:13] like is there a command that you have to run to notify upstart that there are new scripts in /etc/init ? [15:14] i tried to create a job that should be started before kvm shutdown (i would like to shutdown some kvm guest gracefully). i was able to run the job fine via an emit event, but I wasn't able to find a way to invoke the script before kvm was killed. [15:15] hm [15:15] dang [15:17] drocko: no, this is done via inotify (and there you shouldn't need such a tool or command) [15:17] yeah that is what i figured [15:18] so let me ask you another question [15:18] the upstart doc is somewhat ... [15:18] when upstart runs these jobs, it's running them as root, right? [15:18] as fas as i know, yes. [15:18] far [15:19] http://pastebin.com/d40ca71b9 [15:19] this is my job [15:19] and it works, just not on boot [15:20] start on stopped rc[2345] -> start on runleven[2345] [15:21] runlevel [15:21] I'll try that [15:21] i dunno [15:24] wow, thanks babel. that worked! [15:25] also it means that this bullshit answer is totally wrong: https://answers.launchpad.net/upstart/+question/83223 [15:26] maybe. [15:26] yes [15:26] maybe [15:26] it's all voodoo [15:26] now, better docs would help. [15:26] yeah, you know it's the same problem with grub2 [15:26] like [15:26] and something to make a dry-run [15:26] people think that a wiki would like really be great for documentation [15:26] because everyone could read it and contribute [15:27] but really it turns into like [15:27] if the wiki is up to date that's true but. [15:27] a collection of cryptic notes [15:27] right [15:27] that are out of date [15:28] the trouble is, very few people are good at writing good documentation :) [15:29] danderson: the difference is how many forks upstart expects ;) [15:29] "expect fork" means Upstart counts one fork() [15:29] "expect daemon" means Upstart counts two fork()s [15:29] aaah. [15:29] I see. [15:29] to "properly" daemonise, a process needs to fork twice [15:29] so, this daemon I have isn't actually daemonizing properly, just forking into the background [15:29] of course, most things don't properly daemonise, so just "expect fork" is enough [15:30] right, I know; I assumed that the author of the software knew that as well :-) [15:30] the fact you need to be careful is because we use ptrace() to track this stuff [15:30] which is so less than ideal it's not even funny [15:30] (I'm just building an ubuntu package for his software, and writing the appropriate upstart config) [15:30] ouch ptrace(). [15:31] but yeah, I don't see any other way to figure that out :( [15:31] there are some good new ways [15:31] kernel proc events and stuff [15:32] hmm, is the wiki read/write? [15:32] yes [15:32] perhaps I should try to start a "configuration writing manual" with some of this knowledge [15:32] Keybuk: kernel proc events? Is that something new? reading material? [15:33] sadmac: proc connector, proc events, proc stats [15:33] just different names for the same thing [15:33] Keybuk: ah [15:35] oh, and also, while people are around: woot upstart, thank you for building it! It's so much saner than futzing with init scripts it's unbelievable. [15:39] hm [15:39] alright so next challenge. my job runs at boot, but it needs to have the network up and running for it to be successful. how can i build in a dependency like that? [15:42] try start on net-device-up [15:43] should i remove the start on runlevel [2345] or should I use both? [15:43] like start on (runlevel [2345] [15:43] and net-device-up) [15:43] ? [15:45] just start on net-device-up [15:45] since you only depend on these event. [15:46] alright let's see what happened [16:18] babel2: thanks for the help. i think I got it sorted [16:18] no problem, share your knowlegde next time with some newbie :) [16:19] yeah definitelty [16:19] upstart is cleaner than like launchd on OS X and makes a little more sense than svcs on solaris, but like the documentation has to get there [16:19] Maybe i'll add what i've found to the wiki [17:28] Keybuk: around? [17:29] yus [17:29] having a problem with karmic and bridge devices [17:30] the system in question has two bridge devices configured [17:30] which are attached to kvm instances [17:30] yeah they don't work [17:30] ah, ok [17:31] seems the libvirt-bin init script tries to start the kvm instances beforce br0 and br1 are up [17:32] yes [17:32] Keybuk: is there a solution available? [17:32] actually nothing brings up br0 and br1 [17:32] not that I know of [17:33] well, the devices are available after some time and if I add a sleep 30 inside the libvirt-bin init script, I can get it to work [17:33] this is of course fugly [17:57] is there an event when br* comes up? [17:57] net-device-added seems to be setup [17:59] net-device-up, /etc/network/if-up.d/upstart [17:59] ahh there iti s [17:59] was wondering who was emitting it [17:59] I havea network-interface (br0) start/running [17:59] and the same for br1 [17:59] I'm kind of working on the same, with init scripts for virtualbox. [18:00] Haven't yet tackled this. ;0 [19:33] Keybuk: still around? === Md is now known as Guest10675 === robbiew is now known as robbiew-afk === Guest10675 is now known as Md