Skip to content

Commit

Permalink
README.md: document s6-rc controller
Browse files Browse the repository at this point in the history
  • Loading branch information
st3r4g committed Mar 21, 2021
1 parent 43a9a31 commit 982b060
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <service>` 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
4 changes: 2 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
@@ -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')

0 comments on commit 982b060

Please sign in to comment.