Hi. On Mon, Oct 26, 2020 at 06:35:45PM +0200, Teemu Likonen wrote: > It seems that ~/.xsession-errors file can still grow to infinity in > size. Sometimes it grows really fast. This is nothing new: we have all > seen it and talked about it. What do you do to maintain this file? > > - Do you just delete it when you happen to notice it's too big?
I used custom logrotate config, and then it dawned on me (see below). > - Do you configure some rotating system, perhaps with logrotate(8)? > (Why doesn't Debian have this automatically?) For Debian, it may work. For RHEL, for instance, such logrotate policy would be denied by SELinux. That, and inviting running-as-root logrotate to cleanup user files opens all kinds of trouble. > - Do you add it to your backup system's ignore list so that a > potentially big file doesn't fill your backups? Nope, there's no need to. > - What do Debian documentation and faq lists teach about maintaining > this potentially huge file? Prevent such writes in the first place. Hack /etc/X11/Xsession, replace logging to a file to logging to syslog. A simple one-liner will do: exec 1> >(/usr/bin/logger -e -t xsession-$USER -p user.notice) 2>&1 If you don't need all these extra messages in /var/log/messages - just write a simple rsyslogd filter. > - Why is it normal that in Debian (and GNU/Linux) you need to manually > delete a hidden file to keep it from filling your hard disks? I fail to see the difference between .xsession-errors and some user-run (cr)application logfile. Both can fill all the filesystem that you're throwing at it. Reco

