Postfix and tmpfs for /var/spool

Posted by Rob Fisher on Ask Ubuntu See other posts from Ask Ubuntu or by Rob Fisher
Published on 2012-11-07T22:23:18Z Indexed on 2012/11/07 23:14 UTC
Read the original article Hit count: 385

Filed under:
|
|
|

My main disk is an SSD so in order to preserve its lifetime by reducing writes I followed some advice and made /var/spool a ram disk by adding this line to /etc/fstab:

tmpfs   /var/spool tmpfs   defaults,noatime,mode=1777   0  0

Later I configured postfix because I have a RAID array on my system and mdadm wants to send me email if the RAID array fails which sounds like a fine idea. Email sending worked fine until I rebooted, at which point:

postfix: fatal: open /etc/postfix-out/main.cf: No such file or directory

The fix for this is apparently:

mkdir /var/spool/postfix
postfix check

Then I found I also had to do:

mkfifo /var/spool/postfix/public/pickup
service postfix restart

Now sending emails works fine...until the next reboot.

So: what is the most correct way to recreate the contents of /var/spool/postfix automatically at boot time if it does not exist?

I am using Ubuntu Server 12.04.

© Ask Ubuntu or respective owner

Related posts about 12.04

Related posts about server