Comment 48 for bug 1197395

Revision history for this message
Clement Lefebvre (clementlefebvre) wrote :

Please don't use that as a solution... it's just for the purpose of troubleshooting:

- Add the following to /etc/profile

if [ "`id -u`" -eq 0 ]; then
  mkdir -p /run/user/0
  XDG_RUNTIME_DIR='/run/user/0'
fi

- log out and log back in.

This should force the system to behave like it did in raring. So if you're joe and your uid is 1000, it looks like this:

user -> /run/user/1000
sudo -> /home/joe/.cache (which was really bad.. but heh, at least it worked)
gksu -> /root/.cache
su - -> /run/user/0

You can test that by running a script or a program which calls g_get_user_runtime_dir() from glib and outputs it somewhere you can see.

Here's an example (main.c):

#include <stdio.h>
#include <stdlib.h>
#include <glib.h>

int main(void)
{
  const char * runtime_dir = g_get_user_runtime_dir();
  char * cmd = g_strdup_printf("notify-send 'Runtime directory is %s'", runtime_dir);
  FILE *fp = popen(cmd, "r");
  pclose(fp);
  exit(0);
}

Compile it with "gcc -Wall main.c $(pkg-config --cflags --libs glib-2.0)", you'll need the glib dev package installed.

Then mv a.out somewhere in /usr/bin and run that as yourself, with sudo, with gksu and as root behind su -.