squid2.7开启Pinger功能,如下

./configure --prefix=/a8root/bin/squid2.7/ --with-pthreads --enable-forward-log --enable-follow-x-forwarded-for --enable-dlmalloc --enable-xmalloc-statistics --enable-large-cache-files --with-large-files --enable-epoll --enable-snmp --with-maxfd=65535 --enable-removal-policies=heap,lru --libdir=/usr/lib64 --includedir=/usr/include -enable-cache-digests --enable-cachemgr-hostname --enable-icmp --enable-storeio=aufs,ufs,diskd,coss
make
make install
make install-pinger
第次启动时,icmp报错:
2011/07/18 23:31:57| Starting Squid Cache version 2.7.STABLE9 for x86_64-unknown-linux-gnu...
2011/07/18 23:31:57| Process ID 9873
2011/07/18 23:31:57| With 32767 file descriptors available
2011/07/18 23:31:57| Using epoll for the IO loop
2011/07/18 23:31:57| DNS Socket created at 0.0.0.0, port 35300, FD 6
2011/07/18 23:31:57| Adding nameserver 202.106.0.20 from /etc/resolv.conf
2011/07/18 23:31:57| logfileOpen: opening log /a8root/logs/squid/access.log
2011/07/18 23:31:57| Unlinkd pipe opened on FD 11
2011/07/18 23:31:57| Swap maxSize 614400000 + 5120000 KB, estimated 47655384 objects
2011/07/18 23:31:57| Target number of buckets: 2382769
2011/07/18 23:31:57| Using 4194304 Store buckets
2011/07/18 23:31:57| Max Mem size: 5120000 KB
2011/07/18 23:31:57| Max Swap size: 614400000 KB
2011/07/18 23:31:57| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2011/07/18 23:31:57| logfileOpen: opening log /a8root/logs/squid/store.log
2011/07/18 23:31:57| Rebuilding storage in /a8root/squid/cache1 (DIRTY)
2011/07/18 23:31:57| Rebuilding storage in /a8root/squid/cache2 (DIRTY)
2011/07/18 23:31:57| Rebuilding storage in /a8root/squid/cache3 (DIRTY)
2011/07/18 23:31:57| Using Least Load store dir selection
2011/07/18 23:31:57| Current Directory is /a8root/logs
2011/07/18 23:31:57| Loaded Icons.
2011/07/18 23:31:57| Accepting accelerated HTTP connections at 0.0.0.0, port 3128, FD 16.
2011/07/18 23:31:57| Accepting ICP messages at 0.0.0.0, port 3130, FD 17.
2011/07/18 23:31:57| Accepting SNMP messages on port 3401, FD 18.
2011/07/18 23:31:57| WCCP Disabled.
2011/07/18 23:31:57| Pinger socket opened on FD 19
2011/07/18 23:31:57| Configuring 192.168.40.91 Sibling 192.168.40.91/3128/3130
2011/07/18 23:31:57| Configuring 192.168.40.125 Sibling 192.168.40.125/3128/3130
2011/07/18 23:31:57| Configuring a Parent a/3128/0
2011/07/18 23:31:57| Configuring b Parent b/80/0
2011/07/18 23:31:57| Ready to serve requests.
2011/07/18 23:31:58| Done scanning /a8root/squid/cache1 (0 entries)
2011/07/18 23:31:58| Done scanning /a8root/squid/cache2 (0 entries)
2011/07/18 23:31:58| Done scanning /a8root/squid/cache3 (0 entries)
2011/07/18 23:31:58| Finished rebuilding storage from disk.
2011/07/18 23:31:58| 0 Entries scanned
2011/07/18 23:31:58| 0 Invalid entries.
2011/07/18 23:31:58| 0 With invalid flags.
2011/07/18 23:31:58| 0 Objects loaded.
2011/07/18 23:31:58| 0 Objects expired.
2011/07/18 23:31:58| 0 Objects cancelled.
2011/07/18 23:31:58| 0 Duplicate URLs purged.
2011/07/18 23:31:58| 0 Swapfile clashes avoided.
2011/07/18 23:31:58| Took 0.8 seconds ( 0.0 objects/sec).
2011/07/18 23:31:58| Beginning Validation Procedure
2011/07/18 23:31:58| Completed Validation Procedure
2011/07/18 23:31:58| Validated 0 Entries
2011/07/18 23:31:58| store_swap_size = 0k
2011/07/18 23:31:58| storeLateRelease: released 0 objects
2011/07/18 23:32:15| CACHEMGR: <unknown>@127.0.0.1 requesting 'info'
2011/07/18 23:32:17| icmpSend: send: (111) Connection refused
2011/07/18 23:32:17| Closing Pinger socket on FD 19
最后解决方法如下:
chown root /a8root/bin/squid2.7/libexec/pinger #pinger属主必须是root
chmod 4711 /a8root/bin/squid2.7/libexec/pinger #权限设置为4711
[root@nokia01 squid]# ll /a8root/bin/squid2.7/libexec/pinger
-rws--x--x 1 root squid 125971 Jul 18 23:17 /a8root/bin/squid2.7/libexec/pinger
[root@nokia01 squid]#ps -ef f
root 9871 1 0 Jul18 ? Ss 0:00 /a8root/bin/squid2.7/sbin/squid -sD
squid 9873 9871 0 Jul18 ? Sl 0:02 \_ (squid) -sD
squid 9874 9873 0 Jul18 ? S 0:00 \_ (unlinkd)
squid 10073 9873 0 00:08 ? S 0:00 \_ (pinger)