Re: [squid-users] Spawning external processes with Squid on FreeBSD

From: Randy Smith <compunut@dont-contact.us>
Date: Tue, 17 Jul 2001 10:37:55 -0700

I have attached all of the logs that I could find with related information
as well as the output of ldd. I looked at the environment variables in the
shell, but saw nothing that would allow me to run the tool from the command
prompt while squid could not. Please don't be alarmed by any discrepencies
in file paths between these log files and the descriptions I gave
earlier. These are from a box that is currently in production (the one I
WANT this to work on), the earlier info was from a box I was testing this
on. I did a ktrace on the test box. The error occurred, but I could find
nothing useful in the trace results. Perhaps you could understand it
better than I can. I did not attach it, it was 120k gzipped. If that is
ok, let me know and I will attach it. I didn't want to bomb the mailing
list with a large attachment.

Thank you,

Randy

#ldd smb_auth
smb_auth:
         libc.so.4 => /usr/lib/libc.so.4 (0x28065000)
the libc.so.4 file has +r for everyone, but not +x. That appears to be normal.

Contents of /var/log/messages relevent to Squid for 1 invocation:
Jun 28 08:32:51 csifw squid[230]: Starting Squid Cache version 2.3.STABLE4
for i386--freebsd4.3...
Jun 28 08:32:51 csifw squid[230]: Process ID 230
Jun 28 08:32:51 csifw squid[230]: With 1064 file descriptors available
Jun 28 08:32:51 csifw squid[230]: Performing DNS Tests...
Jun 28 08:32:51 csifw squid[230]: Successful DNS name lookup tests...
Jun 28 08:32:51 csifw squid[230]: DNS Socket created on FD 5
Jun 28 08:32:51 csifw squid[230]: Adding nameserver 192.168.20.2 from
/etc/resolv.conf
Jun 28 08:32:51 csifw squid[230]: Adding nameserver 64.243.83.2 from
/etc/resolv.conf
Jun 28 08:32:51 csifw squid[230]: Adding nameserver 216.190.74.40 from
/etc/resolv.conf
Jun 28 08:32:51 csifw squid[230]: helperOpenServers: Starting 1 'smb_auth'
processes
Jun 28 08:34:06 csifw squid[230]: WARNING: Cannot run
'/usr/local/sbin/smb_auth' process.
Jun 28 08:34:06 csifw squid[230]: Unlinkd pipe opened on FD 10
Jun 28 08:34:06 csifw squid[230]: Swap maxSize 614400 KB, estimated 47261
objects
Jun 28 08:34:06 csifw squid[230]: Target number of buckets: 945
Jun 28 08:34:06 csifw squid[230]: Using 8192 Store buckets
Jun 28 08:34:06 csifw squid[230]: Max Mem size: 16384 KB
Jun 28 08:34:06 csifw squid[230]: Max Swap size: 614400 KB
Jun 28 08:34:07 csifw squid[230]: Rebuilding storage in
/usr/local/squid/cache (CLEAN)
Jun 28 08:34:07 csifw squid[230]: Set Current Directory to
/usr/local/squid/cache
Jun 28 08:34:08 csifw squid[230]: Loaded Icons.
Jun 28 08:34:08 csifw squid[230]: Accepting HTTP connections at 0.0.0.0,
port 8080, FD 12.
Jun 28 08:34:08 csifw squid[230]: Accepting ICP messages at 0.0.0.0, port
3130, FD 13.
Jun 28 08:34:08 csifw squid[230]: WCCP Disabled.
Jun 28 08:34:08 csifw squid[230]: Ready to serve requests.
Jun 28 08:34:08 csifw squid[230]: Done reading /usr/local/squid/cache
swaplog (498 entries)
Jun 28 08:34:08 csifw squid[230]: Finished rebuilding storage from disk.
Jun 28 08:34:08 csifw squid[230]: 498 Entries scanned
Jun 28 08:34:08 csifw squid[230]: 0 Invalid entries.
Jun 28 08:34:08 csifw squid[230]: 0 With invalid flags.
Jun 28 08:34:08 csifw squid[230]: 498 Objects loaded.
Jun 28 08:34:08 csifw squid[230]: 0 Objects expired.
Jun 28 08:34:08 csifw squid[230]: 0 Objects cancelled.
Jun 28 08:34:08 csifw squid[230]: 0 Duplicate URLs purged.
Jun 28 08:34:08 csifw squid[230]: 0 Swapfile clashes avoided.
Jun 28 08:34:08 csifw squid[230]: Took 77.2 seconds ( 6.5 objects/sec).
Jun 28 08:34:08 csifw squid[230]: Beginning Validation Procedure
Jun 28 08:34:08 csifw squid[230]: Completed Validation Procedure
Jun 28 08:34:08 csifw squid[230]: Validated 498 Entries
Jun 28 08:34:08 csifw squid[230]: store_swap_size = 13258k
Jun 28 08:34:10 csifw squid[230]: storeLateRelease: released 0 objects

Contents of cache.log for 1 invocation of Squid:
2001/06/28 08:32:51| Starting Squid Cache version 2.3.STABLE4 for
i386--freebsd4.3...
2001/06/28 08:32:51| Process ID 230
2001/06/28 08:32:51| With 1064 file descriptors available
2001/06/28 08:32:51| Performing DNS Tests...
2001/06/28 08:32:51| Successful DNS name lookup tests...
2001/06/28 08:32:51| DNS Socket created on FD 5
2001/06/28 08:32:51| Adding nameserver 192.168.20.2 from /etc/resolv.conf
2001/06/28 08:32:51| Adding nameserver 64.243.83.2 from /etc/resolv.conf
2001/06/28 08:32:51| Adding nameserver 216.190.74.40 from /etc/resolv.conf
2001/06/28 08:32:51| helperOpenServers: Starting 1 'smb_auth' processes
2001/06/28 08:32:51| WARNING: Cannot run '/usr/local/sbin/smb_auth' process.
2001/06/28 08:32:51| Unlinkd pipe opened on FD 10
2001/06/28 08:32:51| Swap maxSize 614400 KB, estimated 47261 objects
2001/06/28 08:32:51| Target number of buckets: 945
2001/06/28 08:32:51| Using 8192 Store buckets
2001/06/28 08:32:51| Max Mem size: 16384 KB
2001/06/28 08:32:51| Max Swap size: 614400 KB
2001/06/28 08:32:51| Rebuilding storage in /usr/local/squid/cache (CLEAN)
2001/06/28 08:32:51| Set Current Directory to /usr/local/squid/cache
2001/06/28 08:32:51| Loaded Icons.
2001/06/28 08:32:51| Accepting HTTP connections at 0.0.0.0, port 8080, FD 12.
2001/06/28 08:32:51| Accepting ICP messages at 0.0.0.0, port 3130, FD 13.
2001/06/28 08:32:51| WCCP Disabled.
2001/06/28 08:32:51| Ready to serve requests.
2001/06/28 08:34:08| Done reading /usr/local/squid/cache swaplog (498 entries)
2001/06/28 08:34:08| Finished rebuilding storage from disk.
2001/06/28 08:34:08| 498 Entries scanned
2001/06/28 08:34:08| 0 Invalid entries.
2001/06/28 08:34:08| 0 With invalid flags.
2001/06/28 08:34:08| 498 Objects loaded.
2001/06/28 08:34:08| 0 Objects expired.
2001/06/28 08:34:08| 0 Objects cancelled.
2001/06/28 08:34:08| 0 Duplicate URLs purged.
2001/06/28 08:34:08| 0 Swapfile clashes avoided.
2001/06/28 08:34:08| Took 77.2 seconds ( 6.5 objects/sec).
2001/06/28 08:34:08| Beginning Validation Procedure
2001/06/28 08:34:08| Completed Validation Procedure
2001/06/28 08:34:08| Validated 498 Entries
2001/06/28 08:34:08| store_swap_size = 13258k
2001/06/28 08:34:09| storeLateRelease: released 0 objects
2001/07/08 14:25:02| Preparing for shutdown after 0 requests
2001/07/08 14:25:02| Waiting 30 seconds for active connections to finish
2001/07/08 14:25:02| FD 12 Closing HTTP connection
2001/07/08 14:25:02| Shutting down...
2001/07/08 14:25:02| FD 13 Closing ICP connection
2001/07/08 14:25:02| Closing unlinkd pipe on FD 10
2001/07/08 14:25:02| storeDirWriteCleanLogs: Starting...
2001/07/08 14:25:02| Finished. Wrote 498 entries.
2001/07/08 14:25:02| Took 0.1 seconds (3414.3 entries/sec).
CPU Usage: 125.453 seconds = 90.713 user + 34.740 sys
Maximum Resident Size: 9388 KB
Page faults with physical i/o: 14

Output from Truss:
__sysctl(0xbfbffa74,0x2,0x280e17e8,0xbfbffa70,0x0,0x0) = 0 (0x0)
mmap(0x0,32768,0x3,0x1002,-1,0x0) = 672014336 (0x280e2000)
geteuid() = 0 (0x0)
getuid() = 0 (0x0)
getegid() = 0 (0x0)
getgid() = 0 (0x0)
open("/var/run/ld-elf.so.hints",0,00) = 4 (0x4)
read(0x4,0xbfbffa54,0x80) = 128 (0x80)
lseek(4,0x80,0) = 128 (0x80)
read(0x4,0x280e6000,0x37) = 55 (0x37)
close(4) = 0 (0x0)
access("/usr/lib/libcrypt.so.2",0) = 0 (0x0)
open("/usr/lib/libcrypt.so.2",0,027757775314) = 4 (0x4)
fstat(4,0xbfbffa9c) = 0 (0x0)
read(0x4,0xbfbfea6c,0x1000) = 4096 (0x1000)
mmap(0x0,86016,0x5,0x2,4,0x0) = 672047104 (0x280ea000)
mmap(0x280ed000,4096,0x3,0x12,4,0x2000) = 672059392 (0x280ed000)
mmap(0x280ee000,69632,0x3,0x1012,-1,0x0) = 672063488 (0x280ee000)
close(4) = 0 (0x0)
access("/usr/lib/libm.so.2",0) = 0 (0x0)
open("/usr/lib/libm.so.2",0,027757775314) = 4 (0x4)
fstat(4,0xbfbffa9c) = 0 (0x0)
read(0x4,0xbfbfea6c,0x1000) = 4096 (0x1000)
mmap(0x0,110592,0x5,0x2,4,0x0) = 672133120 (0x280ff000)
mmap(0x28116000,16384,0x3,0x12,4,0x16000) = 672227328 (0x28116000)
close(4) = 0 (0x0)
access("/usr/lib/libc.so.4",0) = 0 (0x0)
open("/usr/lib/libc.so.4",0,027757775314) = 4 (0x4)
fstat(4,0xbfbffa9c) = 0 (0x0)
read(0x4,0xbfbfea6c,0x1000) = 4096 (0x1000)
mmap(0x0,610304,0x5,0x2,4,0x0) = 672243712 (0x2811a000)
mmap(0x28197000,20480,0x3,0x12,4,0x7c000) = 672755712 (0x28197000)
mmap(0x2819c000,77824,0x3,0x1012,-1,0x0) = 672776192 (0x2819c000)
close(4) = 0 (0x0)
sigaction(SIGILL,0xbfbffaf4,0xbfbffadc) = 0 (0x0)
sigprocmask(0x1,0x0,0x280e171c) = 0 (0x0)
sigaction(SIGILL,0xbfbffadc,0x0) = 0 (0x0)
sigprocmask(0x1,0x280e16e0,0xbfbffb1c) = 0 (0x0)
sigprocmask(0x3,0x280e16f0,0x0) = 0 (0x0)
umask(0x7) = 18 (0x12)
umask(0x12) = 7 (0x7)
gettimeofday(0xbfbffb24,0x0) = 0 (0x0)
gettimeofday(0x8155d48,0x0) = 0 (0x0)
readlink("/etc/malloc.conf",0xbfbffa5c,63) ERR#2 'No such file or
directory'
mmap(0x0,4096,0x3,0x1002,-1,0x0) = 672854016 (0x281af000)
break(0x81e6000) = 0 (0x0)
break(0x81e7000) = 0 (0x0)
break(0x81e8000) = 0 (0x0)
break(0x81e9000) = 0 (0x0)
break(0x81ea000) = 0 (0x0)
break(0x81eb000) = 0 (0x0)
break(0x81ec000) = 0 (0x0)
break(0x81ed000) = 0 (0x0)
open("/usr/local/squid/etc/squid.conf",0,0666) = 4 (0x4)
fstat(4,0xbfbffa08) = 0 (0x0)
break(0x81ef000) = 0 (0x0)
read(0x4,0x81ed000,0x2000) = 8192 (0x2000)
read(0x4,0x81ed000,0x2000) = 8192 (0x2000)
read(0x4,0x81ed000,0x2000) = 8192 (0x2000)
read(0x4,0x81ed000,0x2000) = 8192 (0x2000)
break(0x81f0000) = 0 (0x0)
read(0x4,0x81ed000,0x2000) = 8192 (0x2000)
read(0x4,0x81ed000,0x2000) = 8192 (0x2000)
break(0x81f8000) = 0 (0x0)
read(0x4,0x81ed000,0x2000) = 8192 (0x2000)
read(0x4,0x81ed000,0x2000) = 8192 (0x2000)
read(0x4,0x81ed000,0x2000) = 8192 (0x2000)
read(0x4,0x81ed000,0x2000) = 3408 (0xd50)
read(0x4,0x81ed000,0x2000) = 0 (0x0)
close(4) = 0 (0x0)
stat("/usr/local/squid/etc/mime.conf",0xbfbffa88) = 0 (0x0)
stat("/usr/local/squid/bin/unlinkd",0xbfbffa88) = 0 (0x0)
stat("/usr/local/squid/bin/smb_auth",0xbfbffa88) = 0 (0x0)
stat("/usr/local/squid/etc/icons",0xbfbffa88) = 0 (0x0)
stat("/usr/local/squid/etc/errors",0xbfbffa88) = 0 (0x0)
geteuid() = 0 (0x0)
stat("/etc/spwd.db",0xbfbff9c8) = 0 (0x0)
open("/etc/spwd.db",0,00) = 4 (0x4)
fcntl(0x4,0x2,0x1) = 0 (0x0)
read(0x4,0x81eba00,0x104) = 260 (0x104)
lseek(4,0x8000,0) = 32768 (0x8000)
read(0x4,0x81ee000,0x1000) = 4096 (0x1000)
close(4) = 0 (0x0)
open("/etc/group",0,0666) = 4 (0x4)
fstat(4,0xbfbff988) = 0 (0x0)
break(0x81fa000) = 0 (0x0)
read(0x4,0x81f8000,0x2000) = 300 (0x12c)
read(0x4,0x81f8000,0x2000) = 0 (0x0)
lseek(4,0x0,1) = 300 (0x12c)
lseek(4,0x0,0) = 0 (0x0)
read(0x4,0x81f8000,0x2000) = 300 (0x12c)
close(4) = 0 (0x0)
open("/usr/local/squid/logs/squid.pid",0,0666) ERR#2 'No such file or
directory'
socket(0x1,0x2,0x0) = 4 (0x4)
fcntl(0x4,0x2,0x1) = 0 (0x0)
connect(0x4,0xbfbffa6c,0x6a) = 0 (0x0)
fork() = 82886 (0x143c6)
sigprocmask(0x1,0x280e16e0,0xbfbffa98) = 0 (0x0)
sigprocmask(0x3,0x280e16f0,0x0) = 0 (0x0)
exit(0x0) process exit, rval = 0

At 08:15 AM 7/17/2001 +1000, you wrote:
>Hi,
>
>Stupid question I should have asked first. Is there any useful information
>in any of the logs?
>
>If not do you have access to any process tracing software like strace,
>ktrace or truss?
>
>Do you have any environment variables set that allows smb_auth to find all
>the dynamic libraries when run from the command line but may not be there
>when run from squid? What does ldd show?
>
>Colin
>
>On Mon, 16 Jul 2001, Randy Smith wrote:
>
> > Every location along the hierarchy has +rx on it for permissions. The
> > smb_auth tool is dynamically linked.
> >
> > I can actually log in to the user squid is using and run the smb_auth
> > tool. It works great from a prompt.

--
Randy Smith
compunut@neta.com
smithr@rimmercomputer.com
PGP public key available upon request.
Received on Tue Jul 17 2001 - 11:35:35 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:01:09 MST