Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7903400

DEFAULT_UNIX_ENV_VARS needs to be updated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • jtreg7.3
    • jtreg7.2
    • tools
    • None

      Tools.java currently defines the following list of variables to be preserved

          private static final String[] DEFAULT_UNIX_ENV_VARS = {
              "DISPLAY", "GNOME_DESKTOP_SESSION_ID", "HOME", "LANG",
              "LC_ALL", "LC_CTYPE", "LPDEST", "PRINTER", "TZ", "XMODIFIERS"
          };

      But modern Linux systems need some others preserved
      XDG_RUNTIME_DIR
      and
      DBUS_SESSION_BUS_ADDRESS

      are two that are set in all login environments (ie ssh etc not just desktop)
      and seem important to default correct functioning of some platform libraries

      If your UID is 1000 then typical values on Ubuntu 22.04 look like
      XDG_RUNTIME_DIR=/run/user/1000
      DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus

      There are other XDG* variables set in desktop sessions but I do not know how important they are. for example
      XDG_SESSION_TYPE=x11 (I think wayland is the other likely value)
      XDG_CURRENT_DESKTOP=ubuntu:GNOME
      We can worry about those later if they are shown to be needed.

      BTW Although we still need to run on older Linuxes on ubuntu 22.04 we have
      GNOME_DESKTOP_SESSION_ID=this_is_deprecated

      So some day (not yet) we could dispense with that

            jjg Jonathan Gibbons
            prr Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: