Bug 1256450 - RFE: Rotate xsession-errors, perhaps use hostname in filename
RFE: Rotate xsession-errors, perhaps use hostname in filename
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: xorg-x11-xinit (Show other bugs)
21
All Linux
unspecified Severity low
: ---
: ---
Assigned To: X/OpenGL Maintenance List
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-24 11:24 EDT by Orion Poplawski
Modified: 2015-08-26 04:00 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-08-26 04:00:09 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Orion Poplawski 2015-08-24 11:24:38 EDT
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 04:00:09 EDT
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

Note You need to log in before you can comment on or make changes to this bug.