squid won't listen on configured port

Asked by Thomas

I can't get squid to listen on port 3128.

I see in cache.log the following line:

2019/04/08 07:38:48 kid1| Accepting HTTP Socket connections at local=[::]:3128 remote=[::] FD 11 flags=9

but the port seams not to listen:

root@proxy:~# netstat -naptu|grep 3128

gives me no output - btw. with grep squid I only get:

root@proxy:~# netstat -naptu|grep squid
udp 0 0 0.0.0.0:40325 0.0.0.0:* 922/(squid-1)
udp6 0 0 ::1:55086 ::1:56111 VERBUNDEN 922/(squid-1)
udp6 0 0 ::1:56111 ::1:55086 VERBUNDEN 922/(squid-1)
udp6 0 0 :::41648 :::* 922/(squid-1)

What I have done so far, to find/fix the problem:

a) apt --reinstall install squid squid-common squid-langpack
b) extracted the default squid.conf from deb and used them.
c) checked logfiles cache.log and syslog (last one filtered to squid and port 3128)
d) checked systemctl status squid.service
e) stopped squid, runned "rm -rv /var/spool/squid/*", started squid

All was running without errors and the logfiles was clear. No errors or warnings.

The System is running on xenial and all is uptodate.

thats my cache.log from a start:

2019/04/08 10:20:01 kid1| Set Current Directory to /var/spool/squid
2019/04/08 10:20:01 kid1| Starting Squid Cache version 3.5.12 for x86_64-pc-linux-gnu...
2019/04/08 10:20:01 kid1| Service Name: squid
2019/04/08 10:20:01 kid1| Process ID 2478
2019/04/08 10:20:01 kid1| Process Roles: worker
2019/04/08 10:20:01 kid1| With 65535 file descriptors available
2019/04/08 10:20:01 kid1| Initializing IP Cache...
2019/04/08 10:20:01 kid1| DNS Socket created at [::], FD 6
2019/04/08 10:20:01 kid1| DNS Socket created at 0.0.0.0, FD 8
2019/04/08 10:20:01 kid1| Adding nameserver 127.0.0.1 from /etc/resolv.conf
2019/04/08 10:20:01 kid1| Adding domain school.local from /etc/resolv.conf
2019/04/08 10:20:01 kid1| Adding domain fritz.box from /etc/resolv.conf
2019/04/08 10:20:01 kid1| Logfile: opening log daemon:/var/log/squid/access.log
2019/04/08 10:20:01 kid1| Logfile Daemon: opening log /var/log/squid/access.log
2019/04/08 10:20:01 kid1| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2019/04/08 10:20:01 kid1| Store logging disabled
2019/04/08 10:20:01 kid1| Swap maxSize 0 + 262144 KB, estimated 20164 objects
2019/04/08 10:20:01 kid1| Target number of buckets: 1008
2019/04/08 10:20:01 kid1| Using 8192 Store buckets
2019/04/08 10:20:01 kid1| Max Mem size: 262144 KB
2019/04/08 10:20:01 kid1| Max Swap size: 0 KB
2019/04/08 10:20:01 kid1| Using Least Load store dir selection
2019/04/08 10:20:01 kid1| Set Current Directory to /var/spool/squid
2019/04/08 10:20:01 kid1| Finished loading MIME types and icons.
2019/04/08 10:20:01 kid1| HTCP Disabled.
2019/04/08 10:20:01| pinger: Initialising ICMP pinger ...
2019/04/08 10:20:01| pinger: ICMP socket opened.
2019/04/08 10:20:01| pinger: ICMPv6 socket opened

== ApportVersion =================================
2.20.1-0ubuntu2.18

== Architecture =================================
amd64

== Date =================================
Mon Apr 8 10:23:05 2019

== Dependencies =================================
adduser 3.113+nmu3ubuntu4
apt 1.2.31
apt-utils 1.2.31
base-passwd 3.5.39
cron 3.0pl1-128ubuntu2
debconf 1.5.58ubuntu1
debconf-i18n 1.5.58ubuntu1
debianutils 4.7
dpkg 1.18.4ubuntu1.5
gcc-5-base 5.4.0-6ubuntu1~16.04.11
gcc-6-base 6.0.1-0ubuntu1
gnupg 1.4.20-1ubuntu3.3
gpgv 1.4.20-1ubuntu3.3
ifupdown 0.8.10ubuntu1.4
init-system-helpers 1.29ubuntu4
iproute2 4.3.0-1ubuntu3.16.04.4
isc-dhcp-client 4.3.3-5ubuntu12.10
isc-dhcp-common 4.3.3-5ubuntu12.10
krb5-locales 1.13.2+dfsg-5ubuntu2.1
libacl1 2.2.52-3
libapt-inst2.0 1.2.31
libapt-pkg5.0 1.2.31
libasn1-8-heimdal 1.7~git20150920+dfsg-4ubuntu1.16.04.1
libatm1 1:2.5.1-1.5
libattr1 1:2.4.47-2
libaudit-common 1:2.4.5-1ubuntu2.1
libaudit1 1:2.4.5-1ubuntu2.1
libbz2-1.0 1.0.6-8
libc6 2.23-0ubuntu11
libcap2 1:2.24-12
libcomerr2 1.42.13-1ubuntu1
libdb5.3 5.3.28-11ubuntu0.1
libdebconfclient0 0.198ubuntu1
libdns-export162 1:9.10.3.dfsg.P4-8ubuntu1.12
libecap3 1.0.1-3ubuntu3
libexpat1 2.1.0-7ubuntu0.16.04.3
libffi6 3.2.1-4
libgcc1 1:6.0.1-0ubuntu1
libgmp10 2:6.1.0+dfsg-2
libgnutls30 3.4.10-4ubuntu1.4
libgssapi-krb5-2 1.13.2+dfsg-5ubuntu2.1
libgssapi3-heimdal 1.7~git20150920+dfsg-4ubuntu1.16.04.1
libhcrypto4-heimdal 1.7~git20150920+dfsg-4ubuntu1.16.04.1
libheimbase1-heimdal 1.7~git20150920+dfsg-4ubuntu1.16.04.1
libheimntlm0-heimdal 1.7~git20150920+dfsg-4ubuntu1.16.04.1
libhogweed4 3.2-1ubuntu0.16.04.1
libhx509-5-heimdal 1.7~git20150920+dfsg-4ubuntu1.16.04.1
libicu55 55.1-7ubuntu0.4
libidn11 1.32-3ubuntu1.2
libisc-export160 1:9.10.3.dfsg.P4-8ubuntu1.12
libk5crypto3 1.13.2+dfsg-5ubuntu2.1
libkeyutils1 1.5.9-8ubuntu1
libkrb5-26-heimdal 1.7~git20150920+dfsg-4ubuntu1.16.04.1
libkrb5-3 1.13.2+dfsg-5ubuntu2.1
libkrb5support0 1.13.2+dfsg-5ubuntu2.1
libldap-2.4-2 2.4.42+dfsg-2ubuntu3.4
liblocale-gettext-perl 1.07-1build1
libltdl7 2.4.6-0.1
liblz4-1 0.0~r131-2ubuntu2
liblzma5 5.1.1alpha+20120614-2ubuntu2
libmnl0 1.0.3-5
libnetfilter-conntrack3 1.0.5-1
libnettle6 3.2-1ubuntu0.16.04.1
libnfnetlink0 1.0.1-3
libp11-kit0 0.23.2-5~ubuntu16.04.1
libpam-modules 1.1.8-3.2ubuntu2.1
libpam-modules-bin 1.1.8-3.2ubuntu2.1
libpam-runtime 1.1.8-3.2ubuntu2.1
libpam0g 1.1.8-3.2ubuntu2.1
libpcre3 2:8.38-3.1
libpopt0 1.16-10
libreadline6 6.3-8ubuntu2
libroken18-heimdal 1.7~git20150920+dfsg-4ubuntu1.16.04.1
libsasl2-2 2.1.26.dfsg1-14ubuntu0.1
libsasl2-modules 2.1.26.dfsg1-14ubuntu0.1
libsasl2-modules-db 2.1.26.dfsg1-14ubuntu0.1
libselinux1 2.4-3build2
libsemanage-common 2.3-1build3
libsemanage1 2.3-1build3
libsepol1 2.4-2
libsqlite3-0 3.11.0-1ubuntu1.1
libssl1.0.0 1.0.2g-1ubuntu4.15
libstdc++6 5.4.0-6ubuntu1~16.04.11
libtasn1-6 4.7-3ubuntu0.16.04.3
libtext-charwidth-perl 0.04-7build5
libtext-iconv-perl 1.7-5build4
libtext-wrapi18n-perl 0.06-7.1
libtinfo5 6.0+20160213-1ubuntu1
libusb-0.1-4 2:0.1.12-28
libustr-1.0-1 1.0.4-5
libwind0-heimdal 1.7~git20150920+dfsg-4ubuntu1.16.04.1
libxml2 2.9.3+dfsg1-1ubuntu0.6
libxtables11 1.6.0-2ubuntu3
logrotate 3.8.7-2ubuntu2.16.04.2
lsb-base 9.20160110ubuntu0.2
multiarch-support 2.23-0ubuntu11
netbase 5.3
openssl 1.0.2g-1ubuntu4.15
passwd 1:4.2-3.1ubuntu5.3
perl-base 5.22.1-9ubuntu0.6
readline-common 6.3-8ubuntu2
sed 4.2.2-7
sensible-utils 0.0.9ubuntu0.16.04.1
sgml-base 1.26+nmu4ubuntu1
squid-common 3.5.12-1ubuntu7.6
squid-langpack 20150704-1
ssl-cert 1.0.37
tar 1.28-2.1ubuntu0.1
ubuntu-keyring 2012.05.19
update-motd 3.6-0ubuntu1
xml-core 0.13+nmu2
zlib1g 1:1.2.8.dfsg-2ubuntu4.1

== DistroRelease =================================
Ubuntu 16.04

== InstallationDate =================================
Installed on 2017-11-15 (508 days ago)

== InstallationMedia =================================
Ubuntu-Server 16.04.2 LTS "Xenial Xerus" - Release amd64 (20170215.8)

== Package =================================
squid 3.5.12-1ubuntu7.6

== PackageArchitecture =================================
amd64

== ProblemType =================================
Bug

== ProcCpuinfoMinimal =================================
processor : 7
vendor_id : GenuineIntel
cpu family : 6
model : 30
model name : Intel(R) Xeon(R) CPU X3440 @ 2.53GHz
stepping : 5
microcode : 0xa
cpu MHz : 1529.858
cache size : 8192 KB
physical id : 0
siblings : 8
core id : 3
cpu cores : 4
apicid : 7
initial apicid : 7
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid dtherm ida flush_l1d
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips : 5053.89
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

== ProcEnviron =================================
TERM=xterm-256color
SHELL=/bin/bash
PATH=(custom, no user)
LANG=de_DE.UTF-8

== ProcVersionSignature =================================
Ubuntu 4.15.0-47.50~16.04.1-generic 4.15.18

== SourcePackage =================================
squid3

== Tags =================================
 xenial

== Uname =================================
Linux 4.15.0-47-generic x86_64

== UpgradeStatus =================================
No upgrade log present (probably fresh install)

== modified.conffile..etc.logrotate.d.squid =================================
[modified]

== mtime.conffile..etc.logrotate.d.squid =================================
2017-11-15T17:06:24.026728

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu squid Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Can you telnet to port 3128 on localhost?

Revision history for this message
Thomas (t.c) said :
#2

no, it is not possible

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

what is the output of:

sudo apt-get update; sudo apt-get install pastebinit; grep -v ^$ /etc/squid/squid.conf | grep -v ^\# | pastebinit

Thanks

Revision history for this message
Thomas (t.c) said :
#4
Revision history for this message
Thomas (t.c) said :
#5

how I said, it is the default conf

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

If you change to a different port number by running:

sudo vi /etc/squid/squid.conf

Change:
http_port 3128
To:
http_port 3129

Then run:
systemctl restart squid

If you run:
netstat -plant | grep -i squid

Do you see it listening OK?

Revision history for this message
Thomas (t.c) said :
#7

root@proxy:~# sed 's/http_port 3128/http_port 3129/g' -i /etc/squid/squid.conf
root@proxy:~# grep '^http_port' /etc/squid/squid.conf
http_port 3129

than I stopped squid and made sure, that no squid process is running, before I started the service again.

root@proxy:~# netstat -plant | grep -i squid
root@proxy:~# grep 3129 /var/log/squid/cache.log

# they gives me no output

root@proxy:~# service squid status
● squid.service - LSB: Squid HTTP Proxy version 3.x
   Loaded: loaded (/etc/init.d/squid; bad; vendor preset: enabled)
   Active: active (running) since Do 2019-04-11 14:29:23 CEST; 6min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 12320 ExecStop=/etc/init.d/squid stop (code=exited, status=0/SUCCESS)
  Process: 11866 ExecReload=/etc/init.d/squid reload (code=exited, status=0/SUCCESS)
  Process: 12495 ExecStart=/etc/init.d/squid start (code=exited, status=0/SUCCESS)
    Tasks: 9
   Memory: 36.3M
      CPU: 264ms
   CGroup: /system.slice/squid.service
           ├─ 1027 (pinger)
           ├─ 1484 (pinger)
           ├─ 1626 (pinger)
           ├─ 2457 (pinger)
           ├─ 2480 (pinger)
           ├─12536 /usr/sbin/squid -YC -f /etc/squid/squid.conf
           ├─12538 (squid-1) -YC -f /etc/squid/squid.conf
           ├─12539 (logfile-daemon) /var/log/squid/access.log
           └─12540 (pinger)

Apr 11 14:29:23 proxy systemd[1]: Starting LSB: Squid HTTP Proxy version 3.x...
Apr 11 14:29:23 proxy squid[12495]: * Starting Squid HTTP Proxy squid
Apr 11 14:29:23 proxy squid[12536]: Squid Parent: will start 1 kids
Apr 11 14:29:23 proxy squid[12536]: Squid Parent: (squid-1) process 12538 started
Apr 11 14:29:23 proxy squid[12495]: ...done.
Apr 11 14:29:23 proxy systemd[1]: Started LSB: Squid HTTP Proxy version 3.x.

cache.log has this content:
2019/04/11 14:29:23 kid1| Set Current Directory to /var/spool/squid
2019/04/11 14:29:23 kid1| Starting Squid Cache version 3.5.12 for x86_64-pc-linux-gnu...
2019/04/11 14:29:23 kid1| Service Name: squid
2019/04/11 14:29:23 kid1| Process ID 12538
2019/04/11 14:29:23 kid1| Process Roles: worker
2019/04/11 14:29:23 kid1| With 65535 file descriptors available
2019/04/11 14:29:23 kid1| Initializing IP Cache...
2019/04/11 14:29:23 kid1| DNS Socket created at [::], FD 6
2019/04/11 14:29:23 kid1| DNS Socket created at 0.0.0.0, FD 8
2019/04/11 14:29:23 kid1| Adding nameserver 127.0.0.1 from /etc/resolv.conf
2019/04/11 14:29:23 kid1| Adding domain zeppelin.lan from /etc/resolv.conf
2019/04/11 14:29:23 kid1| Adding domain fritz.box from /etc/resolv.conf
2019/04/11 14:29:23 kid1| Logfile: opening log daemon:/var/log/squid/access.log
2019/04/11 14:29:23 kid1| Logfile Daemon: opening log /var/log/squid/access.log
2019/04/11 14:29:23 kid1| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2019/04/11 14:29:23 kid1| Store logging disabled
2019/04/11 14:29:23 kid1| Swap maxSize 0 + 262144 KB, estimated 20164 objects
2019/04/11 14:29:23 kid1| Target number of buckets: 1008
2019/04/11 14:29:23 kid1| Using 8192 Store buckets
2019/04/11 14:29:23 kid1| Max Mem size: 262144 KB
2019/04/11 14:29:23 kid1| Max Swap size: 0 KB
2019/04/11 14:29:23 kid1| Using Least Load store dir selection
2019/04/11 14:29:23 kid1| Set Current Directory to /var/spool/squid
2019/04/11 14:29:23 kid1| Finished loading MIME types and icons.
2019/04/11 14:29:23 kid1| HTCP Disabled.
2019/04/11 14:29:23| pinger: Initialising ICMP pinger ...
2019/04/11 14:29:23| pinger: ICMP socket opened.
2019/04/11 14:29:23| pinger: ICMPv6 socket opened

Revision history for this message
Thomas (t.c) said :
#8

I also verified the system with debsums -ca - but all was has changed is legit (some conf files, like dhcpd.conf, rt_tables, named.conf.*, ....)

Revision history for this message
Thomas (t.c) said :
#9

what is also crazy, that I cant stop squid normally. after I isssue the stop command, I have to kill the leftover processes:

root@proxy:~# systemctl status squid.service
● squid.service - LSB: Squid HTTP Proxy version 3.x
   Loaded: loaded (/etc/init.d/squid; bad; vendor preset: enabled)
   Active: inactive (dead) since Do 2019-04-11 14:53:12 CEST; 24s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 23501 ExecStop=/etc/init.d/squid stop (code=exited, status=0/SUCCESS)
  Process: 22806 ExecStart=/etc/init.d/squid start (code=exited, status=0/SUCCESS)
    Tasks: 4
   Memory: 29.6M
      CPU: 290ms
   CGroup: /system.slice/squid.service
           ├─22847 /usr/sbin/squid -YC -f /etc/squid/squid.conf
           ├─22849 (squid-1) -YC -f /etc/squid/squid.conf
           ├─22850 (logfile-daemon) /var/log/squid/access.log
           └─22851 (pinger)

Apr 11 14:51:15 proxy systemd[1]: Starting LSB: Squid HTTP Proxy version 3.x...
Apr 11 14:51:15 proxy squid[22806]: * Starting Squid HTTP Proxy squid
Apr 11 14:51:15 proxy squid[22847]: Squid Parent: will start 1 kids
Apr 11 14:51:15 proxy squid[22806]: ...done.
Apr 11 14:51:15 proxy squid[22847]: Squid Parent: (squid-1) process 22849 started
Apr 11 14:51:15 proxy systemd[1]: Started LSB: Squid HTTP Proxy version 3.x.
Apr 11 14:53:10 proxy systemd[1]: Stopping LSB: Squid HTTP Proxy version 3.x...
Apr 11 14:53:10 proxy squid[23501]: * Stopping Squid HTTP Proxy squid
Apr 11 14:53:12 proxy squid[23501]: ...done.
Apr 11 14:53:12 proxy systemd[1]: Stopped LSB: Squid HTTP Proxy version 3.x.

Revision history for this message
Thomas (t.c) said :
#10

I also reinstalled squid now like this:

apt install --reinstall -o Dpkg::Options::="--force-confask,confnew,confmiss" squid squid-common squid-langpack

some problem....

Revision history for this message
Thomas (t.c) said :
#11

bind9 and apache2 as example have to problems on the system

Revision history for this message
Thomas (t.c) said :
#12

don't know what else I can do - cant believe, that this leads to reinstall the system ?!

Revision history for this message
Launchpad Janitor (janitor) said :
#13

This question was expired because it remained in the 'Open' state without activity for the last 15 days.