mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-10-20 04:47:34 +00:00
Merge pull request #4166 from giuseppe/set-dbus-session-if-not-set
rootless: set DBUS_SESSION_BUS_ADDRESS if it is not set
This commit is contained in:
commit
32a2ce8fc0
1 changed files with 7 additions and 0 deletions
|
|
@ -387,6 +387,13 @@ func SetXdgDirs() error {
|
|||
return errors.Wrapf(err, "cannot set XDG_RUNTIME_DIR")
|
||||
}
|
||||
|
||||
if rootless.IsRootless() && os.Getenv("DBUS_SESSION_BUS_ADDRESS") == "" {
|
||||
sessionAddr := filepath.Join(runtimeDir, "bus")
|
||||
if _, err := os.Stat(sessionAddr); err == nil {
|
||||
os.Setenv("DBUS_SESSION_BUS_ADDRESS", fmt.Sprintf("unix:path=%s", sessionAddr))
|
||||
}
|
||||
}
|
||||
|
||||
// Setup XDG_CONFIG_HOME
|
||||
if cfgHomeDir := os.Getenv("XDG_CONFIG_HOME"); cfgHomeDir == "" {
|
||||
if cfgHomeDir, err = util.GetRootlessConfigHomeDir(); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue