public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Is this cruft in my /tmp?
@ 2006-07-22 22:50 Mick
  2006-07-23  5:25 ` Philip Webb
  0 siblings, 1 reply; 7+ messages in thread
From: Mick @ 2006-07-22 22:50 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 2341 bytes --]

Hi All,

I was checking my /tmp and noticed a rather large number of two different 
types of files.  By far the largest number (some hundreds of files) are of 
the type:

prw-------   1 root    root         0 Jun 29 23:13 sh-np-1151622697
prw-------   1 root    root         0 Jun 29 17:44 sh-np-1151623392
prw-------   1 root    root         0 Jun 29 17:44 sh-np-1151623817
prw-------   1 root    root         0 Jun 29 23:13 sh-np-1151630251
prw-------   1 root    root         0 Jun 29 19:41 sh-np-1151630339
prw-------   1 root    root         0 Jul  1 01:14 sh-np-1151697722
prw-------   1 root    root         0 Jun 30 21:28 sh-np-1151698413

Are these some process calls that were cought in the /tmp when perhaps the 
machine crashed some time in the past, or when I might have shutdown with 
screen session(s) running in the background - I occasionally forget the odd 
screen session and since I don't get some system alert I invariably shutdown.  
8-/  However, there's far too many of them and their atimes seem rather 
regular.  Can/should I delete them?

Second largest occurrence I noticed (around 130 dir) is like this:

drwx------   2 michael users       80 Jul 19 08:51 gpg-pYdYc1
drwx------   2 michael users       80 Jul 19 06:59 gpg-pgQnty
drwx------   2 michael users       80 Apr 24 07:51 gpg-qHHiXP
drwx------   2 michael users       80 Jul 15 00:34 gpg-qT7BVZ
drwx------   2 michael users       80 Jul 10 21:36 gpg-qcGu33
drwx------   2 michael users       80 May  1 12:18 gpg-rqoxKq
drwx------   2 michael users       80 Jul 10 20:28 gpg-sefR85

Not sure why there are so many of these there.  I assume these are created 
when gpg-agent is launched and sets the ENV variable?  Each one of them has a 
file like this in it:

# ls -la /tmp/gpg-VLQYJv
total 159
drwx------   2 michael users     80 Jul  8 12:31 .
drwxrwxrwt 156 root    root  162528 Jul 22 23:12 ..
srwxr-xr-x   1 michael users      0 Jul  8 12:31 S.gpg-agent

Are these beign created by some error in my set up?  Shouldn't they be deleted 
when the gpg-agent exits, when I exit X?  Can/should I remove them?  If 
either of these are because of some system configuration error could you 
please make some suggestions for troubleshooting or fixing it?  Let me know 
if you need more info.
-- 
Regards,
Mick

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Is this cruft in my /tmp?
  2006-07-22 22:50 [gentoo-user] Is this cruft in my /tmp? Mick
@ 2006-07-23  5:25 ` Philip Webb
  2006-07-23 13:29   ` Philip Webb
       [not found]   ` <200607231218.46831.michaelkintzios@gmail.com>
  0 siblings, 2 replies; 7+ messages in thread
From: Philip Webb @ 2006-07-23  5:25 UTC (permalink / raw
  To: gentoo-user

060722 Mick wrote:
> I noticed in  /tmp  a rather large number of files of the type:
>   prw-------   1 root    root         0 Jun 29 23:13 sh-np-1151622697
>   prw-------   1 root    root         0 Jun 29 17:44 sh-np-1151623392
>   prw-------   1 root    root         0 Jun 29 17:44 sh-np-1151623817
>   prw-------   1 root    root         0 Jun 29 23:13 sh-np-1151630251
>   prw-------   1 root    root         0 Jun 29 19:41 sh-np-1151630339
>   prw-------   1 root    root         0 Jul  1 01:14 sh-np-1151697722
>   prw-------   1 root    root         0 Jun 30 21:28 sh-np-1151698413
> Are these some process calls that were cought in the /tmp
> when perhaps the machine crashed some time in the past
> or when I might have shutdown with screen running in the background ?
> Can/should I delete them?

Google for 'sh-np' found :

  http://www.linuxforums.org/forum/linux-programming-scripting/37618-tmp-sh-np-xxxxxx-interrupted-system-call.html
 
It looks like part of the calculation of dependences.
I have a long list roughly daily from 050213-611 ,
so it mb related to some version of the Kernel (cp discussion above).

The File Hierarchy System is the rulebook for the purpose of files/dirs :

  http://www.pathname.com/fhs/pub/fhs-2.3.html#TMPTEMPORARYFILES

  "Programs must not assume that any files or directories in  /tmp
  are preserved between invocations of the program ...
  it is recommended that files and directories located in  /tmp
  be deleted whenever the system is booted".

NB  /var/tmp  is different :

  http://www.pathname.com/fhs/pub/fhs-2.3.html#VARTMPTEMPORARYFILESPRESERVEDBETWEE

  "The  /var/tmp  directory is made available for programs that require
  temporary files or directories that are preserved between system reboots".

So if Gentoo follows FHS rules, it sb safe to delete any file/dir in  /tmp
which was not created at/after the latest system reboot.
However, don't do that with anything in  /var/tmp .

Anyone want to confirm/amend/deny any of this (smile) ?

-- 
========================,,============================================
SUPPORT     ___________//___,  Philip Webb : purslow@chass.utoronto.ca
ELECTRIC   /] [] [] [] [] []|  Centre for Urban & Community Studies
TRANSIT    `-O----------O---'  University of Toronto
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Is this cruft in my /tmp?
  2006-07-23  5:25 ` Philip Webb
@ 2006-07-23 13:29   ` Philip Webb
  2006-07-23 19:22     ` Mick
       [not found]   ` <200607231218.46831.michaelkintzios@gmail.com>
  1 sibling, 1 reply; 7+ messages in thread
From: Philip Webb @ 2006-07-23 13:29 UTC (permalink / raw
  To: gentoo-user

060723 Philip Webb wrote:
> 060722 Mick wrote:
>> I noticed in  /tmp  a rather large number of files of the type:
>>   prw-------   1 root    root         0 Jun 29 23:13 sh-np-1151622697
> It looks like part of the calculation of dependences.
> I have a long list roughly daily from 050213-611 ,
> so it mb related to some version of the Kernel (cp discussion above).

I deleted all the sh-np's in my own  /tmp  & rebooted without any problem.

There is no note in my home-made list of installed packages
of having done anything 050213, but there were several changes 050611 :

  050611 app-text/docbook-xml-simple-dtd-4.1.2.4-r2 [for -sgml-utils]
  050611 media-libs/libmng-1.0.8-r1 [for qt mozilla-firefox]
  050611 net-print/libgnomecups-0.2.0 [for libgnomeprint]
  050611 sys-devel/bc-1.06-r6 [was System]
  removed 050611: gnome-extra/gal-2.2.3 [for libgtkhtml]

Possibly one of the former  4  packages stopped creation of files
or the 5th package was responsible for their previous creation.

Also looking in my archives at the output of Elog ,
there were  2  packages which was updated around both those dates, ie
  
  bzip2-1.0.2-r4 -> r5 & 1.0.3 -> 1.0.3-r4 
  shadow-4.0.5-r2 -> r3 & 4.0.5-r3 -> 4.0.7-r3 

Perhaps this may point someone to an explanation.

-- 
========================,,============================================
SUPPORT     ___________//___,  Philip Webb : purslow@chass.utoronto.ca
ELECTRIC   /] [] [] [] [] []|  Centre for Urban & Community Studies
TRANSIT    `-O----------O---'  University of Toronto
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Is this cruft in my /tmp?
  2006-07-23 13:29   ` Philip Webb
@ 2006-07-23 19:22     ` Mick
  0 siblings, 0 replies; 7+ messages in thread
From: Mick @ 2006-07-23 19:22 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1558 bytes --]

Thanks Philip,

On Sunday 23 July 2006 14:29, Philip Webb wrote:
> 060723 Philip Webb wrote:

> I deleted all the sh-np's in my own  /tmp  & rebooted without any problem.

I assume what you say is that they were not recreated?

> Also looking in my archives at the output of Elog ,
> there were  2  packages which was updated around both those dates, ie
>
>   bzip2-1.0.2-r4 -> r5 & 1.0.3 -> 1.0.3-r4
>   shadow-4.0.5-r2 -> r3 & 4.0.5-r3 -> 4.0.7-r3
>
> Perhaps this may point someone to an explanation.

If you are not getting these creatures in your /tmp dir anymore and assuming 
that they are kernel dependent, it may be that they will cease to be created 
soon as I update this (stable) machine and roll up my next kernel version 
(I'm on  2.6.16-gentoo-r13 now).

This leaves the gnupg problem.  Any idea what the log-socket file is all 
about?  

srwxr-xr-x  1 michael users      0 Jun  6 20:29 log-socket

I moved it, it was not re-created yet and there doesn't seem to be a problem 
so far, other than the error message when I manually launch gpg:
================================
$ eval "$(gpg-agent --daemon)"
can't connect to `/home/michael/.gnupg/log-socket': No such file or directory
================================

If you remember my previous message when the lock file was still there, I was 
getting: 

can't connect to `/home/michael/.gnupg/log-socket': Connection refused

So it seems to need the lock file but I don't really know how it is 
(re)created.  Any ideas anyone?
-- 
Regards,
Mick

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Is this cruft in my /tmp?
       [not found]   ` <200607231218.46831.michaelkintzios@gmail.com>
@ 2006-07-29 20:36     ` Bo Ørsted Andresen
  2006-07-29 21:53       ` farfargoth
  0 siblings, 1 reply; 7+ messages in thread
From: Bo Ørsted Andresen @ 2006-07-29 20:36 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1679 bytes --]

On Sunday 23 July 2006 13:18, Mick wrote:
> I checked the script I have in my /etc/X11/Sessions/fluxbox:
> ==============================
> eval "$(gpg-agent --daemon)"
> /usr/bin/startfluxbox
> kill `echo ${GPG_AGENT_INFO} | cut -d ':' -f 2`
> ==============================
>
> Running these separately after I kill gpg-agent *and* empty the /tmp/gpg-*
> entities gives me the following semi-illuminating response:
>
> $ eval "$(gpg-agent --daemon)"
> can't connect to `/home/michael/.gnupg/log-socket': Connection refused
>
> Why does this happen?  A new ENV variable has been created alright in the
> /tmp dir:
>
> $ echo ${GPG_AGENT_INFO}
> /tmp/gpg-0UQfJ1/S.gpg-agent:11772:1
>
> I think that the kill `echo ${GPG_AGENT_INFO} | cut -d ':' -f 2` line in my
> fluxbox start up script kills the gpg-agent process but does not seem to
> flush the ENV variable, hence all this cruft accumulates in /tmp.
>
> Does anyone else have this problem?

Apparently gpg-agent does clean up properly after it when it is killed. I have 
just changed my gpg-agent.sh shutdown script as shown below. The rm and rmdir 
lines should make it clean up nicely after it.

$ cat ~/.kde/shutdown/gpg-agent.sh
#!/bin/sh
# the second field of the GPG_AGENT_INFO variable is the
# process ID of the gpg-agent active in the current session
# so we'll just kill that, rather than all of them :)
if [[ -n ${GPG_AGENT_INFO} ]]; then
        kill $(echo ${GPG_AGENT_INFO} | cut -d ':' -f 2)
        rm $(echo ${GPG_AGENT_INFO} | cut -d ':' -f 1)
        rmdir $(dirname `echo ${GPG_AGENT_INFO} | cut -d ':' -f 1`)
        unset GPG_AGENT_INFO
fi

-- 
Bo Andresen

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Is this cruft in my /tmp?
  2006-07-29 20:36     ` Bo Ørsted Andresen
@ 2006-07-29 21:53       ` farfargoth
  2006-07-30  9:13         ` Neil Bothwick
  0 siblings, 1 reply; 7+ messages in thread
From: farfargoth @ 2006-07-29 21:53 UTC (permalink / raw
  To: gentoo-user



On 7/29/06, Bo Ørsted Andresen <bo.andresen@zlin.dk> wrote:
> On Sunday 23 July 2006 13:18, Mick wrote:
> > I checked the script I have in my /etc/X11/Sessions/fluxbox:
> > ==============================
> > eval "$(gpg-agent --daemon)"
> > /usr/bin/startfluxbox
> > kill `echo ${GPG_AGENT_INFO} | cut -d ':' -f 2`
> > ==============================
> >
> > Running these separately after I kill gpg-agent *and* empty the /tmp/gpg-*
> > entities gives me the following semi-illuminating response:
> >
> > $ eval "$(gpg-agent --daemon)"
> > can't connect to `/home/michael/.gnupg/log-socket': Connection refused
> >
> > Why does this happen? A new ENV variable has been created alright in the
> > /tmp dir:
> >
> > $ echo ${GPG_AGENT_INFO}
> > /tmp/gpg-0UQfJ1/S.gpg-agent:11772:1
> >
> > I think that the kill `echo ${GPG_AGENT_INFO} | cut -d ':' -f 2` line in my
> > fluxbox start up script kills the gpg-agent process but does not seem to
> > flush the ENV variable, hence all this cruft accumulates in /tmp.
> >
> > Does anyone else have this problem?
> 
> Apparently gpg-agent does clean up properly after it when it is killed. I have
> just changed my gpg-agent.sh shutdown script as shown below. The rm and rmdir
> lines should make it clean up nicely after it.
> 
> $ cat ~/.kde/shutdown/gpg-agent.sh
> #!/bin/sh
> # the second field of the GPG_AGENT_INFO variable is the
> # process ID of the gpg-agent active in the current session
> # so we'll just kill that, rather than all of them :)
> if [[ -n ${GPG_AGENT_INFO} ]]; then
>         kill $(echo ${GPG_AGENT_INFO} | cut -d ':' -f 2)
>         rm $(echo ${GPG_AGENT_INFO} | cut -d ':' -f 1)
>         rmdir $(dirname `echo ${GPG_AGENT_INFO} | cut -d ':' -f 1`)
>         unset GPG_AGENT_INFO
> fi
> 
> --
> Bo Andresen
> 
> 

First off, doesn't one of the boot scripts clean /tmp? Or is that just my imagination?
Second, I have found that it is better to mount /tmp as a tmpfs. That way I get a (slight) increase in performance when I'm ripping cd's and stuff, I don't risk running out of space on / (not all that big of a problem, though), whenever I turn the computer of /tmp get's cleared and, last but not least, I tell myself that I get more battery-time on my laptop since it doesmn't have to write to disk as much. Yay!
To do this, all you need is to put
none                    /tmp            tmpfs           defaults        0 0
in /etc/fstab. Add size=nbytes to select maximum size of the filesystem. Defaults to half of ram.


-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] Is this cruft in my /tmp?
  2006-07-29 21:53       ` farfargoth
@ 2006-07-30  9:13         ` Neil Bothwick
  0 siblings, 0 replies; 7+ messages in thread
From: Neil Bothwick @ 2006-07-30  9:13 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 419 bytes --]

On Sat, 29 Jul 2006 23:53:09 +0200, farfargoth@gmail.com wrote:

> First off, doesn't one of the boot scripts clean /tmp? Or is that just
> my imagination?

A full clean is optional, and I think it defaults to off

# /etc/conf.d/bootmisc
# Should we completely wipe out /tmp or just selectively remove known
# locks / files / etc... ?

WIPE_TMP="no"


-- 
Neil Bothwick

HTTP: Helps Transfer The Porn

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-07-30  9:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-22 22:50 [gentoo-user] Is this cruft in my /tmp? Mick
2006-07-23  5:25 ` Philip Webb
2006-07-23 13:29   ` Philip Webb
2006-07-23 19:22     ` Mick
     [not found]   ` <200607231218.46831.michaelkintzios@gmail.com>
2006-07-29 20:36     ` Bo Ørsted Andresen
2006-07-29 21:53       ` farfargoth
2006-07-30  9:13         ` Neil Bothwick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox