/srv/irclogs.ubuntu.com/2008/12/15/#upstart.txt

sadmac2ion_: ping16:57
ion_sadmac: pong17:04
sadmac2ion_: I just pushed a new version of the state machine17:05
sadmac2ion_: it has some minor behavioral tweaks, and an example file with a real world demo of sorts17:06
sadmac2(just a small example of drive mounting. designed to be played with more than just run)17:06
sadmac2Keybuk: If you want to look at it, its a solution to your infamous mounting scenario17:07
Keybukpushed?17:09
sadmac2Keybuk: git://fedorapeople.org/~sadmac/upstate.git17:09
Keybukdo you have a description of what it does?17:09
Keybukor do I have to learn ruby?17:10
sadmac2Keybuk: that mailing list post I made still describes the general idea.17:10
KeybukI didn't really understand that :p17:10
sadmac2Keybuk: well shit :D17:12
Keybukyou need to explain things better for people who can't read your mind :p17:12
sadmac2Keybuk: its not a matter of mind reading. its a matter of having an unhealthy addiction to category theory ;)17:13
Keybukyou're the only person on the planet with that :p17:13
sadmac2the only one that universities let out of their math department basement17:13
sadmac2Keybuk: well, you have states17:14
Keybukthose kind of people never tend to leave university17:14
sadmac2Keybuk: states are 1) a name, 2) a series of parameters in the name=value format17:14
sadmac2true17:14
Keybukcan you post to the ML?17:14
KeybukI'm doing other things right now, and don't log IRC17:15
sadmac2Keybuk: good point17:15
Keybuk(other things including a kernel patch that will make my world truly made of awesome, and solve one of my big upstart problems - which of course means it'll be rejected, but hey :p)17:15
sadmac2Keybuk: what patch?17:17
Keybuk'tis a secret until it goes on lkml17:18
sadmac2hmm17:19
sadmac2we just tried waitfd, so....17:19
sadmac2I'm guessing its that ring buffer dealie17:19
ion_sadmac: Alright, the example works.17:30
ion_Now if i only understood it. :-)17:31
sadmac2ion_: well, the first 3 lines create states17:32
sadmac2ion_: arguments are:17:32
sadmac2name17:32
sadmac2list of events that trigger it17:33
sadmac2list of dependencies17:33
sadmac2list of parameters that have to come from something other than dependencies (the event causing the state to come up, or the user if the user is starting it)17:33
sadmac2that list of parameters can be like [a, b, c] or it can have little sub groups like [a, [b,c], c]17:34
sadmac2the sub group means "at least one of these"17:34
sadmac2Event::Epsilon is an event that happens any time it might cause something. So saying a state comes up on Event::Epsilon basically means it comes up whenever it can17:35
sadmac2Event.new takes 2 arguments, a name of the event, and arguments17:36
sadmac2for events that we're using for comparison, the arguments can have regex values17:36
sadmac2so if the state starts on Event.new("Can_Mount", {:mount_str => /.*/}) it means the Can_Mount event will start it provided it has a mount_str argument, and that argument can have any value17:37
sadmac2ion_: with me?17:37
ion_Yeah, i think :-)17:38
sadmac2ion_: try adding and removing stuffs from the events list to make more drives17:39
ion_I’m not sure i understand the output.17:44
sadmac2ion_: red states are down, green states are up17:45
sadmac2Firefox's spell check is british18:15
sadmac2colors->colours18:15
sadmac2friggin u18:15
sadmac2ion_: has it all become wonderously clear now?18:16
ion_Sorry, no. :-)18:20
sadmac2ion_: anything I can do to help...18:23
sadmac2at least until I hit lunch in 5mins :D18:23
Keybuksadmac2: how does this solve mounting?18:32
sadmac2Keybuk: the example demonstrates it19:17
Keybuksadmac2: I have to install ruby then?21:21
sadmac2Keybuk: ah, don't have it?21:50
* sadmac2 notices a glitch in the example21:53
sadmac2pushed fix21:54
sadmac2Keybuk: in the new state machine, you have a state for each fstab line, and a state for each device which udev notes to be present, and a mounted state that depends on those two21:55
sadmac2Keybuk: and the parameters are properly collated depending on which are available21:55
sadmac2Keybuk: the devicekit_hd state has blkdev, uid, and name properties (or whatever parameters you want to mount on)21:57
sadmac2Keybuk: and the fstab state has one or more of those 321:57
sadmac2Keybuk: the mount state will only take a given pair of them as dependencies if their like-named arguments agree21:57
sadmac2Keybuk, ion_: http://screwyouenterpriseedition.blogspot.com/2008/12/new-upstart-state-machine.html22:00
sadmac2part 1 of many22:00
suihkulokkicurious name for blog =)22:06
ion_sadmac: Thanks, will read.22:08
sadmac2suihkulokki: I like it22:09
ion_sadmac: Thanks for using red and green, which are hard to tell apart for some of us. :-P22:10
ion_sadmac: I suggest making the ‘up’ ones bold.22:15
sadmac2ion_: not a bad idea. that green doesn't read too well.22:16
suihkulokkihmm. so say, if we'd have a state "offline()" or more precisely "rfkill()"22:19
suihkulokkiin what case would the state be up or down ?22:19
sadmac2suihkulokki: we haven't gotten that far yet :)22:21
sadmac2suihkulokki: the important thing to understand for that part is that they can be up or down, and that this doesn't effect their equivalence relation.22:22
sadmac2s/relation/class/22:22
* sadmac2 wonders if anyone would have called him on that22:22
Keybukok, so a state has a name, some parameters, and is either up or down22:40
KeybukI didn't understand the "mathy idea"22:41
sadmac2Keybuk: ok, so there are only a certain number of valid values for name22:42
sadmac2Keybuk: on a given system, you'll have dbus, gnome-session, etc.22:42
sadmac2Keybuk: hypothetically, though, there's infinite possibilities for the parameters22:42
sadmac2Keybuk: and a state exists for every one22:43
sadmac2Keybuk: the point is, we don't talk about whether a state "exists" or not in this paradigm. It always exists. period.22:43
sadmac2Keybuk: we talk about whether its running.22:43
Keybukstates are jobs22:49
Keybukjobs have any environment22:49
Keybukthere's no difference between a job not existing and not running22:49
sadmac2Keybuk: that's what allows us to get away with it :)22:50
Keybuk?22:50
sadmac2Keybuk: the principle is there to make it easier to talk about the workings of the mechanism22:50
Keybukso what I just described matches what you were describing?22:50
sadmac2Keybuk: in a sense. it'd be more accurate to say that what you described was an implementation detail. Like the preface said, I'm just describing behavior.22:51
* Keybuk gives up22:51
sadmac2Keybuk: you might be thinking too concretely. There's really no such things as jobs for this model :)22:53
sadmac2Keybuk: this is something you put information into, and you get out a list of things that should be running22:54
sadmac2and even that depends on you interpeting it that way.22:54
Keybukso there's no point me reading anything you write?22:55
Keybukfair enough22:55
* Keybuk goes22:55
ion_Now, now22:56
Keybukseriously22:57
Keybukwe're trying to write a replacement init daemon that's easy for sysadmins to use22:58
Keybukthe O'Reilly book on Upstart does not need to have "all this book assumes is that you have several PhDs in advanced mathematics and number theory" in the introduction22:58
Keybuka sysadmin or distro maintainer will be thinking in terms of jobs23:02
Keybuk(or at least services and tasks)23:02
Keybukso their requirements, dependencies, etc. need to be explained in that language too23:02

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