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

Keybuksadmac2: unless I'm mistaken13:17
Keybukyou've not described anything new, just used a different language to describe what we were already talking about13:18
Keybuk*and* haven't actually solved the filesystem mounting "problem" as defined13:18
Keybuklit. that it is not possible to do native upstart mounting of filesystems _without_parsing_fstab_to_create_the_states/jobs_13:19
Keybukalso you don't appear to solve the /usr/local must be mounted after /usr issue (but there's no pitfall either, since you parse fstab you can work out whether you need a dep)13:20
sadmac2Keybuk: that its mostly the same is a good thing. Most of what's new is the rigor: its very meticulously defined. The other new thing is the very freeform way deps work. st(a: 1, *) -> b() and st(c: 1, *) -> d() means st(a: 1) depends on b(), st(c: 1) depends on d(), and st(a: 1, c: 1) depends on b() /and/ d()15:46
sadmac2Keybuk: for the mountpoint issue we can just add one dep: mounted(mountpoint: %1) -> file_exist(name: %1)15:48
sadmac2that state would have to be a bit special internally but its not hard to write15:49
Keybukbut you do have to preparse fstab15:50
sadmac2Keybuk: I don't know that a lot of that information is defined anywhere else. You could rely on disklabels being equal to the mountpoint, but that's not good15:51
Keybukstill doesn't help15:56
Keybukso we still need a binary to parse fstab and create upstart states/events/jobs for the information there15:56
Keybukwhich is pretty much where I got to :p15:57
Keybukthe only real question is how much of that binary is logic only15:57
Keybukand how much is implementation15:57
Keybukie. does it just say "when you see blah, run the upstart job blah"15:57
Keybukor does it actually define what the upstart job is (fsck on ...)15:57
sadmac2Keybuk: I don't think we need a binary15:57
sadmac2Keybuk: its just a few calls to getmntent()15:58
Keybukso you need a binary16:00
sadmac2Keybuk: why put that in another application? its 3 lines of code16:00
Keybukwhere else would you put it?16:00
Keybukit's not something I'd want to hardcode into init16:00
sadmac2Keybuk: it could essentially go in the state machine16:01
Keybukonly if init parses fstab16:01
Keybukwhich is just wrong ;)16:01
sadmac2Keybuk: ah, but the state machine isn't /in/ init anymore, remember?16:01
Keybukespecially if you wanted to develop a system that did rely on lvm labels, or btrfs, etc.16:01
* Keybuk still doesn't think that's possible16:01
sadmac2its more than possible. its easy16:02
sadmac2Init only needs 2 dbus methods (strictly speaking. there may be good cause for more):16:03
sadmac2init.run(handle, script, script_on_fail)16:03
sadmac2init.stop(handle)16:03
sadmac2when a state comes up that corresponds to a job, it calls init.run("name_of_state(args: foo)", "exec /sbin/mytask", "emit failed job=$HANDLE")16:05
sadmac2when the state machine gets a failed event, it downs the state matching the job argument thereof16:06
sadmac2you're probably not putting /enough/ in userspace the way you're picturing it. Pid 1 is now just a glorified bash shell with really good session management16:07
sadmac2(and dbus instead of stdin)16:07
=== notting_ is now known as notting
Keybukyou know that pid 1 is in userspace, right? :p19:04
KeybukI don't see what your split buys us, except a much more complex code base19:04
sadmac2Keybuk: yeah, whatever the hell you call it :)19:06
sadmac2Keybuk: the split is good for separation of concerns. From outside of the two, jobs are states, but from within, the state machine doesn't really know there's such a thing as jobs and the service manager doesn't know anything about states19:07
Keybukbut it doesn't work ;)19:08
Keybukthe two become so closely coupled, that you're inherently more inefficient by having the split19:08
sadmac2Keybuk: They're pretty decoupled the way I set it up abouve19:08
sadmac2*above19:08
Keybukpid 1 would have only one method19:09
Keybukexec()19:09
Keybuktakes a command, returns a handle19:09
Keybukthat handle/object would have only one signal complete()19:09
Keybukand only one method stop()19:09
Keybukcomplete would say what exit code, or signal, etc.19:09
Keybukstop would send TERM/KILL19:09
Keybuk-- 19:09
Keybukwhich means it's incapable of doing anything on its own19:10
Keybukthe pid 2 would have the full state machine19:10
Keybukbut to do anything has to invoke all the methods and listen to signals on 219:10
Keybukon 1, even19:10
sadmac2it can't do anything automated on its own19:10
Keybukthis does not make anything simpler, it makes it much more difficult19:10
sadmac2it costs little to invoke those methods19:11
Keybukit costs impossibly more than just having a C method call to do it19:11
Keybukbear in mind as well that pid 1 is the pid that knows about forks and children dying19:12
sadmac2right19:12
Keybukso even a status() call needs additional methods/signals to talk between the two19:12
KeybukI don't see that this makes anything better19:12
sadmac2status is either starting,started,stopping,or stopped19:15
sadmac2that works from the previous mechanism19:15
sadmac2the state machine only thinks about the service being in two of those: started and stopped19:16
Keybukso pid 1 needs a state machine19:16
Keybukin fact, pid 1 needs *the* state machine19:16
Keybukso what is pid 2 doing? :p19:16
sadmac2pid 2 = generate a list of what is supposed to be running. pid 1 = make the system reflect that, and scream when this is impossible.19:17
KeybukI don't think you're buying anything by separating the two19:17
Keybukexcept complexity for no good reason19:17
sadmac2I want the two to be decoupled in the design.19:20
sadmac2If they're in the same process or not.19:20
Keybukthey're decoupled in the *current* design (0.3/0.5)19:22
Keybukthey're in different .c files, after all19:22
sadmac2if you look at the state machine as nothing but mathy bits and lights turning red and green; that is to say if you ignore the fact that programs are supposed to be started/stopped in relation to it, you should be able to add /exactly/ 3 things to it and have it able to manage services19:25
sadmac21) rising edge actions: some arbitrary piece of code that is run when a state becomes up19:26
sadmac22) falling edge actions: the same run when a state becomes down19:26
sadmac23) fail-on events: the ability to have an event cause a state to go from up to down /without/ running the falling edge actions19:27
Keybukerr19:27
Keybukbut we're not writing a mathy state machine19:27
Keybukwe're writing something that programs are started and stopped by19:27
KeybukI think it's dangerous to try and think the two are unrelated19:27
sadmac2the state machine is unrelated to the services in the sense that the strings and integers you use in your program are unrelated to the electrical charges on the bits of sillicon in the box under your desk.19:29
Keybukyou mean they're the same thing?19:30
Keybukwhich I think is my point19:30
sadmac2I don't think they're the same thing. In a sense the first doesn't even exist.19:31
Keybukservices *are* the states19:32
sadmac2for some value of services19:32
sadmac2states don't have a pid, or a vm area, or a task_struct, or signal handlers....19:33
sadmac2states are conditions. they are true or false values19:33
sadmac2you shouldn't need any system calls to set something to true or false19:34
Keybukit being true is dependant on syscalls having been run19:34
Keybuklikewise it becoming false again is also dependant on that19:35
sadmac2true19:35
sadmac2but states don't /fail/19:35
sadmac2they can become false for any of umpteen reasons19:35
sadmac2but there's no real "break"19:35
KeybukI think you're thinking too much in terms of mystate and thystate19:38
Keybukyou need to think about dbus and apache19:38
sadmac2mystate and thystate is a trivial problem19:38
sadmac2dbus and apache are not19:38
sadmac2but making dbus and apache /appear/ like mystate and thystate is19:38
sadmac2so its two trivial problems or one complicated one19:39
Turlany way to speed up ubuntu boot process? I'm open to testing new things20:26
Keybukroll it down a hill?20:44
ion_Overclock the modem.20:45
sadmacValue Add!20:46
=== Turl1 is now known as TUr1
=== TUr1 is now known as Turl1
=== Turl1 is now known as Turl
=== Turl1 is now known as Turl
=== notting_ is now known as notting
mbiebl_Keybuk: hi22:10

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