Bug 1256450

Summary: RFE: Rotate xsession-errors, perhaps use hostname in filename
Product: [Fedora] Fedora Reporter: Orion Poplawski <orion>
Component: xorg-x11-xinitAssignee: X/OpenGL Maintenance List <xgl-maint>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 21CC: hdegoede, negativo17, xgl-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-26 08:00:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Orion Poplawski 2015-08-24 15:24:38 UTC
Description of problem:

It would be nice to rotate the .xsession-errors to a .old.  It would also be useful to have the hostname in the filename for systems with shared home directories.

Version-Release number of selected component (if applicable):
xorg-x11-xinit-1.3.4-3.fc21.x86_64


diff --git a/Xsession b/Xsession
index 2cffea1..8fcc412 100644
--- a/Xsession
+++ b/Xsession
@@ -11,8 +11,13 @@
 # redirect errors to a file in user's home directory if we can
 if [ -z "$GDMSESSION" ]; then
     # GDM redirect output itself in a smarter fashion
-    errfile="$HOME/.xsession-errors"
+    if [ -z "$HOSTNAME" ]; then
+         errfile="$HOME/.xsession-errors"
+    else
+         errfile="$HOME/.xsession-errors-$HOSTNAME"
+    fi
     if ( umask 077 && cp /dev/null "$errfile" 2> /dev/null ); then
+        [ -f $errfile ] && mv $errfile ${errfile}.old
         chmod 600 "$errfile"
         [ -x /sbin/restorecon ] && /sbin/restorecon $errfile
         exec > "$errfile" 2>&1

Comment 1 Hans de Goede 2015-08-26 08:00:09 UTC
Hi,

X-session logging is slowly moving to using the journal / has moved to the journal for gnome sessions, so I see .xessions-errors as mostly a legacy thing. As such I do not think it is a good idea to add extra features surrounding .xsession errors.

So I'm going to close this as won'tfix, sorry.

Regards,

Hans