Bug 1256450 - RFE: Rotate xsession-errors, perhaps use hostname in filename
Summary: RFE: Rotate xsession-errors, perhaps use hostname in filename
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: xorg-x11-xinit
Version: 21
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: X/OpenGL Maintenance List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-24 15:24 UTC by Orion Poplawski
Modified: 2015-08-26 08:00 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-26 08:00:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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


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