From: Bernd E. <eid...@we...> - 2007-09-10 09:40:07
|
Hi! I see some messages like [-conn:server1:8] Error: nslog: flush failed: 'Success' [-conn:server1:7] Error: nslog: flush failed: 'Success' [-conn:server1:6] Error: nslog: flush failed: 'Success' [-conn:server1:8] Error: nslog: flush failed: 'Success' in the server logfile. The nslog code part seems to be: if (logPtr->maxlines == 0) { status = LogFlush(logPtr, &ds); } else { Ns_DStringNAppend(&logPtr->buffer, ds.string, ds.length); if (++logPtr->curlines > logPtr->maxlines) { status = LogFlush(logPtr, &logPtr->buffer); logPtr->curlines = 0; } else { status = NS_OK; } } Ns_MutexUnlock(&logPtr->lock); Ns_DStringFree(&ds); if (status != NS_OK) { Ns_Log(Error, "nslog: flush failed: '%s'", strerror(errno)); } Do you know why it fails with success? :-) Bernd. |
From: Stephen D. <sd...@gm...> - 2007-09-10 10:42:59
|
On 9/10/07, Bernd Eidenschink <eid...@we...> wrote: > > Hi! > > I see some messages like > > [-conn:server1:8] Error: nslog: flush failed: 'Success' > [-conn:server1:7] Error: nslog: flush failed: 'Success' > [-conn:server1:6] Error: nslog: flush failed: 'Success' > [-conn:server1:8] Error: nslog: flush failed: 'Success' > > in the server logfile. > > The nslog code part seems to be: > > if (logPtr->maxlines == 0) { > status = LogFlush(logPtr, &ds); > } else { > Ns_DStringNAppend(&logPtr->buffer, ds.string, ds.length); > if (++logPtr->curlines > logPtr->maxlines) { > status = LogFlush(logPtr, &logPtr->buffer); > logPtr->curlines = 0; > } else { > status = NS_OK; > } > } > > Ns_MutexUnlock(&logPtr->lock); > Ns_DStringFree(&ds); > > if (status != NS_OK) { > Ns_Log(Error, "nslog: flush failed: '%s'", strerror(errno)); > } > > Do you know why it fails with success? :-) Why do birds, suddenly appear... ? :-) Are there any other log error messages? I'm guessing either the access log didn't open or didn't reopen after a role. (This particular error message looks like it's always going to be wrong). |
From: Bernd E. <eid...@we...> - 2007-09-10 11:03:49
|
Hi Stephen, > Are there any other log error messages? I'm guessing either the > access log didn't open or didn't reopen after a role. That seems to be the case: > (This particular error message looks like it's always going to be wrong). Error: nslog: flush failed: 'No such file or directory' Error: nslog: flush failed: 'Resource temporarily unavailable' Error: nslog: flush failed: 'Inappropriate ioctl for device' The last log entry is from yesterday 23:04 (when the last developer went home), no new access file since then. Bernd. |
From: Stephen D. <sd...@gm...> - 2007-09-10 11:11:16
|
On 9/10/07, Bernd Eidenschink <eid...@we...> wrote: > > Hi Stephen, > > > Are there any other log error messages? I'm guessing either the > > access log didn't open or didn't reopen after a role. > > That seems to be the case: > > > (This particular error message looks like it's always going to be wrong). > > Error: nslog: flush failed: 'No such file or directory' > Error: nslog: flush failed: 'Resource temporarily unavailable' > Error: nslog: flush failed: 'Inappropriate ioctl for device' > > The last log entry is from yesterday 23:04 (when the last developer went > home), no new access file since then. Did the partition fill up? $ df -h Or maybe the directory where the log files live was deleted/moved/had it's permissions changed...? |
From: Bernd E. <eid...@we...> - 2007-09-10 11:46:54
|
> > The last log entry is from yesterday 23:04 (when the last developer went > > home), no new access file since then. > > Did the partition fill up? > > $ df -h > > Or maybe the directory where the log files live was deleted/moved/had > it's permissions changed...? No, enough space; no logrotate stuff that could interfere, no cronjobs that change permissions, no rsync from other servers or things like that... The access-log is in the same directory as the server.log and the pidfile (logs/) on this server. |
From: Stephen D. <sd...@gm...> - 2007-09-10 12:56:58
|
On 9/10/07, Bernd Eidenschink <eid...@we...> wrote: > > > The last log entry is from yesterday 23:04 (when the last developer went > > > home), no new access file since then. > > > > Did the partition fill up? > > > > $ df -h > > > > Or maybe the directory where the log files live was deleted/moved/had > > it's permissions changed...? > > No, enough space; no logrotate stuff that could interfere, no cronjobs that > change permissions, no rsync from other servers or things like that... > The access-log is in the same directory as the server.log and the pidfile > (logs/) on this server. There's no error messages that match this pattern? "nslog: logging disabled: write() failed: '%s'" You're saying you only nslog error message you get is: "nslog: flush failed: '%s'" Are you sure? This doesn't make sense to me... As far as I can see "nslog: flush failed: '%s'" is logged from LogTrace() when LogFlush() returns NS_ERROR. LogFlush() returns NS_ERROR when: 1) logPtr->fd == -1 anyway (log file closed) 2) write() fails within LogFlush() In the second case, logPtr->fd is set to -1 and an error is logged. The error is then logged again in LogTrace(), which is wrong because firstly the error is already logged and secondly errno will be overwritten by the call to close() so the second message will be 'Success'. But you would expect to see a log message of type: "nslog: logging disabled: write() failed: '%s'". In the first case the extra log message in LogTrace( ) is also wrong, because there's been no previous failing system call to set errno. But for fd to equal -1 somewhere along the line there should have been another log message to say what failed. Even though the error logging in LogTrace() is wrong, I don't see how it could happen without your log file actually being closed, which it shouldn't be. Scan the error.log for 'nslog:' messages.... Things which could have caused the log file to be closed are: - write() failed: disk full, file too large, ... - log roll failed: either scheduled or on signal - someone changed the logfile with a call to ns_accesslog LogOpen() should have caught most of those with: "nslog: error '%s' opening '%s'" |
From: Bernd E. <eid...@we...> - 2007-09-10 13:41:13
|
Hi Stephen, > There's no error messages that match this pattern? > "nslog: logging disabled: write() failed: '%s'" > You're saying you only nslog error message you get is: > "nslog: flush failed: '%s'" > > Are you sure? This doesn't make sense to me... Hm, what I have is this: # grep nslog: server1.log*| grep -v "'Success'"| \ grep -v "Inappropriate ioctl"| \ grep -v "No such file or dir"| \ grep -v "Resource temporarily unavailable"| \ grep -v closed | grep -v opened Error: nslog: flush failed: 'Broken pipe' Error: nslog: flush failed: 'Broken pipe' Error: nslog: flush failed: 'Is a directory' Error: nslog: flush failed: 'Connection reset by peer' Error: nslog: flush failed: 'Is a directory' Error: nslog: flush failed: 'Connection reset by peer' Error: nslog: flush failed: 'Is a directory' But what I found is a long forgotten proc ns_log {priority args} { } sourced after startup that simply "puts" out extended information that shows up in the server.log. So I looked up this "Is a directory" message, e.g.: [20/Jul/2007:08:10:53][15853.1257366624][dispatch_caching { }] Warning: could'nt cache file ( /www/servers/net/pages/hlr ) because: couldn't open "/www/servers/net/pages/hlr ": illegal operation on a directory [20/Jul/2007:08:10:53][15853.3037600672][-conn:server1:3] Error: nslog: flush failed: 'Is a directory' Bernd. |
From: Stephen D. <sd...@gm...> - 2007-09-10 14:12:43
|
On 9/10/07, Bernd Eidenschink <eid...@we...> wrote: > > Hi Stephen, > > > There's no error messages that match this pattern? > > "nslog: logging disabled: write() failed: '%s'" > > You're saying you only nslog error message you get is: > > "nslog: flush failed: '%s'" > > > > Are you sure? This doesn't make sense to me... > > Hm, what I have is this: > > # grep nslog: server1.log*| grep -v "'Success'"| \ > grep -v "Inappropriate ioctl"| \ > grep -v "No such file or dir"| \ > grep -v "Resource temporarily unavailable"| \ > grep -v closed | grep -v opened Oh, you're ignoring all the interesting messages... 'flush failed' is bogus. grep -C1 'nslog:' server1.log, from the time the server last started. Attach it, or post it to a website if it's > 100k. |
From: Bernd E. <eid...@we...> - 2007-09-10 14:45:04
|
> grep -C1 'nslog:' server1.log Sent to your private mail. Bernd. |
From: Stephen D. <sd...@gm...> - 2007-09-10 15:34:01
|
On 9/10/07, Bernd Eidenschink <eid...@we...> wrote: > > grep -C1 'nslog:' server1.log > > Sent to your private mail. Last correct shutdown and startup: [08/Sep/2007:19:02:47] Notice: nslog: closed '/usr/local/nsroot/logs/access-server1.log' [08/Sep/2007:21:14:24] Notice: nslog: opened '/usr/local/nsroot/logs/access-server1.log' Here's the problem: [09/Sep/2007:00:00:00][-sched-] Notice: nslog: closed '/usr/local/nsroot/logs/access-server1.log' [09/Sep/2007:00:00:00][-sched-] Error: nslog: failed: roll '/usr/local/nsroot/logs/access-server1.log': 'No such file or directory' So, access log rolling is enabled, and it failed this past midnight. Are you sure 'ls -l /usr/local/nsroot/logs' looks good? Search your error log near '09/Sep/2007:00:00:00' and there may be more info, from rollfile etc. |
From: Neophytos D. <neo...@ph...> - 2008-01-07 10:00:48
|
I'm having the same problem as outlined below. Basically, the log fails to roll (and so does "ns_accesslog roll") eventhough the directory and the log file look good. Please note that "ns_rollfile" renames the existing log (say, access.log.000) but it does not create a new one (not sure if that is the expected behaviour). I've tried this on two different machines with the latest version from CVS (and TCL 8.5.0). Both machines are using software raid (raid1) and one of them uses lvm. Any ideas or suggestions? Best wishes, Neophytos PS. Please let me know if you need further info. Stephen Deasey wrote: > On 9/10/07, Bernd Eidenschink <eid...@we...> wrote: >>> grep -C1 'nslog:' server1.log >> Sent to your private mail. > > > Last correct shutdown and startup: > > [08/Sep/2007:19:02:47] Notice: nslog: closed > '/usr/local/nsroot/logs/access-server1.log' > > [08/Sep/2007:21:14:24] Notice: nslog: opened > '/usr/local/nsroot/logs/access-server1.log' > > > Here's the problem: > > > [09/Sep/2007:00:00:00][-sched-] Notice: nslog: closed > '/usr/local/nsroot/logs/access-server1.log' > > [09/Sep/2007:00:00:00][-sched-] Error: nslog: failed: roll > '/usr/local/nsroot/logs/access-server1.log': 'No such file or > directory' > > > So, access log rolling is enabled, and it failed this past midnight. > > Are you sure 'ls -l /usr/local/nsroot/logs' looks good? > > Search your error log near '09/Sep/2007:00:00:00' and there may be > more info, from rollfile etc. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel |
From: Stephen D. <sd...@gm...> - 2008-01-08 01:09:15
|
On Jan 7, 2008 10:00 AM, Neophytos Demetriou <neo...@ph...> wrote: > I'm having the same problem as outlined below. > > Basically, the log fails to roll (and so does "ns_accesslog roll") > eventhough the directory and the log file look good. What messages appear in your error log when you try to roll a file? If it's to be rolled at midnight, whether it actually rolls or not you'd expect to see a message from the sched thread. If you don't see it, then log rolling is not enabled. If you see that but the log does not actually roll, I would expect an error message of some sort. Looking through the code for this last time all error paths appear to be covered by log messages. Re permissions, look at the permissions of both the log files and the directory they're in. The server needs to have permission to create a new file under it's run-time uid/gid -- whereas at startup it creates the file as root. Also, has log file rolling never worked for you? If this is something new, what's changed recently? > Please note that "ns_rollfile" renames the existing log (say, > access.log.000) but it does not create a new one (not sure if that is > the expected behaviour). That's expected. It is a low-level routine to handle the renaming. ns_log roll and ns_accesslog roll call it and handle the reopening themselves. If you use it to roll some other kind of file manually, you'll have to take account of that. |
From: Neophytos D. <k2...@ph...> - 2008-01-08 12:11:47
|
Stephen Deasey wrote: > On Jan 7, 2008 10:00 AM, Neophytos Demetriou <neo...@ph...> wrote: >> I'm having the same problem as outlined below. >> >> Basically, the log fails to roll (and so does "ns_accesslog roll") >> eventhough the directory and the log file look good. > > > What messages appear in your error log when you try to roll a file? [-sched-] Notice: nslog: closed '/web/log/access.8000.log' [-sched-] Error: nslog: failed: roll '/web/log/access.8000.log': 'No such file or directory' > If it's to be rolled at midnight, whether it actually rolls or not > you'd expect to see a message from the sched thread. If you don't see > it, then log rolling is not enabled. log rolling is enabled, see error messages above and, also, configuration settings below: ns_param RollDay * ns_param RollFmt %Y-%m-%d-%H:%M ns_param RollHour 0 ns_param RollOnSignal On ns_param RollLog On > If you see that but the log does not actually roll, I would expect an > error message of some sort. Looking through the code for this last > time all error paths appear to be covered by log messages. see above > Re permissions, look at the permissions of both the log files and the > directory they're in. The server needs to have permission to create a > new file under it's run-time uid/gid -- whereas at startup it creates > the file as root. ls -la /web/log/ drwxrwxr-x 2 service-phgt-0 web 20480 Jan 8 07:50 . drwxrwxr-x 5 root web 4096 Nov 15 15:17 .. -rw-r--r-- 1 service-phgt-0 web 13514689 Jan 7 23:59 access.8000.log ps aux | grep nsd 1002 20781 2.3 6.7 491856 208840 ? Sl Jan07 32:03 /opt/naviserver-4.99.2-2008-01-07/bin/nsd -z -i -t /web/service-phgt-0/etc/nsd/config-main-8000.tcl -u service-phgt-0 -g web cat /etc/passwd | grep 1002 service-phgt-0:x:1002:407::/web/service-phgt-0:/bin/bash > Also, has log file rolling never worked for you? If this is something > new, what's changed recently? Never worked! >> Please note that "ns_rollfile" renames the existing log (say, >> access.log.000) but it does not create a new one (not sure if that is >> the expected behaviour). > > > That's expected. It is a low-level routine to handle the renaming. > ns_log roll and ns_accesslog roll call it and handle the reopening > themselves. If you use it to roll some other kind of file manually, > you'll have to take account of that. I use ns_logroll for the server/error log and rolling works fine. Thanks, Neophytos |
From: Bernd E. <eid...@we...> - 2007-09-10 16:20:26
|
> Here's the problem: > [09/Sep/2007:00:00:00][-sched-] Notice: nslog: closed > '/usr/local/nsroot/logs/access-server1.log' > > [09/Sep/2007:00:00:00][-sched-] Error: nslog: failed: roll > '/usr/local/nsroot/logs/access-server1.log': 'No such file or > directory' > > > So, access log rolling is enabled, and it failed this past midnight. > > Are you sure 'ls -l /usr/local/nsroot/logs' looks good? 4 drwxrwx--- 2 root nsgroup 4096 Sep 10 16:34 logs -rw-r--r-- 1 nsrun nsgroup 8962291 Sep 9 23:04 access-server1.log Hell. Where's a scapegoat when you need one? Thanks, Stephen. Bernd. |
From: Stephen D. <sd...@gm...> - 2007-09-10 17:00:30
|
On 9/10/07, Bernd Eidenschink <eid...@we...> wrote: > > Here's the problem: > > [09/Sep/2007:00:00:00][-sched-] Notice: nslog: closed > > '/usr/local/nsroot/logs/access-server1.log' > > > > [09/Sep/2007:00:00:00][-sched-] Error: nslog: failed: roll > > '/usr/local/nsroot/logs/access-server1.log': 'No such file or > > directory' > > > > > > So, access log rolling is enabled, and it failed this past midnight. > > > > Are you sure 'ls -l /usr/local/nsroot/logs' looks good? > > 4 drwxrwx--- 2 root nsgroup 4096 Sep 10 16:34 logs > -rw-r--r-- 1 nsrun nsgroup 8962291 Sep 9 23:04 access-server1.log > > Hell. > > Where's a scapegoat when you need one? Ah well, we found some new bugs anyway... |
From: Bernd E. <eid...@we...> - 2007-09-10 18:05:12
|
> Ah well, we found some new bugs anyway... Apropos :-) I have plenty of bugs that break down to (my) human failure in fact, here's= =20 another... My best friend is the compiling-the-postgres-driver-situation. Vlad knows, he often helps me with that but it's a neverending story. The base of the problem is we always compile Postgres from source and have = no=20 default installation directories. Example: Naviserver in /usr/local/nsroot_production Postgres in /u01/pgsql8.2.4-dev Say I checkout the modules/nsdbpg and try to compile, giving only the=20 NAVISERVER variable: gmake NAVISERVER=3D/usr/local/nsroot_production/ gcc -pipe -O2 -fomit-frame-pointer -Wall -Wno-implicit-int -fPIC -pipe -I= /usr/local/nsroot_production//include -I"/usr/local/nsroot_production/inclu= de" -DHAVE_CONFIG_H -c -o=20 nsdbpg.o nsdbpg.c In file included from nsdbpg.c:37: dbpg.h:44:22: error: libpq-fe.h: No such file or directory In file included from nsdbpg.c:37: dbpg.h:52: error: expected specifier-qualifier-list before =E2=80=98PGconn= =E2=80=99 [... lots of errors following] I try to be more specific: gmake NAVISERVER=3D/usr/local/nsroot_production \ CFLAGS=3D"-I/u01/pgsql8.2.4-dev/lib \ =2DI/u01/pgsql8.2.4-dev/include \ =2DI/usr/local/nsroot_staging/include" (Some warnings, but finally:) gcc -pipe -shared -nostartfiles -L/usr/local/nsroot_production/lib -o=20 nsdbpg.so nsdbpg.o=20 tclcmds.o -lnsdb -lpq -lnsthread -lnsd -L/usr/local/nsroot_production/lib -= ltcl8.4 -ldl -lgcc_s -lieee -lm -Wl,--export-dynamic -L/usr/local/nsroot= _production/lib -Wl,-rpath,/usr/local/nsroot_production/lib /usr/lib/gcc/i586-suse-linux/4.1.0/../../../../i586-suse-linux/bin/ld: cann= ot=20 find -lpq collect2: ld returned 1 exit status make: *** [nsdbpg.so] Error 1 So, after trying various things, I edited the Makefile and changed the line: MODLIBS =3D -lnsdb -lpq to MODLIBS =3D -L/usr/local/nsroot_production/include/nsdb.h -L/u01/pgsql8.2.4-dev/lib= /libpq.a (or) =3D -lnsdb -L/u01/pgsql8.2.4-dev/lib/libpq.a and hey! that does it - theres the nsdbpg.so But: ldd nsdbpg.so linux-gate.so.1 =3D>=20 libnsdb.so =3D> /usr/local/nsroot_production/lib/libnsdb.so=20 libnsthread.so =3D> /usr/local/nsroot_production/lib/libnsthread.so= =20 libnsd.so =3D> /usr/local/nsroot_production/lib/libnsd.so=20 libtcl8.4.so =3D> /usr/local/nsroot_production/lib/libtcl8.4.so=20 libdl.so.2 =3D> /lib/libdl.so.2=20 libgcc_s.so.1 =3D> /lib/libgcc_s.so.1=20 libm.so.6 =3D> /lib/libm.so.6=20 libc.so.6 =3D> /lib/libc.so.6=20 libz.so.1 =3D> /lib/libz.so.1=20 libcrypt.so.1 =3D> /lib/libcrypt.so.1=20 libpthread.so.0 =3D> /lib/libpthread.so.0=20 /lib/ld-linux.so.2=20 This one does not work (" undefined symbol: PQsetdbLogin"), because of libp= q=20 et. al. missing. If I compare it with this working driver (and I simpy can't tell anymore w= hat=20 I made different with that one): (ignore the "not found" messages as I don't set the LD_LIBRARY_PATH, but th= is=20 driver works then): linux-gate.so.1 =3D> =20 libnsdb.so =3D> not found libpq.so.4 =3D> /usr/lib/libpq.so.4=20 libnsthread.so =3D> not found libnsd.so =3D> not found libtcl8.4.so =3D> /usr/lib/libtcl8.4.so=20 libdl.so.2 =3D> /lib/libdl.so.2=20 libcrypt.so.1 =3D> /lib/libcrypt.so.1=20 libz.so.1 =3D> /lib/libz.so.1=20 libgcc_s.so.1 =3D> /lib/libgcc_s.so.1=20 libm.so.6 =3D> /lib/libm.so.6=20 libc.so.6 =3D> /lib/libc.so.6=20 libssl.so.0.9.8 =3D> /usr/lib/libssl.so.0.9.8=20 libcrypto.so.0.9.8 =3D> /usr/lib/libcrypto.so.0.9.8=20 libkrb5.so.3 =3D> /usr/lib/libkrb5.so.3=20 libresolv.so.2 =3D> /lib/libresolv.so.2=20 libnsl.so.1 =3D> /lib/libnsl.so.1=20 libpthread.so.0 =3D> /lib/libpthread.so.0=20 /lib/ld-linux.so.2=20 libk5crypto.so.3 =3D> /usr/lib/libk5crypto.so.3=20 libcom_err.so.2 =3D> /lib/libcom_err.so.2=20 libkrb5support.so.0 =3D> /usr/lib/libkrb5support.so.0=20 Maybe it's something really simple to change? Something obvious? Bernd. |
From: Vlad S. <vl...@cr...> - 2007-09-10 18:18:06
|
I think this is the problem, libpq.so.4 => /usr/lib/libpq.so.4 If you have PG installed in /u01/... why you link against library in /usr/lib? also, 8.2.x libpq is .5 already, not .4 Bernd Eidenschink wrote: >> Ah well, we found some new bugs anyway... > > Apropos :-) > > I have plenty of bugs that break down to (my) human failure in fact, here's > another... My best friend is the compiling-the-postgres-driver-situation. > Vlad knows, he often helps me with that but it's a neverending story. > > The base of the problem is we always compile Postgres from source and have no > default installation directories. > > Example: > Naviserver in /usr/local/nsroot_production > Postgres in /u01/pgsql8.2.4-dev > > Say I checkout the modules/nsdbpg and try to compile, giving only the > NAVISERVER variable: > > gmake NAVISERVER=/usr/local/nsroot_production/ > gcc -pipe -O2 -fomit-frame-pointer -Wall -Wno-implicit-int -fPIC -pipe -I/usr/local/nsroot_production//include -I"/usr/local/nsroot_production/include" -DHAVE_CONFIG_H -c -o > nsdbpg.o nsdbpg.c > In file included from nsdbpg.c:37: > dbpg.h:44:22: error: libpq-fe.h: No such file or directory > In file included from nsdbpg.c:37: > dbpg.h:52: error: expected specifier-qualifier-list before ‘PGconn’ > [... lots of errors following] > > I try to be more specific: > gmake NAVISERVER=/usr/local/nsroot_production \ > CFLAGS="-I/u01/pgsql8.2.4-dev/lib \ > -I/u01/pgsql8.2.4-dev/include \ > -I/usr/local/nsroot_staging/include" > > (Some warnings, but finally:) > gcc -pipe -shared -nostartfiles -L/usr/local/nsroot_production/lib -o > nsdbpg.so nsdbpg.o > tclcmds.o -lnsdb -lpq -lnsthread -lnsd -L/usr/local/nsroot_production/lib -ltcl8.4 -ldl -lgcc_s -lieee -lm -Wl,--export-dynamic -L/usr/local/nsroot_production/lib -Wl,-rpath,/usr/local/nsroot_production/lib > /usr/lib/gcc/i586-suse-linux/4.1.0/../../../../i586-suse-linux/bin/ld: cannot > find -lpq > collect2: ld returned 1 exit status > make: *** [nsdbpg.so] Error 1 > > So, after trying various things, I edited the Makefile and changed the line: > MODLIBS = -lnsdb -lpq > > to > MODLIBS > = -L/usr/local/nsroot_production/include/nsdb.h -L/u01/pgsql8.2.4-dev/lib/libpq.a > (or) > = -lnsdb -L/u01/pgsql8.2.4-dev/lib/libpq.a > > > and hey! that does it - theres the nsdbpg.so > > But: > ldd nsdbpg.so > linux-gate.so.1 => > libnsdb.so => /usr/local/nsroot_production/lib/libnsdb.so > libnsthread.so => /usr/local/nsroot_production/lib/libnsthread.so > libnsd.so => /usr/local/nsroot_production/lib/libnsd.so > libtcl8.4.so => /usr/local/nsroot_production/lib/libtcl8.4.so > libdl.so.2 => /lib/libdl.so.2 > libgcc_s.so.1 => /lib/libgcc_s.so.1 > libm.so.6 => /lib/libm.so.6 > libc.so.6 => /lib/libc.so.6 > libz.so.1 => /lib/libz.so.1 > libcrypt.so.1 => /lib/libcrypt.so.1 > libpthread.so.0 => /lib/libpthread.so.0 > /lib/ld-linux.so.2 > > This one does not work (" undefined symbol: PQsetdbLogin"), because of libpq > et. al. missing. > > If I compare it with this working driver (and I simpy can't tell anymore what > I made different with that one): > (ignore the "not found" messages as I don't set the LD_LIBRARY_PATH, but this > driver works then): > linux-gate.so.1 => > libnsdb.so => not found > libpq.so.4 => /usr/lib/libpq.so.4 > libnsthread.so => not found > libnsd.so => not found > libtcl8.4.so => /usr/lib/libtcl8.4.so > libdl.so.2 => /lib/libdl.so.2 > libcrypt.so.1 => /lib/libcrypt.so.1 > libz.so.1 => /lib/libz.so.1 > libgcc_s.so.1 => /lib/libgcc_s.so.1 > libm.so.6 => /lib/libm.so.6 > libc.so.6 => /lib/libc.so.6 > libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 > libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 > libkrb5.so.3 => /usr/lib/libkrb5.so.3 > libresolv.so.2 => /lib/libresolv.so.2 > libnsl.so.1 => /lib/libnsl.so.1 > libpthread.so.0 => /lib/libpthread.so.0 > /lib/ld-linux.so.2 > libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 > libcom_err.so.2 => /lib/libcom_err.so.2 > libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 > > Maybe it's something really simple to change? Something obvious? > > Bernd. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel |
From: Bernd E. <eid...@we...> - 2007-09-10 18:30:12
|
>If you have PG installed in /u01/... why you link against library in >/usr/lib? I don't do that at will - the problem is this is the driver that works and I can't tell in what way I compiled it different, I simply can't reproduce it. If you look at the way I compiled the non-working-one: What is wrong there? I guess I can't be more specific with the given paths? Bernd. |
From: Vlad S. <vl...@cr...> - 2007-09-10 18:24:00
|
Try to add this in the Makefile ifdef POSTGRESQL CFLAGS = -I$(POSTGRESQL)/include MODLIBS = -L$(POSTGRESQL)/lib -lnsdb -lpq -Wl,-rpath,$(POSTGRESQL)/lib endif include $(NAVISERVER)/include/Makefile.module and then try to compile as make POSTGRESQL=/u01/pgsql8.2.4-dev see what happens Bernd Eidenschink wrote: >> Ah well, we found some new bugs anyway... > > Apropos :-) > > I have plenty of bugs that break down to (my) human failure in fact, here's > another... My best friend is the compiling-the-postgres-driver-situation. > Vlad knows, he often helps me with that but it's a neverending story. > > The base of the problem is we always compile Postgres from source and have no > default installation directories. > > Example: > Naviserver in /usr/local/nsroot_production > Postgres in /u01/pgsql8.2.4-dev > > Say I checkout the modules/nsdbpg and try to compile, giving only the > NAVISERVER variable: > > gmake NAVISERVER=/usr/local/nsroot_production/ > gcc -pipe -O2 -fomit-frame-pointer -Wall -Wno-implicit-int -fPIC -pipe -I/usr/local/nsroot_production//include -I"/usr/local/nsroot_production/include" -DHAVE_CONFIG_H -c -o > nsdbpg.o nsdbpg.c > In file included from nsdbpg.c:37: > dbpg.h:44:22: error: libpq-fe.h: No such file or directory > In file included from nsdbpg.c:37: > dbpg.h:52: error: expected specifier-qualifier-list before ‘PGconn’ > [... lots of errors following] > > I try to be more specific: > gmake NAVISERVER=/usr/local/nsroot_production \ > CFLAGS="-I/u01/pgsql8.2.4-dev/lib \ > -I/u01/pgsql8.2.4-dev/include \ > -I/usr/local/nsroot_staging/include" > > (Some warnings, but finally:) > gcc -pipe -shared -nostartfiles -L/usr/local/nsroot_production/lib -o > nsdbpg.so nsdbpg.o > tclcmds.o -lnsdb -lpq -lnsthread -lnsd -L/usr/local/nsroot_production/lib -ltcl8.4 -ldl -lgcc_s -lieee -lm -Wl,--export-dynamic -L/usr/local/nsroot_production/lib -Wl,-rpath,/usr/local/nsroot_production/lib > /usr/lib/gcc/i586-suse-linux/4.1.0/../../../../i586-suse-linux/bin/ld: cannot > find -lpq > collect2: ld returned 1 exit status > make: *** [nsdbpg.so] Error 1 > > So, after trying various things, I edited the Makefile and changed the line: > MODLIBS = -lnsdb -lpq > > to > MODLIBS > = -L/usr/local/nsroot_production/include/nsdb.h -L/u01/pgsql8.2.4-dev/lib/libpq.a > (or) > = -lnsdb -L/u01/pgsql8.2.4-dev/lib/libpq.a > > > and hey! that does it - theres the nsdbpg.so > > But: > ldd nsdbpg.so > linux-gate.so.1 => > libnsdb.so => /usr/local/nsroot_production/lib/libnsdb.so > libnsthread.so => /usr/local/nsroot_production/lib/libnsthread.so > libnsd.so => /usr/local/nsroot_production/lib/libnsd.so > libtcl8.4.so => /usr/local/nsroot_production/lib/libtcl8.4.so > libdl.so.2 => /lib/libdl.so.2 > libgcc_s.so.1 => /lib/libgcc_s.so.1 > libm.so.6 => /lib/libm.so.6 > libc.so.6 => /lib/libc.so.6 > libz.so.1 => /lib/libz.so.1 > libcrypt.so.1 => /lib/libcrypt.so.1 > libpthread.so.0 => /lib/libpthread.so.0 > /lib/ld-linux.so.2 > > This one does not work (" undefined symbol: PQsetdbLogin"), because of libpq > et. al. missing. > > If I compare it with this working driver (and I simpy can't tell anymore what > I made different with that one): > (ignore the "not found" messages as I don't set the LD_LIBRARY_PATH, but this > driver works then): > linux-gate.so.1 => > libnsdb.so => not found > libpq.so.4 => /usr/lib/libpq.so.4 > libnsthread.so => not found > libnsd.so => not found > libtcl8.4.so => /usr/lib/libtcl8.4.so > libdl.so.2 => /lib/libdl.so.2 > libcrypt.so.1 => /lib/libcrypt.so.1 > libz.so.1 => /lib/libz.so.1 > libgcc_s.so.1 => /lib/libgcc_s.so.1 > libm.so.6 => /lib/libm.so.6 > libc.so.6 => /lib/libc.so.6 > libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 > libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 > libkrb5.so.3 => /usr/lib/libkrb5.so.3 > libresolv.so.2 => /lib/libresolv.so.2 > libnsl.so.1 => /lib/libnsl.so.1 > libpthread.so.0 => /lib/libpthread.so.0 > /lib/ld-linux.so.2 > libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 > libcom_err.so.2 => /lib/libcom_err.so.2 > libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 > > Maybe it's something really simple to change? Something obvious? > > Bernd. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > naviserver-devel mailing list > nav...@li... > https://lists.sourceforge.net/lists/listinfo/naviserver-devel |
From: Stephen D. <sd...@gm...> - 2007-09-10 18:44:14
|
On 9/10/07, Vlad Seryakov <vl...@cr...> wrote: > Try to add this in the Makefile > > > ifdef POSTGRESQL > CFLAGS = -I$(POSTGRESQL)/include > MODLIBS = -L$(POSTGRESQL)/lib -lnsdb -lpq -Wl,-rpath,$(POSTGRESQL)/lib > endif > > include $(NAVISERVER)/include/Makefile.module > > > and then try to compile as > > make POSTGRESQL=/u01/pgsql8.2.4-dev > > see what happens > For 4.99.3 (yeah, I know...) I'd like to convert to automake. Something like this: http://naviserver.sourceforge.net/snapshots/naviserver-autotooled-4.99.2.tar.gz Modules would then not piggy-back on Makefile.module, but have their own configure scripts, and problems like this wouldn't be so common, hopefully. Feedback on the *-autotooled above appreciated... |
From: Bernd E. <eid...@we...> - 2007-09-10 18:56:43
|
> Try to add this in the Makefile > > > ifdef POSTGRESQL > CFLAGS = -I$(POSTGRESQL)/include > MODLIBS = -L$(POSTGRESQL)/lib -lnsdb -lpq -Wl,-rpath,$(POSTGRESQL)/lib > endif > > include $(NAVISERVER)/include/Makefile.module > > > and then try to compile as > > make POSTGRESQL=/u01/pgsql8.2.4-dev > > see what happens Looks good: ldd... linux-gate.so.1 => (0xffffe000) libnsdb.so => /usr/local/nsroot_production/lib/libnsdb.so (0xb7fe6000) libpq.so.5 => /u01/pgsql8.2.4-dev/lib/libpq.so.5 (0xb7fcd000) libnsthread.so => /usr/local/nsroot_production/lib/libnsthread.so (0xb7fc7000) libnsd.so => /usr/local/nsroot_production/lib/libnsd.so (0xb7f53000) libtcl8.4.so => /usr/local/nsroot_production/lib/libtcl8.4.so (0xb7ea2000) libdl.so.2 => /lib/libdl.so.2 (0xb7e95000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7e8a000) libm.so.6 => /lib/libm.so.6 (0xb7e65000) libc.so.6 => /lib/libc.so.6 (0xb7d44000) libcrypt.so.1 => /lib/libcrypt.so.1 (0xb7d11000) libpthread.so.0 => /lib/libpthread.so.0 (0xb7cfd000) libz.so.1 => /lib/libz.so.1 (0xb7ceb000) /lib/ld-linux.so.2 (0x80000000) ...and the server starts! Big thanks! Bernd. |