- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: clean_tmps for /tmp and /var/tmp
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2008 11:29 AM
тАО02-10-2008 11:29 AM
clean_tmps for /tmp and /var/tmp
because of security restrictions we've had to set the sticky bit on these directories.
clean_tmps will NOT delete the files in /tmp or /var/tmp and we believe it's because of the sticky bit.
anyone run into this before? what was your solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2008 11:42 AM
тАО02-10-2008 11:42 AM
Re: clean_tmps for /tmp and /var/tmp
did you change default value in /etc/rc.config.d/clean_tmps
CLEAR_TMP=1
?
HAsan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2008 12:05 PM
тАО02-10-2008 12:05 PM
Re: clean_tmps for /tmp and /var/tmp
We just removed the sticky bit from /var/tmp, ran clean_tmps and it still didn't clear /var/tmp.
SO, back to the drawing board...
Lisa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2008 12:17 PM
тАО02-10-2008 12:17 PM
Re: clean_tmps for /tmp and /var/tmp
if you look at clean_tmps script it does not clean /var/tmp directoy . it just clean /tmp and list files in /var/tmp
Hasan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2008 12:34 PM
тАО02-10-2008 12:34 PM
Re: clean_tmps for /tmp and /var/tmp
It is always helpful when diagnosing startup script problems to examine the '/etc/rc.log'.
Since startup scripts run as root, setting the sticky bit to restrict file removal to the file's owner is immaterial in this case.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2008 08:21 PM
тАО02-10-2008 08:21 PM
Re: clean_tmps for /tmp and /var/tmp
You obviously run HP-UX 11.1 or 11.23.
They are not designed to automate
cleanup of /var/tmp at boot time.
/etc/rc.config.d/clean_tmps was
only meant for cleaning up /tmp.
However, you could modify /sbin/init.d/clean_tmps and
replace the following lines:
orig_dir="/" # we start out at '/' (root)
cd /tmp
if [ $? -ne 0 ]; then
echo "ERROR: could not change to directory "
echo "ERROR: no cleaning done"
rval=1
else
echo "NOTE: Clearing files from /tmp"
# ll |grep "^d.*"|awk '{print $9}'|grep -v "lost+found"|xargs rm -rf
#
# fix for DSDe443580: Begin :
# /sbin/init.d/clean_tmps script fails with large numbers of files in the
# /tmp directory.
# rm command was failing because the argument list was greater than ARG_MAX.
# xargs(1) is used to limit the argument size of rm to ARG_MAX.
#
# Fix for Defect JAGab68614 : Bad Patch PHCO_15932
# clean_tmps script will fail if the /tmp directory contains -name file types.
# "rm -rf" is changed to "rm -rf --"
ls | grep -v "lost+found" | xargs rm -rf --
rm lost+found 2>/dev/null
# DSDe443580 : End :
fi
cd $orig_dir
with something like:
orig_dir="/" # we start out at '/' (root)
for cldir in "/tmp /var/tmp"
do
cd /$cldir
if [ $? -ne 0 ]; then
echo "ERROR: could not change to directory <$cldir>"
echo "ERROR: no cleaning done"
rval=1
else
echo "NOTE: Clearing files from $cldir"
# ll |grep "^d.*"|awk '{print $9}'|grep -v "lost+found"|xargs rm -rf
#
# fix for DSDe443580: Begin :
# /sbin/init.d/clean_tmps script fails with large numbers of files in the
# /tmp directory.
# rm command was failing because the argument list was greater than ARG_MAX.
# xargs(1) is used to limit the argument size of rm to ARG_MAX.
#
# Fix for Defect JAGab68614 : Bad Patch PHCO_15932
# clean_tmps script will fail if the /tmp directory contains -name file types.
# "rm -rf" is changed to "rm -rf --"
ls | grep -v "lost+found" | xargs rm -rf --
rm lost+found 2>/dev/null
# DSDe443580 : End :
fi
cd $orig_dir
done
Note that each patch upgrade will possibly
overwrite /sbin/init.d/clean_tmps so
you need to save the customized copy of
the file...
Cheers,
Dusan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2008 08:22 PM
тАО02-10-2008 08:22 PM
Re: clean_tmps for /tmp and /var/tmp
They are not designed to automate
cleanup of /var/tmp at boot time.
/etc/rc.config.d/clean_tmps was
only meant for cleaning up /tmp.
However, you could modify /sbin/init.d/clean_tmps and
replace the following lines:
orig_dir="/" # we start out at '/' (root)
cd /tmp
if [ $? -ne 0 ]; then
echo "ERROR: could not change to directory "
echo "ERROR: no cleaning done"
rval=1
else
echo "NOTE: Clearing files from /tmp"
# ll |grep "^d.*"|awk '{print $9}'|grep -v "lost+found"|xargs rm -rf
#
# fix for DSDe443580: Begin :
# /sbin/init.d/clean_tmps script fails with large numbers of files in the
# /tmp directory.
# rm command was failing because the argument list was greater than ARG_MAX.
# xargs(1) is used to limit the argument size of rm to ARG_MAX.
#
# Fix for Defect JAGab68614 : Bad Patch PHCO_15932
# clean_tmps script will fail if the /tmp directory contains -name file types.
# "rm -rf" is changed to "rm -rf --"
ls | grep -v "lost+found" | xargs rm -rf --
rm lost+found 2>/dev/null
# DSDe443580 : End :
fi
cd $orig_dir
with something like:
orig_dir="/" # we start out at '/' (root)
for cldir in "/tmp /var/tmp"
do
cd /$cldir
if [ $? -ne 0 ]; then
echo "ERROR: could not change to directory <$cldir>"
echo "ERROR: no cleaning done"
rval=1
else
echo "NOTE: Clearing files from $cldir"
# ll |grep "^d.*"|awk '{print $9}'|grep -v "lost+found"|xargs rm -rf
#
# fix for DSDe443580: Begin :
# /sbin/init.d/clean_tmps script fails with large numbers of files in the
# /tmp directory.
# rm command was failing because the argument list was greater than ARG_MAX.
# xargs(1) is used to limit the argument size of rm to ARG_MAX.
#
# Fix for Defect JAGab68614 : Bad Patch PHCO_15932
# clean_tmps script will fail if the /tmp directory contains -name file types.
# "rm -rf" is changed to "rm -rf --"
ls | grep -v "lost+found" | xargs rm -rf --
rm lost+found 2>/dev/null
# DSDe443580 : End :
fi
cd $orig_dir
done
Note that each patch upgrade will possibly
overwrite /sbin/init.d/clean_tmps so
you need to save the customized copy of
the file...
Cheers,
Dusan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2008 08:23 PM
тАО02-10-2008 08:23 PM
Re: clean_tmps for /tmp and /var/tmp
They are not designed to automate
cleanup of /var/tmp at boot time.
/etc/rc.config.d/clean_tmps was
only meant for cleaning up /tmp.
However, you could modify /sbin/init.d/clean_tmps and
replace the following lines:
orig_dir="/" # we start out at '/' (root)
cd /tmp
if [ $? -ne 0 ]; then
echo "ERROR: could not change to directory "
echo "ERROR: no cleaning done"
rval=1
else
echo "NOTE: Clearing files from /tmp"
# ll |grep "^d.*"|awk '{print $9}'|grep -v "lost+found"|xargs rm -rf
#
# fix for DSDe443580: Begin :
# /sbin/init.d/clean_tmps script fails with large numbers of files in the
# /tmp directory.
# rm command was failing because the argument list was greater than ARG_MAX.
# xargs(1) is used to limit the argument size of rm to ARG_MAX.
#
# Fix for Defect JAGab68614 : Bad Patch PHCO_15932
# clean_tmps script will fail if the /tmp directory contains -name file types.
# "rm -rf" is changed to "rm -rf --"
ls | grep -v "lost+found" | xargs rm -rf --
rm lost+found 2>/dev/null
# DSDe443580 : End :
fi
cd $orig_dir
with something like:
orig_dir="/" # we start out at '/' (root)
for cldir in "/tmp /var/tmp"
do
cd /$cldir
if [ $? -ne 0 ]; then
echo "ERROR: could not change to directory <$cldir>"
echo "ERROR: no cleaning done"
rval=1
else
echo "NOTE: Clearing files from $cldir"
# ll |grep "^d.*"|awk '{print $9}'|grep -v "lost+found"|xargs rm -rf
#
# fix for DSDe443580: Begin :
# /sbin/init.d/clean_tmps script fails with large numbers of files in the
# /tmp directory.
# rm command was failing because the argument list was greater than ARG_MAX.
# xargs(1) is used to limit the argument size of rm to ARG_MAX.
#
# Fix for Defect JAGab68614 : Bad Patch PHCO_15932
# clean_tmps script will fail if the /tmp directory contains -name file types.
# "rm -rf" is changed to "rm -rf --"
ls | grep -v "lost+found" | xargs rm -rf --
rm lost+found 2>/dev/null
# DSDe443580 : End :
fi
cd $orig_dir
done
Note that each patch upgrade will possibly
overwrite /sbin/init.d/clean_tmps so
you need to save the customized copy of
the file...
Cheers,
Dusan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2008 06:52 AM
тАО02-11-2008 06:52 AM
Re: clean_tmps for /tmp and /var/tmp
Feb 10, 2008 20:17:38 GMT points for answer: Unassigned 10 9 8 7 6 5 4 3 2 1 0
--------------------------------------------------------------------------------
hi crstiana,
if you look at clean_tmps script it does not clean /var/tmp directoy . it just clean /tmp and list files in /var/tmp
Hasan
yes, it lists the files in /var/tmp. However it doesn't clean it.
cleaning of /tmp is pretty consistent, but doesn't always happen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2008 06:54 AM
тАО02-11-2008 06:54 AM
Re: clean_tmps for /tmp and /var/tmp
Hello,
You obviously run HP-UX 11.1 or 11.23.
They are not designed to automate
cleanup of /var/tmp at boot time.
/etc/rc.config.d/clean_tmps was
only meant for cleaning up /tmp.
Thank you,
we'll give this a shot today and see what happens... .
I'll get back to you in a couple hours!
Lisa