-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transient Unit name for applications #302
Comments
Sounds good! I created a PR to implement this. I added a dash between Btw., we should document that this becomes API and should not be changed in the future. |
Am I right in thinking that for services with If that's true, then xdg-desktop-portal will not always be able to rely on this convention anyway, both for dbus-broker and for dbus-daemon, because |
Correct. I would mostly see this as an effort to make the naming scheme of dbus-broker API, and then stick to the spec as closely as possible. |
Wouldn't that mean that adding a Something like this:
I think the ideal thing might be if there was a way for xdg-desktop-portal to inspect |
Or is the intention that this is deprecated, and if anything with an app-ID is installing a user-service, it should be named like If that is the intention, then it doesn't seem to have stuck yet. At the moment, on my Debian testing/unstable system, I have:
|
True, we already don't hard rely on this. Users can also start binaries directly from their command line etc. I don't think anyone disagrees that we should still try to make applications start in services/slices which adhere to this convention whenever possible.
This doesn't solve the issue with systemd services, does it? Even if the dbus service file contains the appid, if the systemd service name will always be whatever the systemd service file is. This might still be a good idea. It makes sure only apps end up with the "app-" prefix and not random services which don't happen do have a corresponding systemd service. On the other hand this opt-in requires the app developers to adjust to it. Just looking for a corresponding desktop file doesn't have those issues (but requires the .service and .desktop files to be named to same).
Isn't this basically already the case according to the systemd desktop integration spec? It says:
Apparently @benzea wrote this. Any opinion?
Yeah, I think we should push for that but I'm not sure what that would involve. |
Sorry, I wasn't clear enough about I don't think adding the app ID to the D-Bus service file would be useful, because the important thing on D-Bus is the bus name, which should match the app ID anyway. The D-Bus service file should ideally always be The names of systemd service files have traditionally used the same short name you might use in |
The API would guarantee that a missing The current naming-scheme already allows this, but as @swick correctly pointed out, this has not been part of our API guarantees in any way and is really fragile to rely upon. Hence, the proposed switch to a documented naming scheme plus documenting this as ABI. I am open to other suggestions, especially if they allow reliably deducing the appid from the dbus-activation file. |
Re-reading it with the knowledge that the service is a systemd service...
That would be giving up on the systemd naming convention and we would have yet another convention of how to get the app id from a process. I would much prefer to move everything over to the systemd naming convention if at all possible. The transient unit case is low hanging fruit. The systemd service case is a bit more interesting.
Sure, but on the other hand none of those are what I would consider applications. None of them have any reason to use portals and if they do, having a host app with an empty app id should just be considered authorized. That's why I was also asking if we should only enforce the systemd naming convention for transient units if the dbus service file has a corresponding desktop file (maybe require NoDisplay=false). Why do you prefer to add another key to the systemd service file instead of renaming the file according to the systemd naming convention? |
I don't prefer it, exactly, but there are two reasons I thought it should be considered:
|
This seems odd to me: usually D-Bus service files are written by application authors and only read by a message bus implementation (dbus-daemon or dbus-broker), and occasionally read/written by a sandboxed-app framework like Flatpak that needs to transform the Exec line. Applications usually only care about whether the name is activatable or not, which they canonically find out from |
I checked my install and there is literally no service for what I would consider an application. I suspect there are not many which ship with a systemd service file. Could we reasonable rename them upstream?
Not if you follow the naming schema for the systemd service file. |
This is still relevant. Not sure how to push it forward though. I think there are two problems:
I would say we can just ignore 1. and then in the future change the service file names when it makes sense. For the second issue maybe one of those is a reasonable solution:
|
Dbus activated processes currently live in transient units with the scheme
dbus-<unique>-<ServiceName>@<instance>.service
. The systemd Desktop Environments Integration specification says that applications should be in service or scopes which follow the following schemeapp[-<launcher>]-<ApplicationID>[@<RANDOM>].service
.xdg-desktop-portal relies on this convention to derive the app id of a calling process (when the application is not authenticated by a sandboxing specific code path). This however breaks for apps started by dbus-broker. It would be nice if it followed the convention.
Can we change the schema to
app-dbus-<ServiceName>@<unique><instance>.service
? Not all services are applications. Should we change the schema only if the service has a corresponding desktop file?The text was updated successfully, but these errors were encountered: