Thread: Ownership/Permissions Problem
I cannot run my accounting software and have, I believe, isolated the problem by running 'psql' at the command line. When I run psql logged in as myself I get this error: [rshepard@salmo ~]$ psql aesi psql: error while loading shared libraries: libpq.so.5: cannot open shared object file: Permission denied Yet, when I su to user postgres and run the command it loads the shell: postgres@salmo:/home/rshepard$ psql aesi psql (9.0.1) Type "help" for help. aesi=# What directory or file has the incorrect ownership and/or permissions, and what should they be? Rich
On 12/24/10 1:23 PM, Rich Shepard wrote: > I cannot run my accounting software and have, I believe, isolated the > problem by running 'psql' at the command line. > > When I run psql logged in as myself I get this error: > > [rshepard@salmo ~]$ psql aesi > psql: error while loading shared libraries: libpq.so.5: cannot open > shared > object file: Permission denied > > Yet, when I su to user postgres and run the command it loads the shell: > > postgres@salmo:/home/rshepard$ psql aesi > psql (9.0.1) > Type "help" for help. > > aesi=# > > What directory or file has the incorrect ownership and/or > permissions, and > what should they be? wild guess says, libpq.so.5 or whatever its linked to. on this system... $ ls -l /usr/lib/libpq* lrwxrwxrwx 1 root root 12 Dec 23 2009 /usr/lib/libpq.so.5 -> libpq.so.5.1 -rwxr-xr-x 1 root root 138316 Dec 10 2009 /usr/lib/libpq.so.5.1 it doesn't really matter who owns it, what matters is the symlinked actual file has +rx (755 or whatever)
On Fri, 24 Dec 2010, John R Pierce wrote: > wild guess says, libpq.so.5 or whatever its linked to. John, That was my original thought, too. > on this system... > > $ ls -l /usr/lib/libpq* > lrwxrwxrwx 1 root root 12 Dec 23 2009 /usr/lib/libpq.so.5 -> > libpq.so.5.1 > -rwxr-xr-x 1 root root 138316 Dec 10 2009 /usr/lib/libpq.so.5.1 Here, [root@salmo ~]# ll /usr/local/pgsql/lib/libpq* -rw-r--r-- 1 root root 191494 2010-12-14 10:08 /usr/local/pgsql/lib/libpq.a lrwxrwxrwx 1 root root 12 2010-12-14 10:08 /usr/local/pgsql/lib/libpq.so -> libpq.so.5.3* lrwxrwxrwx 1 root root 12 2010-12-14 10:08 /usr/local/pgsql/lib/libpq.so.5 -> libpq.so.5.3* -rwxr-xr-x 1 root root 153929 2010-12-14 10:08 /usr/local/pgsql/lib/libpq.so.5.3* So libpq.so.5.3 has 755 permissions. Rich
On 12/24/10 1:37 PM, Rich Shepard wrote: > On Fri, 24 Dec 2010, John R Pierce wrote: > >> wild guess says, libpq.so.5 or whatever its linked to. > > John, > > That was my original thought, too. > >> on this system... >> >> $ ls -l /usr/lib/libpq* >> lrwxrwxrwx 1 root root 12 Dec 23 2009 /usr/lib/libpq.so.5 -> >> libpq.so.5.1 >> -rwxr-xr-x 1 root root 138316 Dec 10 2009 /usr/lib/libpq.so.5.1 > > Here, > > [root@salmo ~]# ll /usr/local/pgsql/lib/libpq* > -rw-r--r-- 1 root root 191494 2010-12-14 10:08 > /usr/local/pgsql/lib/libpq.a .... I'd check the permisisons on /usr/local/pgsql and /usr/local/pgsql/lib too. if that directory is not o+r, you'll have problems too. also, use.... $ ldd `which psql` to verify you're running the right files and libs. oh, lots of libs there to check. if you get errors, do this also from the 'postgres' user and compare. $ ldd `which psql` linux-gate.so.1 => (0x40000000) libpq.so.5 => /usr/lib/libpq.so.5 (0x00791000) libxslt.so.1 => /usr/lib/libxslt.so.1 (0x0047f000) libxml2.so.2 => /usr/lib/libxml2.so.2 (0x0097d000) libpam.so.0 => /lib/libpam.so.0 (0x003f3000) libssl.so.6 => /lib/libssl.so.6 (0x006e4000) libcrypto.so.6 => /lib/libcrypto.so.6 (0x004d9000) libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x0061c000) libz.so.1 => /usr/lib/libz.so.1 (0x0030a000) libreadline.so.5 => /usr/lib/libreadline.so.5 (0x0042e000) libtermcap.so.2 => /lib/libtermcap.so.2 (0x00381000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x0038c000) libdl.so.2 => /lib/libdl.so.2 (0x002c1000) libm.so.6 => /lib/libm.so.6 (0x002c7000) libc.so.6 => /lib/libc.so.6 (0x00179000) libldap_r-2.3.so.0 => /usr/lib/libldap_r-2.3.so.0 (0x0074a000) libpthread.so.0 => /lib/libpthread.so.0 (0x002f0000) libaudit.so.0 => /lib/libaudit.so.0 (0x0072d000) libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x0064c000) libcom_err.so.2 => /lib/libcom_err.so.2 (0x003ee000) libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00401000) libresolv.so.2 => /lib/libresolv.so.2 (0x003d9000) libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x004ce000) libkeyutils.so.1 => /lib/libkeyutils.so.1 (0x00429000) /lib/ld-linux.so.2 (0x0015b000) liblber-2.3.so.0 => /usr/lib/liblber-2.3.so.0 (0x004b6000) libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0x00464000) libselinux.so.1 => /lib/libselinux.so.1 (0x00367000) libsepol.so.1 => /lib/libsepol.so.1 (0x0031f000)
On Fri, 24 Dec 2010, John R Pierce wrote: > I'd check the permisisons on /usr/local/pgsql and /usr/local/pgsql/lib too. > if that directory is not o+r, you'll have problems too. John, Bingo! The subdirectories in /usr/local/pgsql were 700. Changing them to 755 fixed everything. _Very_ much appreciated; this has distracted me since last Sunday. Happy holidays, Rich
On Fri, 2010-12-24 at 14:09 -0800, Rich Shepard wrote: > On Fri, 24 Dec 2010, John R Pierce wrote: > > > I'd check the permisisons on /usr/local/pgsql and /usr/local/pgsql/lib too. > > if that directory is not o+r, you'll have problems too. > > John, > > Bingo! The subdirectories in /usr/local/pgsql were 700. Changing them to > 755 fixed everything. > You will want to make sure you didn't do that to /usr/local/pgsql/data . /usr/local/pgsql/data should be 700. JD -- PostgreSQL.org Major Contributor Command Prompt, Inc: http://www.commandprompt.com/ - 509.416.6579 Consulting, Training, Support, Custom Development, Engineering http://twitter.com/cmdpromptinc | http://identi.ca/commandprompt
On Fri, 24 Dec 2010, Joshua D. Drake wrote: > You will want to make sure you didn't do that to /usr/local/pgsql/data . > /usr/local/pgsql/data should be 700. Thanks, Josh. Fixed. Rich