mirror of
https://github.com/troglobit/finit.git
synced 2026-10-23 11:44:37 +00:00
libink/finit: properties, and org.finit on the system bus
Runlevel and version are state, not actions, so they belong behind org.freedesktop.DBus.Properties rather than another method each. Finit also claims org.finit on the system bus when it finds one, so ordinary D-Bus clients can reach it without knowing about /run/finit/bus. Opportunistic on purpose: no dbus-daemon is a normal state for the systems Finit runs on, not an error to report. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
dd1390a6c2
commit
ebc0ef62e6
22 files changed
+1474
-154
No files matched your search
@@ -20,6 +20,55 @@ All relevant changes are documented in this file.
|
||||
same service, `command = { "/lib/systemd/systemd-udevd", "-udevd" }`,
|
||||
and Finit starts the first one it finds. The line-based format could
|
||||
only express this by repeating the whole stanza per candidate
|
||||
- Finit now ships with a built-in brokerless D-Bus implementation,
|
||||
**libink**, exposing the running init system as a peer on its own
|
||||
private bus at `/run/finit/bus`, and -- opportunistically --
|
||||
registering `org.finit` on the standard system bus when a
|
||||
`dbus-daemon` is reachable. No external `libdbus`/`sd-bus`/`GIO`
|
||||
dependency.
|
||||
|
||||
The bus implements the stock `org.freedesktop.DBus`,
|
||||
`org.freedesktop.DBus.Peer`, `org.freedesktop.DBus.Introspectable`,
|
||||
and `org.freedesktop.DBus.Properties` interfaces, plus three
|
||||
Finit-specific ones:
|
||||
|
||||
* `org.finit.Manager1` at `/org/finit/manager` --
|
||||
`ListServices`, `GetService`, `Start`/`Stop`/`Restart`/`Reload`,
|
||||
`SetRunlevel`, `SetDebug`, `Signal`, `Suspend`, and the
|
||||
`Reboot`/`Halt`/`Poweroff` triplet. Read-only properties
|
||||
`Runlevel`, `PrevRunlevel`, `Version`. Signals
|
||||
`ServiceStateChanged (sss)` and `RunlevelChanged (ss)`.
|
||||
|
||||
* `org.finit.Service1` at `/org/finit/service/<encoded>` -- one
|
||||
object per loaded service, with `Start`/`Stop`/`Restart`/`Reload`
|
||||
for working off an object handle rather than passing the
|
||||
identity string around.
|
||||
|
||||
* `org.finit.Cond1` at `/org/finit/cond` -- `Get`, `Set`, `Clear`,
|
||||
`List`, `Dump` for [user-defined conditions](conditions.md),
|
||||
with a `ConditionChanged (ss)` signal.
|
||||
|
||||
Privileged methods reject non-root callers based on the kernel-
|
||||
authenticated peer uid (`SO_PEERCRED`); read-only methods are open.
|
||||
See [D-Bus Integration](dbus.md) for the full surface, build flag,
|
||||
and `dbus-send`/`dbus-monitor` examples.
|
||||
|
||||
- `initctl` now transparently routes through D-Bus when the bus is
|
||||
reachable, with the legacy `INIT_SOCKET` transport as a fallback:
|
||||
`start`, `stop`, `restart`, `reload`, `reload <svc>`, `reboot`,
|
||||
`halt`, `poweroff`, `suspend`, `debug`, `signal`, `runlevel`, and
|
||||
`cond {get,set,clr}` all use the new path. Two new subcommands
|
||||
show up that have no legacy equivalent:
|
||||
|
||||
* `initctl monitor` -- streams every signal on the bus to the
|
||||
terminal, one line per delivery (`HH:MM:SS iface.member(args)`),
|
||||
until interrupted. Same idea as `dbus-monitor`, but scoped to
|
||||
Finit and with no address plumbing required.
|
||||
|
||||
* Issuing `initctl cond set/clr` over D-Bus also fires the
|
||||
`Cond1.ConditionChanged` signal, so observers see user-driven
|
||||
state changes the same way they see service-driven ones.
|
||||
|
||||
- Restart log now spells out the signal name and flags core dumps,
|
||||
e.g. `killed by SIGKILL` or `killed by SIGSEGV, core dumped`, in
|
||||
place of the bare numeric `by signal: N`. Gives operators a much
|
||||
|
||||
Reference in new issue
Block a user