Operating System - Linux
1827326 Members
5524 Online
109962 Solutions
New Discussion

Re: watchdog and /tmp partition

 
Chakravarthi
Trusted Contributor

watchdog and /tmp partition

hi,

if /tmp partition is full then watdog updates are not happening and machine is restarting. to avoid this i have to manually cleanup some space in /tmp partition.

now my question is is there any way to observe /tmp partition and restrict users not to fill the partition?



regards
chakri
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: watchdog and /tmp partition

Shalom Chakravthi,

The problem is /tmp needs to be permission 777.

Many, many applications and utilities need to write there temporary files. Its probably better to expand the /tmp filesystem than to try and restrict access.

You can run a find and erase old files there with the +mtime or +ctime directive.

I've found /tmp also fills up when I'm not careful with my admin script writing. If there I place a temporary file there, I immediately add the rm -f to the bottom of the script to avoid stuff piling up in there.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill Thorsteinson
Honored Contributor

Re: watchdog and /tmp partition

tmpreaper will cleanup old files in /tmp.

cfengine tidy task can also be used to
cleanup /tmp.

If /tmp is on disk there is usually a buffer
for root only to write to the partition.
However, if it is root that is filling up
the system the limit doesn't help.

Can you move the watchdog file to /var/tmp?
/var is generally less prone to being filled.

If /tmp is in the / partition, then writing
to unmounted files systems can also fill
up the partion. I set the mode on
the mount point to 000, then mount the
partition. This prevents writing to
unmounted partitons.
Ivan Ferreira
Honored Contributor

Re: watchdog and /tmp partition

You can use tmpwatch to clean the /tmp directory. See man tmpwatch for instructions about how to use it.

You can also write a simple script that gets the %used of the /tmp file system and start the tmpwatch command only if neccesary.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?