This issue follows me around on Arch KDE, Neon KDE and now MX KDE. My primary concern here is that the log file is wasting my SSD writes since I like to keep up with long up-times and the issue exacerbates over time. After some days it's going to boost into overdrive and waste my writes.
- I have put this in my
/etc/fstab to create a 10MB RAM drive.
tmpfs /media/mkey/tmp tmpfs size=10000000 0 0
- I have created
a mkey_custom.sh script in my home directory
#!/bin/bash
touch /media/mkey/tmp/.xsession-errors
touch /media/mkey/tmp/.xsession-errors.old
ln -sf /media/mkey/tmp/.xsession-errors /home/mkey/.xsession-errors
ln -sf /media/mkey/tmp/.xsession-errors.old /home/mkey/.xsession-errors.old
- I have created a
mkey_custom.service file
[Unit]
Description=mkey custom service
[Service]
Type=simple
ExecStart=/bin/bash /home/mkey/mkey_custom.sh
[Install]
WantedBy=basic.target
- Finally, to install and run the service I used the following
cp mkey_custom.service /etc/systemd/system/mkey_custom.service
chmod 644 /etc/systemd/system/mkey_custom.service
systemctl enable mkey_custom.service
I found that I needed to run the script as a service as running it during startup would be too late. The OS would already start writing to the /home location, so any redirects at that point were in vain.
If after a reboot I check the /home/mkey/.xsession-errors file properties I will see that it now points to right where I want it /media/mkey/tmp/.xsession-errors and that it's being written to.
/etc/X11/Xsessiondoes not check what the symbolic link is pointing to. For me it creates a new.xsession-errorsregular file, and has.xsession-errors.oldlinked to/dev/null.That is not what I want. I want
– bjem Jan 08 '12 at 04:38.xsession-errorsredirected to/dev/null- permantently unless I explicitly change it myself..xsession-errorsis hard coded(?!) into its source code. Is there a good way to run a script after GDM loads to redirect.xsession-errorsto/dev/null? – bjem Jan 11 '12 at 02:36