afournier | morning | 08:22 |
---|---|---|
afournier | i am working with upstart 1.6.1 and packaging it with oe. I would like to play with the dbus interface but the com.ubuntu.Upstart.*.xml are not installed (in /usr/share/dbus-1/) is it possible to do so with the provided Makefile, or i have to install it manualy ? | 08:27 |
xnox | afournier: upstart is not dbus activatable service. | 08:28 |
afournier | i don't really get what you mean, but what i want to do it use dbus to start, stop and monitor daemons using the dbus interface | 08:29 |
afournier | http://upstart.ubuntu.com/wiki/DBusInterface | 08:29 |
xnox | afournier: USR1 signal is used by upstart to connect to system dbus. | 08:29 |
xnox | afournier: after that upstart is available on the system dbus. | 08:30 |
xnox | (and thus the dbus interface) | 08:30 |
afournier | i read about that some days ago, the thing is dbus needs a patch for this and i could not apply it | 08:30 |
afournier | but still i don't want to do things like "start on <dbus event>" | 08:31 |
afournier | i just want to talk to upstart thru its dbus interface | 08:31 |
afournier | and rpc com.ubuntu.Upstart0_6.GetAllJobs and EmitEvent and stuff like that | 08:31 |
xnox | afournier: (a) start system dbus (b) make post-start of dbus call "exec kill -USR1 1" (c) upstart will be available on the system bus (d) open e.g. d-feet and read the job statuses via dbus api | 08:32 |
xnox | afournier: initctl tool uses dbus API to upstart only, and can do so via system/session DBUS and private sockets. | 08:32 |
afournier | i think it's possible as netstat tells me there are two active dbus connections on @/com/ubuntu/upstart | 08:32 |
afournier | ok | 08:33 |
xnox | afournier: that's private socket, that uses the same dbus IPC, the socket is always available. If upstart is not on the system dbus, you need to send USR1 signal to upstart. | 08:33 |
afournier | ok | 08:33 |
afournier | then i need to patch dbus | 08:33 |
afournier | no ? | 08:33 |
xnox | afournier: no. | 08:34 |
xnox | afournier: why?! | 08:34 |
xnox | afournier: upstart connects to system dbus and publishes an object.... no more no less | 08:34 |
afournier | dbus only has "--systemd-activation" | 08:34 |
xnox | afournier: DBusInterface is not about dbus activation styles, above will give you dbus api to start/stop/restart upstart jobs. | 08:35 |
xnox | afournier: it will not give you ability to control dbus activated daemons through upstart's $ initctl stop, command for example. | 08:35 |
afournier | good, then my init/dbus.conf has "post-start exec kill -USR1 1" | 08:35 |
afournier | so let's go back to the first question :) | 08:35 |
xnox | that's all you need. | 08:35 |
afournier | upstart does not install it's dbus schemas by default, i don't want to use d-feet or something like this. I'd like to code my own client using dbusxx-xml2cpp and some c++ | 08:37 |
afournier | i could make an upstart request to introspect the upstart dbus interface, but it's not fair for "offline" compilation | 08:38 |
afournier | s/upstart request/dbus call/ | 08:38 |
afournier | do you get my point ? :p | 08:38 |
xnox | afournier: one is expected to copy the partial schema of the things you will use only into your source code. Use whichever code generator appropriate for your language. | 08:38 |
xnox | afournier: we do not indeed install developer headers at all, and well didn't in 1.6 | 08:39 |
xnox | afournier: in recent upstart, we have libupstart which is compiled client side dbus library. | 08:39 |
xnox | afournier: look at the code of the upstart bridges. | 08:39 |
afournier | wouldn't be cleaner to introspect directly from system directories like /usr/share/dbus-1/.../com.ubuntu.Upstart.xml ? | 08:39 |
afournier | i mean generate code | 08:39 |
xnox | afournier: it's dbus client apis, you don't need them published. | 08:39 |
afournier | i must be completly wrong then as i am new to dbus, but i thought each installed program would publish it's schemas so you can generate your dbus bindings easily | 08:41 |
xnox | afournier: it looks like there is /usr/share/dbus-1/interfaces where things drop their interface files, we don't at the moment. I can add that for next release, but that will not change history. | 08:41 |
afournier | no it won't, it just makes things cleaner i think :) | 08:41 |
xnox | afournier: whilst it wasn't planned at the beginning upstart dbus has never changed, and is stable. | 08:41 |
afournier | so when you compile somethign against your distro, you know your dbus bindings are up to date | 08:41 |
afournier | i see | 08:42 |
xnox | afournier: if you complile complete bindings into your app / service you will get a lot of generated code into your app. | 08:42 |
afournier | that's true | 08:43 |
afournier | but upstart dbusinterface is well done and i think all methods could be usefull :) | 08:43 |
xnox | afournier: hence e.g. mountall has it's own private ./dbus/com.ubuntu.Upstart.xml with only 6 methods and 2 properties of the interface. | 08:44 |
afournier | interesting | 08:44 |
xnox | libupstart1.so.1.0.0 generated into C with nih-dbus-tool is 156k, which is a lot if you only need a couple methods. | 08:44 |
xnox | (dbus methods / properties) | 08:45 |
afournier | even so code generator could use filters based on methods names or something like this to filter out useless methods. this would avoid useless copy of dbus interfaces. I am no dbus programmer :) so i must be completly wrong. | 08:46 |
afournier | i just don't like copy paste | 08:47 |
afournier | :) | 08:47 |
afournier | but as you said no big deal | 08:47 |
afournier | by the way the upstart dbus interface is splitted in 3 files, so we can go under 156k if needed :) | 08:48 |
afournier | that a good trade-off | 08:49 |
=== JanC_ is now known as JanC |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!