11-03-2008
When a file is created by a process it gets an inode number and as it is filled with content it gets diskspace allocated.
It is possible to delete a file from one process while it is opened (and written to) by another. A "ls" or similar command will not show this file anymore, still the diskspace (as well as the inode) occupied by the file will remain occupied as long as the process is running. When the process is killed the inode as well as the diskspace is relinquished immediately. In your case tell the software developers that their scripting is bad and/or their software is even worse, because they must somewhere open files which they do not close. Not cleaning up - that is: releasing the resources you allocate - is as bad a behavior in software development as it is in housekeeping
Historically speaking this is one of the worser pranks you could play on your "favourite" systems administrator: create a file (prefereably named with a nonprinting character like "0x255" for instance) in /tmp and write to it from an insuspiciously named background process. Then delete the file from the commandline while the process is running. Wait until /tmp is filled and watch your sysadmin going nuts trying to find what it is - because /tmp seems to be empty and even the list of open file handles will (because of the nonprinting character) not reveal at first glance what is the culprit here.
Ahh, if forgot: a reboot spoils the party therefore do this on a production system where a restart is not so easy to manage.
bakunin
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello,
does anyone have a script that can check the contents of the /tmp directory and for example e-mail the directory content if anything other than session files are present?
Maybe there are better ways to monitor suspicous /tmp and /var/tmp activity, if so I'm listening :) (1 Reply)
Discussion started by: jamesbond
1 Replies
2. UNIX for Dummies Questions & Answers
Hello,
Can someone please tell me which command to use to determine the available disk space on a given disk device?
I have to write a shell script that compresses files and stores them in a specific location but I am not sure how "conservative" I should be?
Thanks in advance!
Al. (4 Replies)
Discussion started by: alan
4 Replies
3. Solaris
Can you help. My server sunning solaris 9 on x86 platform pretty much hung for a few hours... I could not use telnet or ssh to the box - it kept refusing connection. A few hours later - I was able to log in again.
The server has not rebooted but here are the first errors in the messages log... (5 Replies)
Discussion started by: frustrated1
5 Replies
4. Shell Programming and Scripting
Hi ,
I am a documentum consultant and facing a problem with a shell script that launches an installer to install documentum . The problem i am facing is that , when i invoke the below script to install the software it says -
The directory /tmp does not contain enough space to extract... (1 Reply)
Discussion started by: h.shergill
1 Replies
5. Shell Programming and Scripting
HI ...
I am New to the Unix...I am trying to write a script to check the disk space.
But i am not able to write it.
I know the command to check the disk space df -k,but unable to write the script..Can any body help me...
Thanks in advance... (3 Replies)
Discussion started by: Kingkon
3 Replies
6. Shell Programming and Scripting
Hi Guys
i have a nice little piece of code then i need to modify so that is does not look at /Voulmes/*
thanks
sub disk_full {
my $i = 0;
open( DF, "df -l|" );
while (<DF>) {
#chomp();
next if (/^\/proc\b/);
$i++;
next if ( $i == 1 );
... (3 Replies)
Discussion started by: ab52
3 Replies
7. Shell Programming and Scripting
Hi,
I am new to shell scripting, and want to monitor disk space using shell script continously on server, which will shoot mail after crossing threshold limit
Please suggest.
Regards
Manoj (1 Reply)
Discussion started by: manoj.solaris
1 Replies
8. Solaris
Hi ,
In a server /tmp has almost reached 75% and i can see the File system utilization is 48Mb only , so i believe some process is using the /tmp space. I would like to know which process is using /tmp space.
# df -h /tmp
Filesystem size used avail capacity Mounted on
swap ... (9 Replies)
Discussion started by: chidori
9 Replies
9. Solaris
Hello All,
I have solaris server running,
uname -a
SunOS host 5.9 Generic_112233-12 sun4u sparc SUNW,Sun-Fire-280R
Filesystem Size Used Available Capacity Mounted on
/dev/md/dsk/d0 9.8G 8.7G 1.0G 90% /
/dev/dsk/c1t1d0s3 4.3G 7.7M 4.2G ... (17 Replies)
Discussion started by: gull05
17 Replies
10. UNIX for Advanced & Expert Users
Hi Team
when I boot the server I get this 2 errors :
the disk drive for /tmp is not ready yet or not present
the disk drive for /boot is not ready yet or not present
and its stay like that , I m using Ubuntu 12.04
please if someone have any idea how to fix that problem . (1 Reply)
Discussion started by: SULTAN01
1 Replies
fclose(3S) fclose(3S)
NAME
fclose(), fflush(), fclose_unlocked(), fflush_unlocked() - close or flush a stream
SYNOPSIS
Obsolescent Interfaces
DESCRIPTION
causes any buffered data for the named stream to be written out, and the stream to be closed. Buffers allocated by the standard input/out-
put system may be freed.
is performed automatically for all open files upon calling exit(2).
If stream points to an output stream or an update stream in which the most recent operation was output, causes any buffered data for the
stream to be written to that file; otherwise any buffered data is discarded. The stream remains open.
If stream is a null pointer, performs this flushing action on all currently open streams.
Obsolescent Interfaces
and close or flush a stream.
RETURN VALUE
Upon successful completion, and return 0. Otherwise, they return EOF and set to indicate the error.
ERRORS
If or fails, is set to one of:
The flag is set for the file descriptor underlying stream and the process would be delayed in the write operation.
The file descriptor underlying
stream is not valid.
An attempt was made to write a file
that exceeds the process's file size limit or the maximum file size (see ulimit(2)).
or was interrupted by a signal.
The process is in a background process group
and is attempting to write to its controlling terminal, is set, the process is neither ignoring nor blocking the signal,
and the process group of the process is orphaned.
There was no free space remaining on the device containing the file.
An attempt was made to write to a pipe
that is not open for reading by any process. A signal is also sent to the process.
Additional values may be set by the underlying and functions (see write(2), lseek(2) and close(2)).
WARNINGS
and are obsolescent interfaces supported only for compatibility with existing DCE applications. New multithreaded applications should use
and
SEE ALSO
close(2), exit(2), lseek(2), write(2), flockfile(3S), fopen(3S), setbuf(3S), thread_safety(5).
STANDARDS CONFORMANCE
fclose(3S)