Resize /tmp partition size in cPanel and secure it
This is only applicable to our dedicated server customers.
Please follow the steps in order to resize the tmp partition for cPanel. All the following commands are to be done via SSH.
1. Stop cPanel, apache (litespeed), mysql services:
service cpanel stop
service httpd stop
service lsws stop
service mysqld stop
2. Identify and kill all tailwatchd process
pstree -p | grep tailwatchd
The above command will list all tailwatchd process. Kill them all. You can use the following command for it.
kill -9 Process_ID
3. Identify all files and processes that are using /tmp now using the following command and kill them all. The following commands lists the processes and associated users. Use the same kill -9 Process_ID to kill the processes.
fuser -cu /tmp
4. Umount /tmp and /var/tmp:
umount -l /tmp
umount -l /var/tmp
5. Move /usr/tmpDSK file to another location (just in case you need to mount it somewhere else to preserve data):
mv /usr/tmpDSK /usr/tmpDSK_back
mv
/tmp /root/tmp.backup
6. Remove tmpDSK
rm -rf /usr/tmpDSK
7. Open the file - /scripts/securetmp - which is where you set the tmpdsksize to the new desired size. Search for $tmpdsksize in this file, and modify the value set to it to the new one of your choice and save the file.
vi /scripts/securetmp
$tmpdsksize = 2048000Modify the below line to the size require, for example 8GB would use -
( 2048 * 2048 * 2 )
my $FOUR_GIG_k = ( 1024 * 1024 * 2 );
8. Run the following command to secure /tmp
/scripts/securetmp
9. Start cPanel, apache (litespeed), mysql services:
service cpanel start
service httpd start
service lsws start
service mysqld start