I am using SLES 15 OS. Gnome terminal version is -
GNOME Terminal 3.26.2 Using VTE version 0.50.2 +GNUTLS
When i am trying to launch the terminal i am getting below error.
Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName for org.gnome.Terminal: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.Terminal exited with status 8
When i checked /var/log/syslog, i found this-
org.gnome.Terminal[11537]: Non UTF-8 locale (ISO-8859-1) is not supported!
I have looked for the solutions all over. I have already tried adding "LANG=en_US.UTF-8" and "LC_ALL=en_US.UTF-8" in /etc/locale.conf. Nothing works for me. Is there any exact solution for this problem? Is there any conf file in gnome where i have to set the locale? No hacks, expectation is gnome should launch after executing /usr/bin/gnome-terminal. Need to know if there is any conf file where i can make the change to fix the issue.
So basically, even after setting the locale in the right places, Gnome was not starting complaining about the non-utf8 locale. I ran gnome-session binary to get a default session for my user. There i got to know that "XDG_RUNTIME_DIR" env variable was not set and so Gnome was not able to find a working directory for the user. So when you are switching to any user using su - user, pam module doesn't set the "XDG_RUNTIME_DIR" variable and hence this issue was coming. Try setting the "XDG_RUNTIME_DIR" variable using export or in user's profile and it should work.
E.g. export XDG_RUNTIME_DIR=/run/user/1000