/srv/irclogs.ubuntu.com/2008/03/08/#upstart.txt

KeybukI'm going to make a change to the state machine before that00:24
Keybukthat won't take long to do, mostly just updating test cases00:24
sadmaccool00:34
=== kylem_ is now known as kylem
Keybukhttps://lists.ubuntu.com/archives/upstart-devel/2008-March/000589.html01:37
=== Keybuk changed the topic of #upstart to: Upstart 0.3.9 | http://upstart.ubuntu.com/ | http://irclogs.ubuntu.com/ | https://lists.ubuntu.com/archives/upstart-devel/2008-March/000589.html | http://upstart.ubuntu.com/wiki/OutstandingIssues
Keybukhttp://upstart.ubuntu.com/wiki/ExpandEventVariables14:20
Keybukhttp://upstart.ubuntu.com/wiki/NamedInstances14:20
Keybukyay for writing specs after implementing them14:20
ion_keybuk: Hehe14:26
KeybukI need to get a shuttle or some other super-lightweight computer14:31
Keybukit's very silly having an entire server here just for local DNS14:31
Keybuk. o O { why don't I just install a lightweight DNS cache on the OpenWRT box }14:34
ion_I’ve been planning to replace a PC runninhg OpenBSD with a Via Epia, Soekris or something like that for years. But all my money seems to go to other stuff than computers. :-)14:36
Keybukis funny, sometimes you write a spec and realise in doing so that it's pointless14:54
Keybuke.g. http://upstart.ubuntu.com/wiki/MandatoryJobEnvironment14:54
ion_:-)14:58
* Keybuk gets the creeping feeling he'll need libdbus-nih (or libnih-dbus)18:05
ion_Heh18:06
KeybukI love autoconf21:21
Keybukit's a great improvement on everything that's been written since21:21
ion_...21:22
ion_:-D21:22
KeybukI added a libnih-dbus.la to libnih21:23
Keybukobviously, this can only be built if dbus development stuff is on the disk21:24
Keybukso autoconf checks for that21:24
Keybukif you have dbus, you get libnih-dbus21:24
Keybukif you don't, you don't21:24
Keybukobviously, you might want to suppress generating it; so you can configure --without-dbus or --with-dbus=no21:24
Keybukthen it won't get built anyway21:24
Keybukor you might want to force generating it, just in case; so you can configure --with-dbus21:24
Keybukif it doesn't exist, configure will exit with an error21:25
Keybukthat's just at the configure library21:25
Keybukapplications like upstart will want to force dbus support since they always need it21:25
ion_Alright21:25
Keybukso upstart has NIH_INIT([dbus]) in its configure.ac21:25
Keybukthat acts as if --with-dbus was always specified, failing if it doesn't exist21:25
Keybukexcept it doesn't check the configure arguments (--without-dbus does nothing) and even doesn't show up the existance of that in the --help output21:26
KeybukI *love* autoconf21:26
ion_Have you pushed that anywhere?21:28
Keybuknot yet21:28
Keybukwhy?21:28
ion_No reason, just looked at nih intending to look at the changes out of curiosity.21:29
Keybukhaven't actually written the dbus stuff yet :)21:29
ion_Ah, right. :-)21:29
KeybukI made dinner instead21:29
Keybukthen mucked around with autoconf ;)21:30
Keybukgotta love the way half your desktop vanishes if you restart dbus22:04
ion_Hehe, yeah. :-P22:04
ion_irssi manages to restart itself preserving IRC connections, without forking even.22:05
ion_Handy for upgrades.22:05
Keybukfunny, I've hit the first dbus stumble already22:13
Keybukand I've only just got as far as the damned bus connection22:13
Keybuksometimes I think that fd.o/gnome/etc. people are utter morons22:13
ion_What’s the problem?22:13
ion_With dbus, that is. :-)22:14
Keybukdbus calls exit() if the socket is closed :p22:14
ion_Ouch. :-)22:14
Keybukhappily it sets that *right in the middle* of the dbus_bus_get function22:17
ion_:-P22:18
Keybukhmm22:50
Keybuk090606 24012KT 9999 SCT025 PROB30 TEMPO 1117 26015G25KT 6000 SHRA SHGS SCT020CB22:50
Keybuksomebody likes me22:50
Keybukweather starts to turn nasty just 30 minutes after my flying lesson is due to end22:51
Amaranthhaving upstart exit when dbus goes away is bad, no? :)23:03
Keybukindeed23:04
Keybukit's similar to that moronic abort() if malloc() returns NULL in glib23:04
Amaranthg_try_malloc23:05
Keybuk"oh, bother, I can't be arsed to deal with errors - let's just go away"23:05
KeybukAmaranth: and how do you tell all the various glib internals that malloc to use that instead of g_malloc()?23:05
AmaranthI understand the thought process that led to that in glib23:05
Keybukthere were thought processes?23:05
AmaranthIf you're out of memory something _really_ bad has happened23:05
Keybuknot true at all23:05
Keybukit's utterly the wrong way to view it23:06
Amaranthwell, glib is meant for use with desktop things23:06
Keybukif you're out of memory, you can't do what you were trying to do23:06
Keybukdesktop things shouldn't vanish23:06
Keybuknot without explanation23:06
Keybuknot without a change to save their state23:06
Keybuketc.23:06
Amaranththey will anyway, oom killer23:06
Keybukright now, if you open a large file in inkscape, half the desktop apps vanish23:06
Keybukoom killer is smart enough to normally kill the application using the most memory :p23:06
Amaranthgot me there23:07
Keybukin fact, not only half the desktop apps23:07
Keybukbut half of the underlying daemon stoo23:07
Amaranthalthough iirc handling malloc failure adds like 30-50% more code to your project23:07
Amaranthso i guess people are lazy :)23:07
Keybukout of memory turns from a "damn, come back in a moment" problem to a fatal problem23:07
KeybukI disagree23:07
Keybukupstart handles every single malloc error23:07
Keybukand its code isn't huge as a result23:07
Keybukyou either retry because it's important23:07
Keybukor you return a natural error progression that will abort the current operation23:08
Amaranthhow many times do you retry?23:08
Keybukyou need that latter anyway since other things might go wrong23:08
Keybukalways23:08
Keybukthere are two solutions to out of memory:23:08
Keybuk1) block until there is memory23:08
Keybuk2) fail the current operation23:08
Keybukif you try and start a job in upstart, and it runs out of memory, it will return you an "Out of memory" error23:08
Keybukand the job will not be started23:08
Keybukand the state will remain clean23:09
Amaranththat reminds me, whatever happened to the kernel sending a signal when memory is running low23:09
Keybuknever heard of that one23:09
Amaranthwas thinking someone could setup a policy to stop certain services and throw out caches when that happens23:10
Amaranthreally?23:10
Amaranthhttp://kerneltrap.org/Linux/Signaling_When_Out_of_Memory23:10
Amaranthi only remember that because of SIGSEEDAMNITITOLDYOUSO23:11
Keybukheh23:11
Keybuknever got implemented23:12
Amaranthshame23:12
Amaranthso is the malloc thing the reason why you have libnih?23:13
Keybukno23:13
ion_Additionally, libnih doesn’t have the general suckage glib has. :-)23:13
Keybukit's just the first of many, Many, MANY things I hate about glib23:13
Keybuk... gint23:19
Keybukthe main loop has a well known race-condition which upstream refuse to fix23:19
Keybukthe entire API is massively bulky and bloated23:20
Keybukg_very_long_function_names_since_nobody_cares_about_fitting_into_eighty_columns_these_days23:20
Amaranthhehe23:20
Amaranthi dunno, i use it from vala :)23:21
Keybukio channel support that assumes you always deal in streams23:21
Keybukinconsistent error reporting/handling23:21
Amaranthbut gobject23:22
Keybukrandom reimplementations of functions that are in libc (!!)23:22
Keybukgobject is pain23:22
Keybukgthread is so useless it's beyond a joke23:22
Amaranthpain to write but gobject-introspection lets you do cool things23:22
Keybukgmobile is a bad wrapper around libltdl23:22
Keybukmobile?  23:22
Keybukgmodule!23:22
Keybukyou don't *need* to do those cool things in C23:23
Keybukif you want that kind of thing, you should use C# or Python or some other high level language23:23
Amaranthno, those cool things are "autogenerated bindings for every language"23:23
Keybukand how bad are those bindings normally? :)23:23
Keybukever tried using, say, python-gtk ?23:23
KeybukPython's own help() function can crash Python!23:24
Amaranththose aren't autogenerated :P23:24
Amaranthall of the gnomey bindings in vala are autogenerated, seems to come out alright23:24
Amaranthwell, except glib, have to do that one by hand23:24
Keybukheh23:26
Keybuktbh, the main reason for libnih is just ... nih23:26
Keybukit's mostly cribbed from my "copy and paste" library of code, I just libraryfied it23:27
KeybukI like the nih_alloc pattern23:27
Keybukso it follows that I like a standard library of functions that follow the same general pattern23:27

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