Setting environment variables from dinit services #566
Replies: 2 comments 9 replies
|
Adding more context to the example provided. The content of After the user session is started, DBUS_SESSION_BUS_ADDRESS remains empty, although The socket is created: It would be great to have a specific instruction set in the service description file that ensures the provided environment variable is set after the process is started, using some output the process has produced. Is this feasible or the approach is wrong? edited to add more context. |
How did you check that? It seems to work for me, tested with: That said, for |
Uh oh!
There was an error while loading. Please reload this page.
Hello @davmac314 ,
I hope you are well!
While tinkering with my Artix system, I realized that whenever I start a user service that will create a socket, I am unable to update an environment variable that is valid for the entire duration of the user session.
Perhaps there is already a way of doing this, but so far I could not find it.
Taking a concrete example, after starting the
dbususer service, I need to set the value ofDBUS_SESSION_BUS_ADDRESSwith the actual socket path (usuallyunix:path=/run/user/1000/bus)The content of
dbusservice file is:The hacky way is to set the value of DBUS_SESSION_BUS_ADDRESS outside of the dinit service mechanism, but it would be great to achieve this dynamically through standard dinit features.
Is there a solution for this problem?
Thank you in advance for any feedback!
All reactions