Results 1 to 9 of 9

Thread: Move .xsession-errors log directory

  1. #1
    Join Date
    Nov 2009
    Location
    Lake Wales Florida
    Beans
    607
    Distro
    Ubuntu 12.04 Precise Pangolin

    Move .xsession-errors log directory

    Hey all
    After much searching I'm still in the dark. I'm using an SSD drive and have all my log files sym-linked to another drive to save RW on the SSD EXCEPT the log file that is re-created upon every boot and put in the users home directory (.xsession-errors). Research has shown that this is hardcoded and not controlled by Xsession found in etc/X11 and certainly seems true from everything I've tried. I can move it using a start up file after boot and it won't be recreated for the rest of the session but that doesnt solve the problem of rewriting the file on every boot or actually letting it do its thing in another directory.
    AMD FX-6200 - MSI 4.1Ghz- Nvidia GTX550Ti -12/GIG - 60GB-SSD/500 Sata - 12.04 - Gnome 3

  2. #2
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    4,267
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Move .xsession-errors log directory

    Try using root to create an empty read-only .xsession-errors file in your folder. From a terminal:
    Code:
    rm ~/.xsession-errors
    sudo touch ~/.xsession-errors
    sudo chmod a-w ~/.xsession-errors
    According to the manual for Xsession:
    $TMPDIR/filename is where the X session error file is placed if $HOME/.xsession-errors cannot be opened. For security reasons, the exact filename is randomly generated by tempfile(1).
    In other words, if it cannot open the file in your home folder, it will do so in the main temporary folder. (If you are hoping to reduce I/O on your SSD, you have redirected your /tmp folder, haven't you? Although that kind of circumvents the point of an SSD.)

    I have not tried this, so I cannot promise that it will work. Let us know whether or not it does.
    Problems with WINE?
    Full Circle Magazine :: Confused "allot"? :: Cheap Linux stickers
    In my day, we had outdoors in which to run, play, and socialise. Now we have computers to do those.

  3. #3
    Join Date
    Nov 2009
    Location
    Lake Wales Florida
    Beans
    607
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Move .xsession-errors log directory

    Quote Originally Posted by Paddy Landau View Post
    Try using root to create an empty read-only .xsession-errors file in your folder. From a terminal:
    Code:
    rm ~/.xsession-errors
    sudo touch ~/.xsession-errors
    sudo chmod a-w ~/.xsession-errors
    According to the manual for Xsession:
    In other words, if it cannot open the file in your home folder, it will do so in the main temporary folder. (If you are hoping to reduce I/O on your SSD, you have redirected your /tmp folder, haven't you? Although that kind of circumvents the point of an SSD.)

    I have not tried this, so I cannot promise that it will work. Let us know whether or not it does.
    I've already done that. What happens is that it's changing permissions on reboot and rewriting the file. It actually shows that it you look at what I call the dummy
    /etc/X11/Xsession file. /tmp has been redirected since installing the SSD and I would love to have the file created there. What I've found with the SSD after using it for a while is that there is not much difference in performance with write cycles using the secondary 7500 RPM drive. I compile and do any write intensive work on the second drive. However the read (boot,program load etc.) makes a Huge difference. I've seen posts with folks moving there home directory to the SSD which definitely defeats the purpose. Thanks for your input.
    AMD FX-6200 - MSI 4.1Ghz- Nvidia GTX550Ti -12/GIG - 60GB-SSD/500 Sata - 12.04 - Gnome 3

  4. #4
    Join Date
    Oct 2008
    Location
    Ottawa, Canada
    Beans
    804
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Move .xsession-errors log directory

    Quote Originally Posted by Bobhuber View Post
    I've already done that. What happens is that it's changing permissions on reboot and rewriting the file.
    I've had experience with X changing permissions to suit its needs.
    The solution is to use extended atttributes instead of permissions to lock the file.
    Code:
    rm ~/.xsession-errors
    touch ~/.xsession-errors
    sudo chattr +i ~/.xsession-errors
    That way the file will be 'immutable', changing permissions will not allow modifications and your temp file should be created.

    Good luck!
    husband@wife$ make sandwich
    Permission denied
    husband@wife$ sudo make sandwich

  5. #5
    Join Date
    Nov 2009
    Location
    Lake Wales Florida
    Beans
    607
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Move .xsession-errors log directory

    Quote Originally Posted by LewisTM View Post
    I've had experience with X changing permissions to suit its needs.
    The solution is to use extended atttributes instead of permissions to lock the file.
    Code:
    rm ~/.xsession-errors
    touch ~/.xsession-errors
    sudo chattr +i ~/.xsession-errors
    That way the file will be 'immutable', changing permissions will not allow modifications and your temp file should be created.

    Good luck!
    Thanks that seems to have worked. The file is created and not changed. I don't however see any form of the error log in any file in the temp directory as Paddy Landau suggested which is alright also as long as the file is not being written somewhere else.
    AMD FX-6200 - MSI 4.1Ghz- Nvidia GTX550Ti -12/GIG - 60GB-SSD/500 Sata - 12.04 - Gnome 3

  6. #6
    Join Date
    Oct 2008
    Location
    Ottawa, Canada
    Beans
    804
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Move .xsession-errors log directory

    This thread also has useful tips, especially post #11. Basically you can edit /etc/X11/Xsession to do what you want with the log file.
    husband@wife$ make sandwich
    Permission denied
    husband@wife$ sudo make sandwich

  7. #7
    Join Date
    Nov 2009
    Location
    Lake Wales Florida
    Beans
    607
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Move .xsession-errors log directory

    Quote Originally Posted by LewisTM View Post
    This thread also has useful tips, especially post #11. Basically you can edit /etc/X11/Xsession to do what you want with the log file.
    No you can't. That's the first thing I tried . None of the changes made to that file will change the creation or location of the error log. Here's the best explanation I've found on a very old post.
    http://debathena.mit.edu/trac/ticket/153

    I can delete the file AFTER it's created or redirect the output of the file AFTER its created.
    Hopefully your trick will prove to be a final solution to keep the powers that be from continually rewriting that file with what amounts to be a lot of useless information on every boot. I keep good backups so I'm not concerned with tracking down one of my OOPs moments.
    Thanks again
    AMD FX-6200 - MSI 4.1Ghz- Nvidia GTX550Ti -12/GIG - 60GB-SSD/500 Sata - 12.04 - Gnome 3

  8. #8
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    4,267
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Move .xsession-errors log directory

    Quote Originally Posted by Bobhuber View Post
    I've seen posts with folks moving there home directory to the SSD...
    If your home folder is not on the SSD, then surely your ~/.xsession-errors is also not on the SSD?

    Quote Originally Posted by Bobhuber View Post
    Thanks that seems to have worked.
    I forgot about the immutable flag. Please mark the thread as solved.
    Problems with WINE?
    Full Circle Magazine :: Confused "allot"? :: Cheap Linux stickers
    In my day, we had outdoors in which to run, play, and socialise. Now we have computers to do those.

  9. #9
    Join Date
    Nov 2009
    Location
    Lake Wales Florida
    Beans
    607
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Move .xsession-errors log directory

    Quote Originally Posted by Paddy Landau View Post
    If your home folder is not on the SSD, then surely your ~/.xsession-errors is also not on the SSD?
    My home folder IS on the SSD and yes if your home folder was not on the SSD then the file would be where ever your home folder was located. I was pointing out that some people defeat the purpose of even having an SSD by moving there home folder or setting up a separate partition for home on another drive.I'll mark the thread solved as soon as I'm sure it actually is and the file is not lurking elsewhere. BTW thanks for your interest and input.
    AMD FX-6200 - MSI 4.1Ghz- Nvidia GTX550Ti -12/GIG - 60GB-SSD/500 Sata - 12.04 - Gnome 3

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •