Monday, December 14, 2009

Directory at /var/spool/clientmqueue/ consume a lot space

When a linux server does not allow sendmail port out but the service is running..
it will cause all the mail is in queue at the /var/spool/clientmqueue/..
due the mail cannot send out..
When left it like this all the time..
It will consume a large hard disk space..
what I face at here was, this directory had consume about 6G of the hard disk space..

When I run ls at the path, the server will hang..
nothing is about come out... for about roughly 1 or 2 hour or longer..
But when I df -h, the /var directory still have 2G available..
Although there had space but nothing can be start due to the error "not enough space to run services"..

What I can do is.. I try rm -rf * at the /var/spool/clientmqueue/..
"argument list too long error will appear"
Therefore, have to manually rm -rf one by one of the file with the mask attribute (*) at the send... example rm -rf Qm3w*
But this way consume a lot of energy and time.. and the space not decrease also..
Is totally waste of time..
So I try browse and google... I found out.. some solution.

Due to I not using sendmail at all.. I will disable the sendmail service.
By rename the file /etc/mail/submit.cf to /etc/mail/submit.cf.bak
Then I restart the sendmail service... The service cannot be start due to the
"Starting sm-client: /etc/mail/submit.cf: line 0: cannot open: No such file or directory"

Therefore.. my sendmail will not run anymore... Then I deal with the /var/spool/clientmqueue/ path by deleting all the file inside...
I use this command at /var/spool/clientmqueue/
"find . -type f -exec rm {} \;"

Left it run overnight.. and... the file at the directory is completely deleted...