[10:48] <_ion> Sigh.
[12:22] <_ion> keybuk: Btw, how about LUA for an alternative to sh in jobs? liblua* are so small that moving them to /lib shouldn't be a problem.
[12:23] <_ion> It's a quite nice language.
[12:24] <Keybuk> it's a nice syntax, but it's a pain since you have to code every single damned function primitive yourself <g>
[02:18] <_ion> keybuk: Btw, are you familiar with the dovecot library?
[02:18] <_ion> keybuk: cvs -d :pserver:anonymous@dovecot.org:/home/cvs co dovecot, see dovecot/src/lib
[02:23] <Keybuk> no?
[02:23] <Keybuk> I'm familiar with dovecot, obviously
[02:25] <Keybuk> most C programs end up acquiring their own "standard library"
[02:25] <Keybuk> or they use another like glib wholesale
[02:25] <_ion> The library is somewhat similar to e.g. libnih and glib. The interesting thing is the data stack / mempool stuff.
[02:26] <_ion> (It's not dovecot-specific, although it has been developed with dovecot. At least icecapd+irssi2 use it in addition to dovecot.)
[02:27] <Keybuk> yeah, I do have a long-running nih todo about temporary memory
[02:27] <Keybuk> upstart does use it to a small degree (mostly in message processing)
[02:27] <Keybuk> I'd somewhat like it to be compatible with nih_alloc though, as being able to steal temporary data is useful
[02:28] <Keybuk> the overhead for a job definition is quite high
[02:29] <Keybuk> I have a vague thought about it though
[02:29] <Keybuk> allocations with no parents could have a certain minimum size, say one page
[02:29] <Keybuk> if child allocations to those could be fitted into that page, they would
[02:30] <Keybuk> I'm not sure how to structure that to reduce overhead though
[06:13] <_ion> keybuk: Jobs need to be able to *programmatically* create new jobs. :-)
[06:13] <_ion> A pseudo-code example for the mount job:
[06:13] <_ion> start on startup
[06:13] <_ion> start ruby  # Not that Ruby is ever going to be an Upstart scripting language
[06:13] <_ion>   # ...
[06:14] <_ion>   mountpoints.each do |mountpoint|
[06:14] <_ion>     deps = mountpoint_deps mountpoint
[06:14] <_ion>     job = Upstart::Job.new "mount-" + mountpoint.sanitize
[06:14] <_ion>     job.on job.and(deps.map {|dep| "filesystem-mounted " + dep })
[06:14] <_ion>     job.start :script, 'mount $1; emit filesystem-mounted $1'
[06:14] <_ion>   end
[06:14] <_ion> end lua
[06:16] <_ion> I didn't think about race conditions etc, though. It's just a quick example.
[06:16] <_ion> I also forgot to add 'and block-device-added ...' to the 'on' list.
[06:17] <Keybuk> start ruby, but end lua ? :p
[06:17] <Keybuk> err
[06:17] <Keybuk> how is that different from just emitting an event with the requisite details?
[06:18] <_ion> Hah. I first wrote 'start lua, end lua' but then thought i'd use ruby instead. Forgot to change the end line. :-)
[06:18] <Keybuk> the trouble with trying to define a job like that is ... what happens if the event happens before the job is registered? :p
[06:20] <_ion> Yes, filesystem-mounted events must not happen before that's processed. Perhaps make a special pre-startup event for metajobs, and process other job after they have done their thing.
[06:22] <_ion> It would seem cleanest if the mount job computed the prerequisite mountpoints instead of the fsck job that emits the event the mount jobs act on.
[07:18] <_ion> Another approach: http://soijabanaani.net/tmp/upstart-mount
[12:01] <Lrrr_> hello, how do I make upstart reread it config files?
[12:09] <_ion> He was in a hurry.