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

cPanel & WHM Version 74 Now in STABLE

cPanel has released cPanel & WHM Version 74 to the STABLE tier. It includes updates for some...

Installing cpanel on google cloud

Create a new CentOS 7 instance on your google cloud engine. From the cPanel & WHM System...

Install Free SSL Let’s Encrypt plugin in cPanel

Let’s Encrypt is a trusted, open source certificate authority that offers free SSL certificates...

Replace MySQL with Percona in cPanel Server

Percona Server is an enhanced drop-in replacement for MySQL. If you are a web hosting service...

Install nginx as a reverse proxy cPanel plugin

Install Nginx on your cPanel/WHM server using the Engintron cPanel Plugin as a reverse proxy. It...

Powered by WHMCompleteSolution