Repository navigation
Conversation
Add it to all services that currently provide io.systemd.service.SetLogLevel
|
(varlink boilerplate and docs were hallucinated by copilot, don't @ me) |
f6d188a to
f40c8ae
Compare
If the specified service does not provide a D-Bus interface, check if it is tied to any socket unit. If it is, and a socket unit has the FileDescriptorName= set to 'varlink', then fetch the patch and introspect it, checking if it provides the org.freedesktop.LogControl interface, and if so, use it.
This intentionally follows the D-Bus LogControl1 specification as close as possible, to try and provide consistency since it is meant to be a public interface. E.g.: use strings rather than ints for log levels, unlike io.systemd.service.SetLogLevel, provide getters, and also handle log target and syslog identifier.
f40c8ae to
0a800f6
Compare
|
I dont get it, what does this new iface do that the existing one doesnt already? |
|
it sounds ok extending the existing service interface, but i see no reason to add yet another one |
| 'varlink-io.systemd.service.c', | ||
| 'varlink-io.systemd.sysext.c', | ||
| 'varlink-log-control-api.c', | ||
| 'varlink-org.freedesktop.LogControl.c', |
There was a problem hiding this comment.
also, a i don't think we should use the fdo domain for new interfaces, in particular not for varlink ones
| &triggered_by); | ||
| if (r < 0) | ||
| return log_error_errno(r, "Failed to get TriggeredBy property of %s: %s", | ||
| name, bus_error_message(&error, r)); |
There was a problem hiding this comment.
humpf, not all varlink services are socket activated. for example journald's varlink interface does not involve socket activation. hence, i find this really a bit too magic.
There was a problem hiding this comment.
Sure it doesn't cover everything, but it's a start? And we could just add a socket unit for that one, no?
|
or to say this differently: i wanted the service iface to be what LogControl was for D-Bus, but with a bit wider focus, i.e. support a bunch of props that a service needs to support, not just logging. |
the service interface has io.systemd in the name, which to a casual observer sounds like it means it's specific to systemd code/integration, rather than a generic one. It doesn't even have to be restricted to services, it's conceivable that a oneshot program but with a long runtime might also want to implement this, it's not really strictly tied to systemd services only. Also the fact that org.freedesktop.LogControl already exists is an advantage, because it makes it easier to discover, and makes it obvious that it's the same thing, just over a different protocol |
the call could be updated to allow both...
I am not convinced that is a good reason, I am pretty sure we should get the fdo terminology out of the concept. |
|
anyway, still sure the existing valrink interface should be extended. |
Currently we have io.systemd.service.SetLogLevel. It has no getter, and takes ints as input. No interface for the target or the identifier.
The LogControl1 D-Bus interface is very nice because it's a standard interface that anything can implement, and we have it wired in systemctl service-log-level.
Add a varlink LogControl interface, that tries to follow the D-Bus one so that it's consistent and can be trivially implemented and used. Add it to all the services that currently have io.systemd.service.SetLogLevel, make systemctl use it, and document it.