diff --git a/README.md b/README.md index 89a91ca..651134b 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,30 @@ dependencies must be taken care of explicitly in other ways. This is also a starting point to explore the feasibility of a runit/s6 controller. +## dbus-controller-s6rc + +Build with `meson -Ds6-rc=enabled build` + +Usage: `dbus-controller-s6rc -h` + +The [s6-rc] controller looks in a s6-rc livedir for services containing the +file `data/dbus-activatable-name` with a dbus activatable name provided by the +service. It issues `s6-rc change ` when it receives an activation +request. + +Such dbus activatable services can be autogenerated by `tools/s6rc-generator`, +which generates a s6-rc source database called `dbus` that can be included in +the list of your databases to compile with `s6-rc-compile`. + +It is typically invoked as: +``` +./s6rc-generator /usr/share/dbus-1/system-services/* +./s6rc-generator /usr/share/dbus-1/services/* +``` +for the system and session bus, respectively. + +You are free to further tweak this source database as you like, for example +removing unwanted activatable services. + [dbus-broker]: https://github.com/bus1/dbus-broker +[s6-rc]: https://skarnet.org/software/s6-rc diff --git a/meson.build b/meson.build index de20e81..9d28b2a 100644 --- a/meson.build +++ b/meson.build @@ -27,11 +27,11 @@ add_project_arguments('-DHAVE_' + sdbus.name().to_upper() + '=1', language: 'c') executable('dbus-controller-dummy', ['controller.c', 'dbus.c', 'main.c', 'policy.c', 'syslog.c'], dependencies: [sdbus]) -if get_option('s6-rc') == true +if get_option('s6-rc').enabled() tllist = dependency('tllist') cc = meson.get_compiler('c') skalibs = cc.find_library('skarnet') -executable('dbus-controller-s6', ['activation.c', 'controller.c', 'dbus.c', 'main.c', 'policy.c', 'syslog.c'], dependencies: [sdbus, skalibs, tllist], c_args : '-DHAVE_S6=1') +executable('dbus-controller-s6rc', ['activation.c', 'controller.c', 'dbus.c', 'main.c', 'policy.c', 'syslog.c'], dependencies: [sdbus, skalibs, tllist], c_args : '-DHAVE_S6=1') endif diff --git a/meson_options.txt b/meson_options.txt index 16fb220..719d0ab 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,2 +1,2 @@ option('sd-bus-provider', type: 'combo', choices: ['auto', 'libsystemd', 'libelogind', 'basu'], value: 'auto', description: 'Provider of the sd-bus library') -option('s6-rc', type : 'boolean', value : false) +option('s6-rc', type: 'feature', value: 'disabled')