Posts Tagged ‘Fix to error /var/qmail/bin/qmail-smtpd: error while loading shared libraries: libresolv.so.2: failed to map segment from shared object: Cannot allocate memory’

Fix to error qmail-smtpd: error while loading shared libraries: libresolv.so.2: failed to map segment from shared object: Cannot allocate memory

Friday, June 18th, 2010

Reading Time: < 1minute
Whilst installing a new qmail installation following instructions from www.shupp.org/toaster I have faced the error:

/var/qmail/bin/qmail-smtpd: error while loading shared libraries: libresolv.so.2: failed to map segment from shared object: Cannot allocate memory

This error is caused by a softlimit memory limitation in qmail svc’s initialization respawn script,e.g. a line in /service/qmail-smtpd/run by default equals to:

exec /usr/bin/softlimit -m 8000000

To solve the issue with/var/qmail/bin/qmail-smtpd: error while loading shared libraries: libresolv.so.2: failed to map segment from shared object: Cannot allocate memory appearing in /var/log/qmail/smtpd/current it’s necessary to increase the soflimit value on a machine with 8GB of memory to:
exec /usr/bin/softlimit -m 64000000

For servers with 4GB ram the proper soft limit would be about 64000000 divided by 2, or 32000000. Following that login you can determine what kind of softlimit limitation would be most probably for your server in accordance to the server amount of ram memory.