/srv/irclogs.ubuntu.com/2007/05/17/#upstart.txt

=== phoenix24_ [n=phoenix2@59.176.13.153] has joined #upstart
=== Amaranth [n=travis@ubuntu/member/Amaranth] has joined #upstart
=== Keybuk [n=scott@wing-commander.netsplit.com] has joined #upstart
Keybuk*yawn*04:15
=== phoenix24 [n=phoenix2@59.176.7.241] has joined #upstart
=== Md [i=md@freenode/staff/md] has joined #upstart
=== juergbi [n=juerg@80-219-18-22.dclient.hispeed.ch] has joined #upstart
=== JohnFlux [n=JohnFlux@konversation/developer/JohnFlux] has joined #upstart
=== tale [n=tale@207.235.54.1] has joined #upstart
=== phoenix24 [n=phoenix2@59.176.27.187] has joined #upstart
=== rawler [n=ulrik@c-7b4ee155.98-2-64736c13.cust.bredbandsbolaget.se] has joined #upstart
=== rawler [n=ulrik@c-7b4ee155.98-2-64736c13.cust.bredbandsbolaget.se] has joined #upstart
=== Keybuk [n=scott@wing-commander.netsplit.com] has joined #upstart
=== Keybuk had some interesting thoughts today
AlexExtremeoh?08:04
Keybukso the problem I've been having is trying to understand how to define when a job is running08:06
Keybukand also define for instance jobs when instances are spawned and destroyed08:06
Keybukwhich involves quite complex combinations of events08:07
Keybukand I've been increasingly wondering whether events are the right things to track, and whether we should instead deal with states08:08
Keybuke.g. rather than "initctl emit tty-added tty1", you'd "initctl set tty-exists tty1 true" or something08:08
Keybuk(since then jobs would become just lists of and/or around states)08:08
Keybukbut after some thought, I've decided against that08:09
Keybukbecause we are really receiving events, and trying to fob off turning them into states to the emitter is a bit crap08:10
AlexExtremeright08:10
Keybukso having decided that upstart should still receive events08:11
Keybukthat means upstart has to deal with turning events into states08:11
Keybukand so far I've been trying to define these states through Job08:12
Keybukthis, I think, is wrong08:12
Keybukinstead I think we should make State a first class08:13
Keybukand have a way to describe a State, with reference to one or more Events08:13
Keybukwhich means Job would just make reference to a State in which it was running08:14
Keybukthen instance jobs could optionally just have two State *, one for when instances exist, and the other for when those instances are running08:15
Keybuke.g. the getty job08:15
Keybukinstances exist for each state tty-added ... tty-removed for a unique $TTY08:16
Keybukand those instances are *running* for the "user can login" state (defined elsewhere)08:16
Keybukthis makes Job rather simpler08:17
AlexExtremesounds good08:20
Keybukin fact, I'm considering splitting Job up a bit more, so that the dealing with instances and replacement jobs is at a higher level clas08:20
Keybukat the very least, we'd have Job -> State -> Event08:20
Keybukand we have a good grip above on how to define State08:21
ion_Sounds good indeed.08:21
Keybukit's a combination of periods of events08:21
Keybukeach item has an Event to be matched, and a pointer to the the EventEmission that matched it08:22
Keybukevents on the right-side of the period should be able to reference the emission in the left-side08:23
Keybuke.g.  tty-added tty[1-6]  -> tty-removed $TTY08:23
Keybukthis therefore implies that the state has a value at any given time08:24
Keybukwhich is the environment of any left side not cancelled out by a right side08:26
Keybukso we can pass that on to the job08:28
Keybukonce the rhs is filled, we can discard the emission on the left since that needs to happen again08:36
Keybukso we actually just need three pointers, start_event, stop_event and emission08:37
Keybukand not bother retaining the emission for the stop event, since that just cancels the start one08:37
Keybukwe then just need boolean things08:38
KeybukAND, OR, NOT for those structures08:38
Keybukand AND and OR for the start/stop event trees08:38
ion_Fever ftw.08:39
Keybukthe thing causing me difficulty is08:44
Keybuk- telling a job which events happened in the tree08:44
Keybuk- positional arguments08:44
Keybukany thoughts?08:47
AlexExtremenope, sorry. my brain isn't working too good today08:48
AlexExtremei'll have a think about it though08:48
Keybukthe only thing I could come up with was08:49
Keybuk- walk the tree in-order08:49
Keybuk- for each open state, push the event name into the list, and its positional arguments08:50
Keybuk- then pop the first event name, place in UPSTART_EVENT08:50
Keybukso UPSTART_EVENT is the first event at the top of the tree08:50
Keybuk$1..$n are the arguments to that event08:50
Keybukfollowed by "--" followed by the name of the next event, and that ones positional arguments08:50
Keybukquite programming intensive08:52
Keybukbut I suspect it won't be a problem, since the only things caring will probably be tasks or state-based instances08:52
Keybukand those will have only one or two events in their list08:52
Keybukso for most people, $UPSTART_EVENT and $1...$n will be sufficient08:54
Keybuke.g.08:54
Keybukblock-device-added ... block-device-removed $1 or partition-added ... partition-removed $108:54
Keybuksounds ok?09:02
AlexExtremeyes09:03
=== Md [i=md@freenode/staff/md] has joined #upstart
Keybukwe'd probably end up needing separate files to define states in09:18
Keybukmaybe just /etc/upstart.conf or something09:18
Keybukand obviously name them09:18
Keybukand since jobs are now tied to states, not events, we'll have to rename /etc/event.d :p09:20
AlexExtremerename it? shit. :p oh well, i suppose i can rebuild my entire upstart repo... ;)09:22
Keybuklol09:22
Keybukit's always been a temporary name09:22
=== Keybuk has never liked it
AlexExtremehow about 'upstart.d' ? :)09:23
AlexExtremejobs.d?09:23
KeybukI'd been trying to avoid using "upstart"'s name in its config files09:23
Keybukit may be inevitable though09:23
KeybukI wanted /etc/init.d ... but someone already used that09:23
AlexExtremei would say init.d09:23
AlexExtremeheh09:23
AlexExtremebut it's used already ;)09:24
Keybuklikewise /etc/rc.d09:25
Keybuk(but then rc.d is kinda old)09:25
AlexExtremefrugalware still uses rc.d for it's sysv stuff (but we were originally based on slackware, so... ;))09:25
AlexExtremehmm :) there's a response from Mike Saunders (an LXF writer) on that post you made @ your blog09:29
Keybukyeah I saw09:29
KeybukI disagree with him09:30
KeybukI think that the point of printed magazines is to have a single line of opinion09:30
Keybukan editorial direction09:30
AlexExtrememe too09:30
Keybukotherwise what do they give us that the online press doesn't?09:30
AlexExtremeright09:30
AlexExtremethere's one thing that's been annoying me with LXF recently09:30
Keybukwhat's that?09:31
AlexExtremethey've been reviewing beta releases as the final product, and only mentioning in small print that it's the beta09:31
Keybuktheir time-to-print seems extraordinarily long09:39
KeybukI've noticed that before with them09:39
Keybuktheir NEWS is amazingly out of date09:39
AlexExtremeyeah09:40
Keybukcould have /etc/service.d /etc/task.d and /etc/state.d09:42
Keybukbit overkill though09:42
AlexExtremeyeah09:42
Keybukwhy is it always ".d" anyway?09:43
AlexExtremei prefer a central location rather than files dotted in a few directories over the place09:43
AlexExtremedunno, i've always wondered that09:43
Keybukdifficult to google for ;)09:44
Keybukit seems to have stemmed from when a file was turned into a directory09:46
Keybuk/etc/rc -> /etc/rc.d09:46
AlexExtremeprobably the .d stands for directory09:46
Keybukand it vaguely implies that if you concatenated all the files together, it's equivalent to just having a single file09:47
Keybukwhich means that the /etc/event.d use would be "invalid"09:47
Keybuksince the name matters09:47
Keybukbut then the same is true for /etc/pam.d09:47
AlexExtremeand dbus' system.d09:48
Keybukwe do need to separate out jobs and states though09:48
Keybukmaybe09:49
AlexExtremebtw, will the replacement-initscripts spec *definitely* get implemented for gutsy?09:50
Keybukno09:51
Keybukit's strongly possible though09:51
Keybukthe only thing standing in the way is this complex event config problem09:51
AlexExtremewell, if you need any help with that just ask, i'll try to help with decisions if i can09:52
Keybuksee above ;)09:54
AlexExtreme:)09:54

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