Hi,
I am facing an issue wherein some temporary files (here docs) are getting created in /tmp and are not getting deleted automatically.
When i check the list of open files with below command i can see one file is getting appended continuously.(In this case /tmp/sfe7h.34p)
The output is something like below:
bash-3.2$ /usr/sbin/lsof | grep '/tmp' | grep '(deleted)'
sh_test 13107 test 0u REG 8,3 224 1782884 /tmp/sfe7h.34p (deleted)
sh_test 13107 test 1u REG 8,3 0 1782887 /tmp/sffak.tri (deleted)
Due to this the /tmp mount point is getting full causing trouble to application.
Following is the pseudo script which runs continuously monitoring status of application and then performs some tasks.
#!/bin/ksh
get_app_status(){
result=`sqlplus -s user/password@servicename <<EOF
whenever sqlerror exit sql.sqlcode
set escape off
set head off
set verify off
set feedback off
select param_value from status where param_name='app_status'
EOF
`
echo $result
}
while [ `get_app_status` = 'Started' ]; do
#Some logic here
done
The issue won't occur if we remove the first line shell interpreter(#!/bin/ksh) or we call the get_app_status once or twice and not in loop.
Korn shell version is:
version sh (AT&T Research) 93s+ 2008-01-31
Any help in understanding the cause is deeply Appreciated.
Thanks,
Navin