Bug 994722 - Using SSH to remotely monitor a box creates a lot of /tmp/.colorlsXXX
Summary: Using SSH to remotely monitor a box creates a lot of /tmp/.colorlsXXX
Keywords:
Status: CLOSED DUPLICATE of bug 988152
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ondrej Oprala
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-07 20:59 UTC by Scott Baker
Modified: 2013-08-14 12:34 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-14 12:34:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Scott Baker 2013-08-07 20:59:11 UTC
I use Nagios + SSH to login and monitor my servers. I noticed on my Fedora 19 server that the /tmp directory has a TON (over 9000) /tmp/.colorlsXXX files. 

I removed all of them, and now they're slowing being recreated. Looking at them, they're all associated with an SSH login. Everytime Nagios logs in to check something a new .colorlsXXX file is created.

I'm not sure what creates those files, and why they're not being removed when the SSH session closes.

Comment 1 Ondrej Vasik 2013-08-08 06:52:13 UTC
These files were introduced with the "include" support, see http://pkgs.fedoraproject.org/cgit/coreutils.git/tree/coreutils-colorls.sh script for details - /etc/profile.d/colorls.sh script creates them - but should clear them immediately automatially. What version of coreutils package do you have?

Anyway, moving this bugzilla to Ondrej Oprala, so he may analyze and adjust the feature implementation to address this. Note that there were already some fixes in this part, so coreutils version may be the difference here.

Comment 2 Ondrej Oprala 2013-08-08 08:54:02 UTC
Thanks for reporting this. Could you please provide some more information? Which shell do you use on the server side? And what coreutils version do you have?
Thanks.

Comment 3 Scott Baker 2013-08-08 15:51:52 UTC
:rpm -q coreutils
coreutils-8.21-11.fc19.x86_64

I cleared out all the files yesterday, and when I checked it today I see over 6000!

:ls /tmp/.colorls* -1 | wc 
   6176    6176  104992

We do monitor this box at least once a minute (if not more) via SSH. I did disable the tmpfs mount of /tmp per:

http://www.perturb.org/display/1134_Disable_tmpfs_on__tmp_in_Fedora.html

Not sure if that has anything to do with it.

Comment 4 Scott Baker 2013-08-08 15:53:27 UTC
I forgot to mention that my nagios user has /bin/bash as the prompt. It *should* be a pretty generic user. I created it, setup an SSH key, and put a script in its homedir to monitor the box.

Comment 5 Scott Baker 2013-08-08 16:31:59 UTC
I believe I found the bug. I had a script in /etc/profile.d/ that was changing my prompt $PS1. It was setting $PS1 even for non-interactive shells, which triggered the lscolors mktemp. I'm not sure why it would create it, but NOT delete it though.

Comment 6 Scott Baker 2013-08-08 16:38:19 UTC
You can recreate this bug by setting PS1 in /etc/profile.d like this:

echo 'PS1=testing ; export PS1' > /etc/profile.d/test.sh ; chmod +x /etc/profile.d/test.sh

Then ssh in non-interactively

ssh user "cat ~/.bash_history"

You should see a /tmp/.colorsXXX file created for each time you login.

Comment 7 Ondrej Oprala 2013-08-14 12:34:04 UTC
Thanks for the info. It seems this is a duplicate of another bug though, so I will post any additional info there.

*** This bug has been marked as a duplicate of bug 988152 ***


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