If /dev/shm is not writeable, use /tmp