/srv/irclogs.ubuntu.com/2008/05/02/#upstart.txt

sadmac2Keybuk: how's the code?14:55
Keybuksadmac2: finished the refactoring16:04
Keybukjust got to finish d-bus stuff16:04
sadmac2very nice16:04
wasabi<wasabi> Keybuk: I'm still unhappy with the idea of nfs-server having content in portmaps' job file.17:06
wasabi I just cann't imagine how packagers will deal with it.17:06
wasabiMake my fears go away!17:06
ion_Are they just additions or larger changes?17:07
Keybukwell, it does anyway, since it needs to be in the portmap maps file17:07
Keybukportmap is _really_ the only example of this kind of job I can think of17:08
wasabiIt fails with more than one thing depending on portmap, doesn't it?17:09
ion_Have update-portmap-job within the portmap package, which combines files from .../portmap/job.d/* to /etc/init/jobs.d/portmap?17:09
wasabiYou know. I guess it doesn't really matter. Mine as well just run portmap when portmap is installed, period.17:09
wasabiAnd just rely on the package manager to enable/disable it.17:10
ion_Or have upstart read /etc/init.d/jobs.d/portmap.d/* as a single job? :-)17:10
Keybukwasabi: why would it fail?17:11
Keybukthere _is_ a much more entertaining way to do it17:12
Keybuk/etc/init/jobs.d/nfs-server:17:12
Keybuk    env REQUIRE_PORTMAP=117:12
Keybuk    export REQUIRE_PORTMAP17:12
Keybuk/etc/init/jobs.d/portmap:17:12
Keybuk    start on starting REQUIRE_PORTMAP=117:12
Keybukyou don't _have_ to match on the job name ;)17:13
wasabioh that's crazy17:13
wasabidude. that's slick.17:13
wasabithough how do you make it stop? :017:13
Keybukif there's really a large number of jobs that should behave like this, we can codify that17:13
Keybukie. have a "depends portmap" type syntax17:13
Keybukwhich adds to the job event environment17:13
wasabioh you could also have portmap's job file keep a ref count.17:13
wasabior something17:13
Keybukyeah17:13
Keybukthat'd work with states too17:14
Keybuk  state portmap-dependency17:14
Keybuk      from starting REQUIRE_PORTMAP=117:14
wasabistart could increment the count, and run the daemon. pre-stop could decrement it and only allow stopping when it hits 017:14
Keybuk      until stopped $JOB17:14
Keybuk  end state17:14
Keybukthen portmap would have17:14
Keybuk  while portmap-dependency17:14
Keybuk(theoretical)17:15
wasabithat is intriguing. i have yet to read about states.17:15
KeybukI've yet to invent them properly17:15
Keybukyou and I did the ground work back in SF17:15
wasabiI remember that much17:15
Keybukover very hot thai17:15
wasabiThe next morning was not pleasant.17:16
Keybukwhen I realised that upstart's design allows it to do dependency-based init with _no_ special contortions, I knew we'd reached elegance17:16
Keybukevents can be used to emulate them just fine17:16
wasabidesign nirvana.17:17
=== Amaranth_ is now known as Amaranth
ion_A bit like doing sequential code with side-effects using monads in a functional programming language. Good, clean architecture that doesn't restrict your choices when you need to have something the worse architecture does well. :-)17:31
sadmac2Keybuk: get a chance to look at that email I sent?19:09
Keybuknot yet19:14
Keybukthis week is performance review week19:14
Keybukand UDS planning19:14
sadmac2Ahh19:14
Keybukand I wanted to get 0.5.0 out before worrying too much about what comes after ;)19:15
KeybukI'm stuck in a hotel in london next week, so bar going out skating, I'll have plenty of time to code that and reply to mails :)19:15
sadmac2sweet19:17
sadmac2what's still loose in the dbus code?19:17
Keybukjust the writing of the functions now19:19
Keybukit registers the objects on the bus19:19
Keybukand maintains a connection to the bus, dropping it and reopening when necessary19:19
Keybukso just need to write the actual methods ;)19:19
sadmac2heh. cool19:30
ion_So Upstart will be the first program ever not to crap itself when dbus goes for a short walk? :-)19:33
wasabiYou writing the dbus integrating in pid 1?19:37
Keybukwasabi: yeah19:38
wasabiscary.19:38
wasabilinking to libdbus?19:38
ion_Scary?19:39
Keybukwasabi: yup19:40
wasabiThat sounds frightening for some reason.19:40
ion_Frightening?19:41
wasabiUh huh. Just ot have that much complexity in pid 1.19:41
ion_Well, for it to talk with other processes, there must be *some* implementation of *some* protocol anyway in pid 1. :-)19:44
Keybukwasabi: libdbus is nice enough19:47
Keybukhaving our own ipc implementation was scarier, since it's not as audited19:48
wasabiIt might scare people who don't want dbus on their systems (server installs)19:52
ion_Do you mean dbus-the-protocol or dbus-the-daemon?19:52
wasabiI have no practical claims. Only political claims.19:53
Keybukwasabi: those people won't get a choice?19:56
wasabiWell, is libdbus.so required?19:59
Keybukyes20:03
AlexExtremelibdbus.so? surely it would be safer to statically link /sbin/init to libdbus.a rather than use the shared library?20:12
Keybukwhy safer?20:18
Keybukshared libraries are safer since they can be updated for security updates20:18
AlexExtremeKeybuk: libdbus upgrade, .so version changes (e.g. from .so.3 to .so.4), upstart package isn't upgraded, reboot, *won't boot because of missing lib*20:35
Keybukthat's what we have package managers for20:36
Keybukupstart would depend on libdbus3 and so libdbus.so.3 would be still installed20:36
Keybukwhile libdbus4 containing libdbus.so.4 would be used by the other apps20:36
ion_Yeah, soname bumps never break anything.20:36
AlexExtremebut then again I'm speaking from my experience in a smaller distro where maintainers didn't get dependencies right and sometimes forgot to rebuild packages :)20:36
Keybukhappily dbus isn't due for a soname change20:37
ion_It's not their job to get the dependencies right, the packaging tools make the shlibdeps.20:37
Keybukand if it were, it's maintainers have very very carefully made sure it would not be a problem20:37
Keybukeven the include files are parallel installable20:37
AlexExtremeion_: debian's packaging tools may do that, pacman's packaging tools don't20:38
ion_alexextreme: Just copy the functionality from $other_distro. :-)20:39
AlexExtremehah20:39
sadmac2that was interesting21:01
ion_alexextreme: Well, nothing prevents you from linking statically, it's just safer the other way. :-)21:11
suihkulokkithe main worry of linking external libraries to process runnning pid 1, is that pid 1 should never ever crash21:14
suihkulokkiso one needs to be sure the libraries linked to are rock solid21:14
suihkulokkiand aren't built on assumptations like "it's ok to crash if malloc() fails"21:14
Keybuksuihkulokki: see also, Why Keybuk Does Not Like GLib :)21:21
Keybukthe only doofus assumption in libdbus was that it could call exit() if the connection to the bus was dropped21:22
Keybukand that was at least an option21:22
Keybuk(but the code that set the option for bus connection was in the wrong place, which I had to fix)21:22
wasabiI think limiting scope of exposure is important. If every libdbus version upgrade is vetted by a team of trained professionals before being deployed, so as not to break upstart, then it's good.22:16
wasabiBut I think in reality that does not happen, and it could break.22:16
wasabiHence you'd limit scope in order to reduce the maintenance burden on the maintainer. upstart is super critical.22:16
Keybuknot so much22:26
Keybukif every Upstart upgrade was vetted by the team of trained professionals22:26
Keybukwho carefully read through my IPC codfe22:26
Keybukthen I might feel happy ;)22:27
Keybuksince they don't, using a shared IPC protocol that has had more eyes over it is better22:27
ion_...or just switch to a language that simply won't have any buffer overflows or stuff like that. :-)22:28
Keybukthen I'd have to put my faith into that language interpreter22:28
Keybukand they really don't tend to be great ;)22:28
ion_:-)22:29
KeybukD-Bus over homebrew IPC is compelling for several reasons22:31
Keybuk1) security - D-Bus is used more widely and has had more people look at the code, including NSA verification, it's less likely to have extant security flaws than the homebrew22:32
Keybuk2) response to flaws when they are found - D-Bus has active maintainership, when flaws are found the response will be rapid and a matter of replacing the library22:32
Keybuk3) maintainability - homebrew IPC is a bitch to maintain, and touches lots of areas of UNIX that are unpleasant ;)22:33
Keybuk   much better to let someone else worry about those issues22:33
Keybuk4) compatibility - there are already bindings for d-bus in most languages, and it's well known22:33
Keybuk   means more people will write software that talks to upstart22:33
ion_(I actually didn't mean an interpreted language, but the same of course applies to higher-level language compilers.)22:33
Keybuk5) authentication - D-Bus already solved the authentication issues for individual connections *and* for messages22:34
Keybukion_: are there higher level compilers that remove the risk of buffer overflows?22:34
ion_As i said, the same (what you mentioned) applies to them. :-)22:34
Keybukwell, that and they don't exist? :p22:34
KeybukI'm not writing Upstart in Pascal <g>22:35
ion_I've been trying to study Haskell recently with great interest, incidentally.22:35
ion_The more bits and pieces about it i get into my blob of grey matter, the more awesome it seems. :-)22:36
ion_Still, i have no idea whether the compiler (well, the glasgow compiler in this case, probably) contains bugs that could lead to security holes.22:36
Keybukhmm, Haskell22:36
Keybukthat's basically writing in spreadsheets isn't it? :)22:37
ion_Well, something like that. :-P22:37
KeybukI've yet to see someone implement something useful in Haskell that doesn't have very very scary end-of-the-universe problems22:39
ion_end-of-the-universe? :-)22:40
Keybukas in, there's no point the program saying "Please wait"22:41
Keybukit won't be done before you are22:41
ion_Sorry, i don't see what you mean.22:42
Keybukthat it's easy to write programs that have very difficult upper bounds22:43
Keybukand can end up stuck resolving their next course of action22:44
Keybukthey do complete22:44
Keybukbut it can, in extreme cases, be calculated to require billions of years22:44
ion_Oh, ok22:44
Amaranthyou could use ada :P23:09

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