Question
Apache won't restart. mktemp failed
My google skills are failing me here. There’s definitely space on my server, about 51% actually. I’m getting this error when I try to restart apache:
mktemp: failed to create file via template ‘/tmp/tmp.XXXXXXXXXX’: No space left on device
/etc/init.d/apache2: 91: /etc/init.d/apache2: cannot create : Directory nonexistent
- The apache2 configtest failed.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
I have resolved the issue. Find the largest directory and clear if its safe.
Steps :
Once I found that folder in my case it was var/session folder it was more than 7GB , I deleted the folder (It was safe to delete as I was ok with loosing the session data ) and restarted the server.
Ssh- root-yourserver/var/www/html/var#: rm -rf session
recreated the directory session once again. You can delete the files inside but for me it taking too long to delete individual files so I deleted the folder which was fast .
It worked.
The session folder was very big because of lot of session files. In your case it may anything which is suspiciously very big, may be log file folder or 3rd party extension folder, find that folder and if its safe to delete it. Clear that folder and restart the server.
ssh: service apache2 restart