/srv/irclogs.ubuntu.com/2009/12/03/#upstart.txt

=== robbiew is now known as robbiew-afk
=== juan__ is now known as RiotingPacifist
dandersonHello all.02:27
dandersonI'm trying to puzzle out what the difference between 'expect fork' and 'expect daemon' is in an upstart config.02:29
dandersonI'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
dandersonwhat is the actual difference between these two expects?02:30
juan__I'm not sure but this entry seams relevant http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/02:32
dandersonwell, that talks about daemons and how to track them in general. I'm more looking for the distinction upstart makes between 'fork' and 'daemon'.02:36
=== 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
drockohello15:10
drockoi'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:10
babelI 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
drockorats15:12
drockohave you made an upstart job that has worked at boot?15:12
drockoI feel like im missing something that is probably obvious15:12
drockolike is there a command that you have to run to notify upstart that there are new scripts in /etc/init ?15:13
babeli 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:14
drockohm15:15
drockodang15:15
babeldrocko: no, this is done via inotify (and there you shouldn't need such a tool or command)15:17
drockoyeah that is what i figured15:17
drockoso let me ask you another question15:18
babelthe upstart doc is somewhat ...15:18
drockowhen upstart runs these jobs, it's running them as root, right?15:18
babelas fas as i know, yes.15:18
babelfar15:18
drockohttp://pastebin.com/d40ca71b915:19
drockothis is my job15:19
drockoand it works, just not on boot15:19
babelstart on stopped rc[2345] -> start on runleven[2345]15:20
babelrunlevel15:21
drockoI'll try that15:21
drockoi dunno15:21
drockowow, thanks babel. that worked!15:24
drockoalso it means that this bullshit answer is totally wrong: https://answers.launchpad.net/upstart/+question/8322315:25
babelmaybe.15:26
drockoyes15:26
drockomaybe 15:26
drockoit's all voodoo15:26
babelnow, better docs would help.15:26
drockoyeah, you know it's the same problem with grub215:26
drockolike15:26
babeland something to make a dry-run15:26
drockopeople think that a wiki would like really be great for documentation15:26
drockobecause everyone could read it and contribute15:26
drockobut really it turns into like15:27
babelif the wiki is up to date that's true but.15:27
drockoa collection of cryptic notes 15:27
drockoright15:27
drockothat are out of date15:27
Keybukthe trouble is, very few people are good at writing good documentation :)15:28
Keybukdanderson: the difference is how many forks upstart expects ;)15:29
Keybuk"expect fork" means Upstart counts one fork()15:29
Keybuk"expect daemon" means Upstart counts two fork()s15:29
dandersonaaah.15:29
dandersonI see.15:29
Keybukto "properly" daemonise, a process needs to fork twice15:29
dandersonso, this daemon I have isn't actually daemonizing properly, just forking into the background15:29
Keybukof course, most things don't properly daemonise, so just "expect fork" is enough15:29
dandersonright, I know; I assumed that the author of the software knew that as well :-)15:30
Keybukthe fact you need to be careful is because we use ptrace() to track this stuff15:30
Keybukwhich is so less than ideal it's not even funny15:30
danderson(I'm just building an ubuntu package for his software, and writing the appropriate upstart config)15:30
dandersonouch ptrace().15:30
dandersonbut yeah, I don't see any other way to figure that out :(15:31
Keybukthere are some good new ways15:31
Keybukkernel proc events and stuff15:31
dandersonhmm, is the wiki read/write?15:32
Keybukyes15:32
dandersonperhaps I should try to start a "configuration writing manual" with some of this knowledge15:32
sadmacKeybuk: kernel proc events? Is that something new? reading material?15:32
Keybuksadmac: proc connector, proc events, proc stats15:33
Keybukjust different names for the same thing15:33
sadmacKeybuk: ah15:33
dandersonoh, 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:35
drockohm15:39
drockoalright 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:39
babeltry start on net-device-up15:42
drockoshould i remove the start on runlevel [2345] or should I use both?15:43
drockolike start on (runlevel [2345]15:43
drockoand net-device-up)15:43
drocko ?15:43
babeljust start on net-device-up15:45
babelsince you only depend on these event.15:45
drockoalright let's see what happened15:46
drockobabel2: thanks for the help. i think I got it sorted16:18
babel2no problem, share your knowlegde next time with some newbie :)16:18
drockoyeah definitelty16:19
drockoupstart 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 there16:19
drockoMaybe i'll add what i've found to the wiki16:19
mbieblKeybuk: around?17:28
Keybukyus17:29
mbieblhaving a problem with karmic and bridge devices17:29
mbieblthe system in question has two bridge devices configured17:30
mbieblwhich are attached to kvm instances17:30
Keybukyeah they don't work17:30
mbieblah, ok17:30
mbieblseems the libvirt-bin init script tries to start the kvm instances beforce br0 and br1 are up17:31
Keybukyes17:32
mbieblKeybuk: is there a solution available?17:32
Keybukactually nothing brings up br0 and br117:32
Keybuknot that I know of17:32
mbieblwell, 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 work17:33
mbieblthis is of course fugly17:33
wasabiis there an event when br* comes up?17:57
wasabinet-device-added seems to be setup17:57
ionnet-device-up, /etc/network/if-up.d/upstart17:59
wasabiahh there iti s17:59
wasabiwas wondering who was emitting it17:59
mbieblI havea network-interface (br0) start/running17:59
mbiebland the same for br117:59
wasabiI'm kind of working on the same, with init scripts for virtualbox.17:59
wasabiHaven't yet tackled this. ;018:00
mbieblKeybuk: still around?19:33
=== Md is now known as Guest10675
=== robbiew is now known as robbiew-afk
=== Guest10675 is now known as Md

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