Inquiry regarding XDG Base Directory Specification and root-level daemon processes

90 hi at 90.gripe
Tue Feb 27 20:09:57 UTC 2024


Hello there. In recent times, I've gotten quite heavily interested and invested into the XDGBDS and compliance with it across various pieces of software, and have even gone around to a couple of project to either propose compromises for adoption — for projects which have refused in the past to adopt it — or outright contribute it myself via patches and the like. However, a problem has come up with this endeavour which I would like to ask for some insight on.

As you may know, some programs on Unix-like operating systems consist of both a client component typically run by the current user and a server component, typically a daemon, which may or may not be invoked by a different user such as 'root'. In those cases, it usually isn't possible for this other user to determine environment variables set by the user for which BDS compliance is desired. One could, in theory, scan through the entire process tree and look for the highest-level processes being run by the compliant user before reading the environment of those processes and checking for the relevant XDG_ variables, but I imagine that this would be rather fickle and error-prone. Hence, I wondered if anyone had some other idea in mind as to how full compliance may be achieved for such server software involving daemons. How might one go about this in a reasonable manner?

Kind regards,
90


More information about the xdg mailing list