Errors create/write to file in /tmp (Errcode: 13)

Some services (like MySQL) aren’t starting on reboots. You get errors create/write to file in /tmp (Errcode: 13).

This is most likely due to improper permissions on the real /tmp directory. If using /scripts/securetmp at boot time, you may not notice the problem since the script sets permissions correctly after it’s booted. The most common error you will see related to this is that mysqld will not start with errors like the following:

061113 00:14:46 mysqld started

/usr/sbin/mysqld: Can't create/write to file '/tmp/ibEkcOgQ' (Errcode: 13)

061113 0:14:47 InnoDB: Error: unable to create temporary file; errno: 13

061113 0:14:47 [ERROR] Can't init databases

061113 0:14:47 [ERROR] Aborting

061113 0:14:47 [Note] /usr/sbin/mysqld: Shutdown complete

061113 00:14:47 mysqld ended

How to fix this issue?

To fix this, unmount the /var/tmp and /tmp partitions and set the permissions correctly on the real /tmp directory ilke so:

umount /var/tmp

# umount /tmp

chmod 1777 /tmp

Edit /etc/rc.sysinit and add the following line somewhere near the rest of the /tmp stuff:

chmod 1777 /tmp

Then you can reenable /scripts/securetmp if you’d like.

If you are having trouble with other services, be sure they are enabled:

chkconfig –add pure-ftpd

If you are still getting messages after each reboot from chkservd about

services not being down, you may want to disable it with chkconfig and add it to the end of /etc/rc.local instead, to ensure that other services have time to start up first.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Replace MySQL with MariaDB in cPanel

MariaDB strives to be the logical choice for database professionals looking for a robust,...

Test MySQL database connection with php script

You can use the following php script which is used to test mysql database connection on your...

cPanel Log file locations

cPanel log file locations and Basic troubleshooting, most activity that happens on a server to...

MySQL downgrade on cPanel server

You know downgrades are not recommended, it’s always best to stick with a newer version and work...

How to repair corrupted mysql database

Sometimes it happens that your database get corrupted due to many reason like it does not get...

Powered by WHMCompleteSolution