Re: squid can't start, can't bind to port - but lsof says nothing on port



On Feb 10, 4:09 am, Bennett Haselton <benn...@xxxxxxxxxxxxx> wrote:
I have a CentOS 5.2 server that for several weeks has been running
squid on port 9765 with no problem (only accepting requests from
certain external IPs).  Some time yesterday it stopped working, and
attempts to start squid now say only:

[root@hostname28043 squid]# service squid start
Starting squid: ....................                       [FAILED]

The last lines of the cache.log file (whose dates correspond to the
last time I attempted to start squid) say:

2009/02/10 03:48:20| Starting Squid Cache version 2.6.STABLE6 for i686-
redhat-li
nux-gnu...
2009/02/10 03:48:20| Process ID 3306
2009/02/10 03:48:20| With 1024 file descriptors available
2009/02/10 03:48:20| Using epoll for the IO loop
2009/02/10 03:48:20| DNS Socket created at 0.0.0.0, port 37819, FD 5
2009/02/10 03:48:20| Adding nameserver 67.19.0.10 from /etc/
resolv.conf
2009/02/10 03:48:20| Adding nameserver 67.19.1.10 from /etc/
resolv.conf
2009/02/10 03:48:20| User-Agent logging is disabled.
2009/02/10 03:48:20| Referer logging is disabled.
2009/02/10 03:48:20| Unlinkd pipe opened on FD 10
2009/02/10 03:48:20| Swap maxSize 102400 KB, estimated 7876 objects
2009/02/10 03:48:20| Target number of buckets: 393
2009/02/10 03:48:20| Using 8192 Store buckets
2009/02/10 03:48:20| Max Mem  size: 8192 KB
2009/02/10 03:48:20| Max Swap size: 102400 KB
2009/02/10 03:48:20| Local cache digest enabled; rebuild/rewrite every
3600/3600
 sec
2009/02/10 03:48:20| Rebuilding storage in /var/spool/squid (DIRTY)
2009/02/10 03:48:20| Using Least Load store dir selection
2009/02/10 03:48:20| Set Current Directory to /var/spool/squid
2009/02/10 03:48:20| Loaded Icons.
2009/02/10 03:48:20| commBind: Cannot bind socket FD 12 to *:9765:
(13) Permissi
on denied
FATAL: Cannot open HTTP Port
Squid Cache (Version 2.6.STABLE6): Terminated abnormally.
CPU Usage: 0.060 seconds = 0.043 user + 0.017 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0
Memory usage for squid via mallinfo():
        total space in arena:    2508 KB
        Ordinary blocks:         2405 KB      2 blks
        Small blocks:               0 KB      1 blks
        Holding blocks:           244 KB      1 blks
        Free Small blocks:          0 KB
        Free Ordinary blocks:     102 KB
        Total in use:            2649 KB 96%
        Total free:               102 KB 4%

I noted the line "Cannot bind socket FD 12 to *:9765: (13) Permission
denied" and thought maybe some process was already listening on that
port.  Following the advice in this article:http://www.debian-administration.org/articles/184

I ran
lsof -i :9765

but it reports that nothing is listening on port 9765.  So, what could
explain what I'm seeing, and how to fix it?

Bennett

OK, someone on RentACoder pointed out that SELinux was probably
preventing squid from starting, so I turned selinux off with
"setenforce 0", and they were right, after that, squid was able to
start.

But why on Earth would selinux want to prevent squid from starting?

Also, as far as I know, selinux was enabled on this server for all
these past weeks, and squid was running with no problem. (At least, I
didn't just turn selinux on, and I don't know why the hosting company
would have gone in and done it.) So I don't know why the problem
would have just turned up now.
.



Relevant Pages

  • transparent Squid + pf
    ... I am trying Transparent Squid with FreeBSD 6.2. ... rdr on $ext_if proto tcp from any to any port 80 -> ... packets going out through $ext_if with source ...
    (freebsd-questions)
  • Re: Squid not starting from rc in Jail, however works when run from root as command??
    ... Anyhow I'm trying to migrate config which was on an old SPARC server ... running Solaris 9 with a version of Squid got from the Blastwave repos ... 192.168.1.110, port 80, FD 13. ... and also Squid was built from ports too!! ...
    (freebsd-questions)
  • Re: Squid not starting from rc in Jail, however works when run from root as command??
    ... I've just built a new BSD server running on a Mini-ITX NAS chassis and it's working beautifully :-) ... Anyhow I'm trying to migrate config which was on an old SPARC server running Solaris 9 with a version of Squid got from the Blastwave repos and currently I'm having major issues with it. ... Because I built the system in a Jail I am using this syntax to bind the port to the IP address: ...
    (freebsd-questions)
  • Re: Squid stop working!!
    ... it says that squid can not open the ICP port ... ok, no i finally turn off SELinux:), ... usually works on port 3128, and the SELinux presets for allowing Squid ... a policy bug. ...
    (Fedora)
  • Re: Should a "squid" user have a shell?
    ... The only reason I'm not using the squid port is because I found a ... that has detailed instructions on installing squid for an Enterprise ... this if you if you want to add extra configure settings not supported ...
    (freebsd-questions)