1

There are files in /tmp created on each user login that look like .xsession-errors or some other log. Current name for example is /tmp/filercrEUk. I don't see them getiting erased after logout and I don't need them.

Example head content

Xsession: X session started for user at п'ятниця, 5 липня 2019 14:34:41 +0300
localuser:user being added to access control list
dbus-update-activation-environment: warning: error sending to systemd: org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.freedesktop.systemd1 exited with status 1
startkde: Starting up...
dbus-update-activation-environment: warning: error sending to systemd: org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.freedesktop.systemd1 exited with status 1
kdeinit5: preparing to launch '/usr/lib/x86_64-linux-gnu/libexec/kf5/klauncher'
kdeinit5: Launched KLauncher, pid = 498, result = 0
kdeinit5: opened connection to :0
kdeinit5: preparing to launch 'libkdeinit5_kded5'
kdeinit5: Launched KDED, pid = 503 result = 0
int_ua
  • 8,574
  • Well behaved applications will automatically delete the files they created in /tmp the very second they are no longer needed. However education is through failure so you can delete files and maybe crash an app. – WinEunuuchs2Unix Jul 05 '19 at 12:40
  • 1
    Is this a regular Kubuntu installation? I see something quite different in my Kubuntu 18.04 /tmp folder. Two entries relate to sddm, one is for ssh, five are systemd-private-…, two are Temp-…, and thelast is xauth-1000-_0. – DK Bose Jul 05 '19 at 12:42
  • @DKBose it's at least several years old and upgraded a lot of times, of course some config is modified. Not sure what exactly you mean by regular. Do you see these file* files? – int_ua Jul 05 '19 at 12:46
  • @WinEunuuchs2Unix I don't need them created in the first place and I'm searhing for a way to do this – int_ua Jul 05 '19 at 12:50
  • No, I don't see anything like what you see. I've listed what I saw in my previous comment. – DK Bose Jul 05 '19 at 12:52
  • Thank you, DK Bose, that's really interesting. I'm on 18.04 and you? It may be related to the fact that I made ~/.xsession-errors a link to /dev/null – int_ua Jul 05 '19 at 13:11
  • 1
    You have 2 problems: /tmp/ is used to dump errors IF there is no USER connected to your session. Otherwise those end up in /home/$USER/. You have a dbus (or systemd related) error in there that creates the file. 1st 1: do you have dbus-user-session installed? If not, does it make a difference after you install it? (it might do nothing but I expect the error file to be created in /home/$USER/ and not in /tmp/ or it could fix it all. But I assume there is a 2nd issue to be solved, – Rinzwind Jul 05 '19 at 13:41
  • @Rinzwind indeed, I didn't have dbus-user-session, installed it now. Although I tried removing service from https://askubuntu.com/a/94538/20275 and it ceased creating /tmp/file* logs. I'll report back later. – int_ua Jul 05 '19 at 14:20
  • 1
    I'm on Kubuntu 18.04 as I mentioned in the first comment. BTW, I don't have dbus-user-session. And it isn't installed on a regular/default Kubuntu 18.04. – DK Bose Jul 05 '19 at 15:58

1 Answers1

0

These files are created by /etc/X11/Xsession:

ERRFILE=$HOME/.xsession-errors

# attempt to create an error file; abort if we cannot
if (umask 077 && touch "$ERRFILE") 2> /dev/null && [ -w "$ERRFILE" ] &&
  [ ! -L "$ERRFILE" ]; then
  chmod 600 "$ERRFILE"
elif ERRFILE=$(tempfile 2> /dev/null); then
  if ! ln -sf "$ERRFILE" "${TMPDIR:=/tmp}/xsession-$USER"; then
    message "warning: unable to symlink \"$TMPDIR/xsession-$USER\" to" \
             "\"$ERRFILE\"; look for session log/errors in" \
             "\"$TMPDIR/xsession-$USER\"."
  fi
else
  errormsg "unable to create X session log/error file; aborting."
fi

And the only way is to patch it. It spefically includes check for ~/.xsession-errors being symlink. I've made a patch that adds checking for env var $NOXSESSIONERRORS. You can define it in /etc/environment.

int_ua
  • 8,574