LINUX.ORG.RU
ФорумAdmin

Squid не стартует

 


0

1

Добрый день. Помогите решить проблему.

root@mx:/var/run # uname -a
FreeBSD mx.sibtender.com 10.1-RELEASE-p2 FreeBSD 10.1-RELEASE-p2 #2 r276131: Mon Dec 29 20:35:31 NOVT 2014     anton@mx.sibtender.com:/usr/obj/usr/src/sys/ROUTER  amd64
Установлен squid
squid33-3.3.13_2               HTTP Caching Proxy
При загрузке системы squid стартует, процесс запущен
root@mx:/var/run # ps -ax | grep squid
33438  -  Is       0:00,00 /usr/local/sbin/squid -f /usr/local/etc/squid/squid.conf
33465  -  S        0:00,08 (squid-1) -f /usr/local/etc/squid/squid.conf (squid)
33466  -  I        0:00,01 (logfile-daemon) /var/log/squid/access.log (log_file_daemon)
33659  0  S+       0:00,00 grep squid
Теперь остановим процесс
root@mx:/var/run # service squid stop
Stopping squid.
Waiting for PIDS: 33726.

root@mx:/var/run # ps -ax | grep squid
33724  -  Is       0:00,00 /usr/local/sbin/squid -f /usr/local/etc/squid/squid.conf
33748  -  S        0:00,06 (squid-1) -f /usr/local/etc/squid/squid.conf (squid)
33749  -  I        0:00,01 (logfile-daemon) /var/log/squid/access.log (log_file_daemon)
33752  0  S+       0:00,00 grep squid

squid запущен, но с другим PID.

root@mx:/var/run # service squid stop
squid not running? (check /var/run/squid/squid.pid).
Помогает только
root@mx:/var/run # killall -9 squid
После killall squid запускается.

Ответ на: комментарий от Pinkbyte

root@mx:/var/log/squid # tail cache.log

2015/01/20 15:11:21 kid1| Loaded Icons.
2015/01/20 15:11:21 kid1| commBind: Cannot bind socket FD 17 to [::]:3128: (48) Address already in use
2015/01/20 15:11:21 kid1| HTCP Disabled.
2015/01/20 15:11:21 kid1| Squid plugin modules loaded: 0
2015/01/20 15:11:21 kid1| Closing HTTP port [::]:3128
FATAL: Unable to open HTTP Socket
Squid Cache (Version 3.3.13): Terminated abnormally.
CPU Usage: 0.060 seconds = 0.022 user + 0.037 sys
Maximum Resident Size: 173392 KB
Page faults with physical i/o: 0

kuznetsov_anton
() автор топика
Ответ на: комментарий от Pinkbyte
visible_hostname mx.sibtender.com

acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/24 # RFC1918 possible internal network
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
acl admin src 192.168.0.100

#
# Recommended minimum Access Permission configuration:
#
# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# Only allow cachemgr access from localhost
http_access deny manager
http_access allow admin

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access deny all
http_access allow localhost

# And finally deny all other access to this proxy
http_access allow localnet
http_access allow localhost manager

# Squid normally listens to port 3128
http_port 6128

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/squid/cache/squid 100 16 256
cache_dir ufs /var/squid/cache/squid 2000 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/squid/cache/squid

#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320
cache_effective_user squid
cache_effective_group squid
cache_mem 512 MB
auth_param basic program /usr/local/etc/webmin/squid/squid-auth.pl /usr/local/etc/webmin/squid/users

/usr/local/etc/rc.d/squid

#!/bin/sh
#
# $FreeBSD: head/www/squid33/files/squid.in 365721 2014-08-23 11:40:15Z marino $
#
# PROVIDE: squid
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Note:
# Set "squid_enable=yes" in either /etc/rc.conf, /etc/rc.conf.local or
# /etc/rc.conf.d/squid to activate Squid.
#
# Additional variables you can define in one of these files:
#
# squid_chdir:  the directory into which the rc system moves into before
#               starting Squid. Default: /var/squid
#
# squid_conf:   The configuration file that Squid should use.
#               Default: /usr/local/etc/squid/squid.conf
#
# squid_fib:    The alternative routing table id that Squid should use.
#               Default: none
#               See setfib(1) for further details. Note that the setfib(2)
#               system call is not available in FreeBSD versions prior to 7.1.
#
# squid_user:   The user id that should be used to run the Squid master
#               process. Default: squid.
#               Note that you probably need to define "squid_user=root" if
#               you want to run Squid in reverse proxy setups or if you want
#               Squid to listen on a "privileged" port < 1024.
#
# squid_pidfile:
#               The name (including the full path) of the Squid
#               master process' PID file.
#               Default: /var/run/squid/squid.pid.
#               You only need to change this if you changed the
#               corresponding entry in your Squid configuration.
#
# squid_flags:  Additional commandline arguments for Squid you might want to
#               use. See squid(8) for further details.
#
# squid_krb5_ktname:
#               Alternative Kerberos 5 Key Table.
#               Default: none

. /etc/rc.subr

name=squid
rcvar=squid_enable

# Make sure that we invoke squid with "-f ${squid_conf}"; define this
# variable early so reload_cmd and stop_precmd pick it up:

extra_commands=reload
reload_cmd=squid_reload
start_precmd=squid_prestart
start_postcmd=squid_getpid
stop_precmd=squid_prestop
stop_postcmd=squid_poststop

# squid(8) will not start if ${squid_conf} is not present so try
# to catch that beforehand via ${required_files} rather than make
# squid(8) crash.

squid_load_rc_config()
{
        : ${squid_chdir:=/var/squid}
        : ${squid_conf:=/usr/local/etc/squid/squid.conf}
        : ${squid_enable:=NO}
        : ${squid_program:=/usr/local/sbin/squid}
kuznetsov_anton
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.