Postfix thinks there isn't enough disk space in a jail

Charles Ulrich charles at idealso.com
Thu Aug 26 10:53:18 PDT 2004


adp said:
> This problem seems to be affecting Postfix in a FreeBSD jail, and I haven't
> seen this problem outside of a jail, so I'm trying questions@ first.
>
> I am running postfix-2.0.18,1 (from ports) in a FreeBSD 4.10 system in a
> jail. Everything was fine until recently I moved NFS services over to this
> same server. (This may be a red herring.) Now, every few mails I get an
> email to Postmaster like this:

In normal operation, Postfix makes a system call to check to see if it can
create a file of a certain size. Inside a jail, this call will not succeed as
per the very design of jails. Thus, you must use the following one-line patch
to make postfix work. You can use the `patch` command, but it's probably just
easiest to insert the line manually. Remember that a 'make clean' from within
the port directory will wipe this change out, patch or no.

--- ./src/util/file_limit.c.orig        Tue Aug 22 14:44:44 2000
+++ ./src/util/file_limit.c     Mon Apr  8 12:43:55 2002
   @@ -85,6 +85,7 @@
 #else
     struct rlimit rlim;
+    limit = RLIM_INFINITY;
     rlim.rlim_cur = rlim.rlim_max = limit;
     if (setrlimit(RLIMIT_FSIZE, &rlim) < 0)
        msg_fatal("setrlimit: %m");

This patch probably hasn't made it into the port because it completely
bypasses a moderately important check. As long as you keep a close eye on disk
space, you should be okay.

-- 
Charles Ulrich
System Administrator
Ideal Solution - http://www.idealso.com


More information about the freebsd-questions mailing list