This fragment is about to be reported (you'll remain on this page):

You can enter a comment to clarify the mistake if you would like to:

Glitches with FreeBSD shared library file perms

Today I got finally tired of constant server hangs because of Apache's httpd process' segfaults (signal 15) every one-two days and decided to rebuild all ports I have installed because, as I know, segfauls happen when binaries/shared libraries were built on a different system than on the one they're ran at. Or if they were linked to old library versions before an upgrade, for instance.

So I did this with shportupgrade -rRfbuv apache option which took the server roughly 8 hours to complete. However, after that I got zillion of Cyrus messages in my error log saying things like:

logApr 10 13:33:58 my master[866]: service imap pid 83266 in READY state: terminated abnormally
Apr 10 19:08:04 my master[866]: service lmtpunix pid 66408 in READY state: terminated abnormally

These lines quickly filled the logs resulting in 690 Megabytes (!). I didn't have a clue for some time and restarting Cyrus, Postfix or the entire server yielded no visible changes. Then I looked further into the log file – somewhere in the middle there turned out to be several lines like this:

logApr 10 20:14:40 my master[85923]: can't exec /usr/local/cyrus/bin/ctl_cyrusdb for startup: Permission denied

I tried to execute the listed command from under the cyrus user and got this message:

log/libexec/ld-elf.so.1: Shared object "libsasl2.so.2" not found, required by "ctl_cyrusdb"

Then I remembered about a similar glitch I once had after port upgrade. In a nutshell, there are 3 paths on a FreeBSD system where shared libraries and their files are installed:

  • /usr/local/lib
  • /usr/local/libdata
  • /usr/local/libexec

Most often you would want them to be readable/executable for all users because they're, like, vital to the system. However, some port upgrades don't set the or-x mode so programs using them can't run normally. This was the case in my situation today.

This is easy to fix, though:

shchmod -R o+rx /usr/local/lib /usr/local/libdata /usr/local/libexec

Also, check that /usr/local and /usr have rx bits set for others – this is usually the case but it never hurts to double-check.

Comments RSS20

Your name: Your homepage:

Text & signature markup:You can use UverseWiki markup. In short: **bold**, //italic//, %%code%%, ((URL link)), >inline quote, <[ multiline quote ]>.

Humans! Please enter "J" here: (or turn JavaScript on for automatic verification)
Subscribe by e-mail (manage):
Ctrl+Enter »