Systemd - Failed to start Squid caching proxy
Testado em:
openSUSE 13.2 x86_64
Squid Cache versão 3.4.4
Tive a necessidade de instalar o Squid no openSUSE, fiz a instalação básica do sistema e a instalação do Squid.
Ao tentar utilizar uma configuração que já tenho, o sistema retornava alguns erros, seguem abaixo os erros e modificações que fiz:
1. Erro de permissão ao abrir socket:
2015/05/01 23:48:36 kid1| Pinger socket opened on FD 14
2015/05/01 23:48:36| pinger: Initialising ICMP pinger ...
2015/05/01 23:48:36| icmp_sock: (1) Operation not permitted
2015/05/01 23:48:36| pinger: Unable to start ICMP pinger.
2015/05/01 23:48:36| icmp_sock: (1) Operation not permitted
2015/05/01 23:48:36| pinger: Unable to start ICMPv6 pinger.
2015/05/01 23:48:36| FATAL: pinger: Unable to open any ICMP sockets.
R: Alterar para:
# chown root /usr/sbin/pinger
# chmod u+s /usr/sbin/pinger
2. Ao executar o sistema agora retorna esse erro:
systemctl status squid.service
squid.service - Squid caching proxy
Loaded: loaded (/usr/lib/systemd/system/squid.service; disabled)
Active: failed (Result: timeout) since Sáb 2015-05-02 00:02:19 BRT; 35s ago
Process: 6844 ExecStart=/usr/sbin/squid -F $SQUID_START_OPTIONS -f /etc/squid/squid.conf (code=exited, status=0/SUCCESS)
Process: 6839 ExecStartPre=/bin/sh -c test -d "`sed -n 's/^cache_dir \+[[:alnum:]]\+ \+\([[:graph:]\/]\+\) .*/\1/p' /etc/squid/squid.conf | sed '1 q'`/00" || /usr/sbin/squid -z -F -N -S -f /etc/squid/squid.conf (code=exited, status=0/SUCCESS)
Mai 02 00:00:50 linux-m0mj squid[6848]: 0 Duplicate URLs purged.
Mai 02 00:00:50 linux-m0mj squid[6848]: 0 Swapfile clashes avoided.
Mai 02 00:00:50 linux-m0mj squid[6848]: Took 0.02 seconds ( 0.00 objects/sec).
Mai 02 00:00:50 linux-m0mj squid[6848]: Beginning Validation Procedure
Mai 02 00:00:50 linux-m0mj squid[6848]: Completed Validation Procedure
Mai 02 00:00:50 linux-m0mj squid[6848]: Validated 0 Entries
Mai 02 00:00:50 linux-m0mj squid[6848]: store_swap_size = 0.00 KB
Mai 02 00:00:51 linux-m0mj squid[6848]: storeLateRelease: released 0 objects
Mai 02 00:02:19 linux-m0mj systemd[1]: squid.service start operation timed out. Terminating.
Mai 02 00:02:19 linux-m0mj systemd[1]: Failed to start Squid caching proxy.
R: O segundo erro não fornecia detalhes, então tentei começar pelo básico, executando o Squid diretamente, e percebi que ele não encerrava, resolvi dar uma olhada no arquivo
/usr/lib/systemd/system/squid.service .
Ao abrir arquivo modifiquei a linha "ExecStartPre":
# vi /usr/lib/systemd/system/squid.service
Antes estava assim:
ExecStartPre=/bin/sh -c "test -d \"`sed -n 's/^cache_dir\s\+[[:alnum:]]\+\s\+\([[:graph:]\/]\+\)\s.*/\1/p' /etc/squid/squid.conf | sed '1 q'`/00\" || /usr/sbin/squid -z -F -N -S -f /etc/squid/squid.conf"
Agora está assim:
ExecStartPre=/bin/sh -c "test -d \"`sed -n 's/^cache_dir\s\+[[:alnum:]]\+\s\+\([[:graph:]\/]\+\)\s.*/\1/p' /etc/squid/squid.conf | sed '1 q'`/00\" || /usr/sbin/squid -N -d 1 -D -f /etc/squid/squid.conf"
Depois disso rodei um:
# systemctl daemon-reload
# systemctl start squid.service
# systemctl status squid.service
squid.service - Squid caching proxy
Loaded: loaded (/usr/lib/systemd/system/squid.service; enabled)
Active: active (running) since Sáb 2015-05-02 00:20:35 BRT; 5s ago
Process: 9658 ExecStart=/usr/sbin/squid -F $SQUID_START_OPTIONS -f /etc/squid/squid.conf (code=exited, status=0/SUCCESS)
Process: 9652 ExecStartPre=/bin/sh -c test -d "`sed -n 's/^cache_dir \+[[:alnum:]]\+ \+\([[:graph:]\/]\+\) .*/\1/p' /etc/squid/squid.conf | sed '1 q'`/00" || /usr/sbin/squid -N -d 1 -D -f /etc/squid/squid.conf (code=exited, status=0/SUCCESS)
Main PID: 9662 (squid)
CGroup: /system.slice/squid.service
├─9660 /usr/sbin/squid -F -sY -f /etc/squid/squid.conf
├─9662 (squid-1) -F -sY -f /etc/squid/squid.conf
├─9663 (unlinkd)
└─9664 (pinger)
Mai 02 00:20:35 linux-m0mj squid[9662]: 0 Objects expired.
Mai 02 00:20:35 linux-m0mj squid[9662]: 0 Objects cancelled.
Mai 02 00:20:35 linux-m0mj squid[9662]: 0 Duplicate URLs purged.
Mai 02 00:20:35 linux-m0mj squid[9662]: 0 Swapfile clashes avoided.
Mai 02 00:20:35 linux-m0mj squid[9662]: Took 0.03 seconds ( 0.00 objects/sec).
Mai 02 00:20:35 linux-m0mj squid[9662]: Beginning Validation Procedure
Mai 02 00:20:35 linux-m0mj squid[9662]: Completed Validation Procedure
Mai 02 00:20:35 linux-m0mj squid[9662]: Validated 0 Entries
Mai 02 00:20:35 linux-m0mj squid[9662]: store_swap_size = 0.00 KB
Mai 02 00:20:36 linux-m0mj squid[9662]: storeLateRelease: released 0 objects
Espero ajudar alguém que passe pela mesma dificuldade.
Outras dicas deste autor
Instalando o Webmin no FreeBSD
Instalando o VMWare Tools no FreeBSD 10.2 I386
Modem 3G modelo E173s no Linux
Leitura recomendada
Desativando IPV6 no Ubuntu Server/Desktop [18.04/20.0/22.04]
Projeto Root - Virtualização de Servidores
Instalar adaptador DWA-131 D-Link no Ubuntu 16.04
iptables - Como apagar uma regra NAT
Configuração de rede IPv6 estática no Ubuntu
Comentários
Bom dia meu amigo estou com o mesmo problema que vc, fiz as alterações sugeridas mas não adiantou, no meu caso.
segue resultado do status squid.service:
OpenSuse:/ # service squid status
squid.service - Squid caching proxy
Loaded: loaded (/usr/lib/systemd/system/squid.service; disabled)
Active: active (running) since Fri 2015-10-30 09:56:11 BRST; 3s ago
Process: 3319 ExecStart=/usr/sbin/squid -F $SQUID_START_OPTIONS -f /etc/squid/squid.conf (code=exited, status=0/SUCCESS)
Process: 3314 ExecStartPre=/bin/sh -c test -d "`sed -n 's/^cache_dir \+[[:alnum:]]\+ \+\([[:graph:]\/]\+\) .*/\1/p' /etc/squid/squid.conf | sed '1 q'`/00" || /usr/sbin/squid -z -F -N -S -f /etc/squid/squid.conf (code=exited, status=0/SUCCESS)
Main PID: 3323 (squid)
CGroup: /system.slice/squid.service
├─3321 /usr/sbin/squid -F -sY -f /etc/squid/squid.conf
└─3323 (squid-1) -F -sY -f /etc/squid/squid.conf
Oct 30 09:56:11 OpenSuse.site squid[3323]: 0 Objects cancelled.
Oct 30 09:56:11 OpenSuse.site squid[3323]: 0 Duplicate URLs purged.
Oct 30 09:56:11 OpenSuse.site squid[3323]: 0 Swapfile clashes avoided.
Oct 30 09:56:11 OpenSuse.site squid[3323]: Took 0.04 seconds ( 0.00 objects/sec).
Oct 30 09:56:11 OpenSuse.site squid[3323]: Beginning Validation Procedure
Oct 30 09:56:11 OpenSuse.site squid[3323]: Completed Validation Procedure
Oct 30 09:56:11 OpenSuse.site squid[3323]: Validated 0 Entries
Oct 30 09:56:11 OpenSuse.site squid[3323]: store_swap_size = 0.00 KB
Oct 30 09:56:11 OpenSuse.site squid[3323]: ERROR: No forward-proxy ports configured.
Oct 30 09:56:12 OpenSuse.site squid[3323]: storeLateRelease: released 0 objects
=============================
OpenSuse:/ # systemctl status squid.service
squid.service - Squid caching proxy
Loaded: loaded (/usr/lib/systemd/system/squid.service; disabled)
Active: active (running) since Fri 2015-10-30 10:07:51 BRST; 8s ago
Process: 3436 ExecStart=/usr/sbin/squid -F $SQUID_START_OPTIONS -f /etc/squid/squid.conf (code=exited, status=0/SUCCESS)
Process: 3430 ExecStartPre=/bin/sh -c test -d "`sed -n 's/^cache_dir \+[[:alnum:]]\+ \+\([[:graph:]\/]\+\) .*/\1/p' /etc/squid/squid.conf | sed '1 q'`/00" || /usr/sbin/squid -N -d 1 -D -f /etc/squid/squid.conf (code=exited, status=0/SUCCESS)
Main PID: 3384 (squid)
CGroup: /system.slice/squid.service
‣ 3384 (squid-1) normally listens to port 3128
Desde ja muito obrigado.
att.,
Raphael Hidalgo
[1] Comentário enviado por raphaeluncp em 30/10/2015 - 10:22h
Bom dia meu amigo estou com o mesmo problema que vc, fiz as alterações sugeridas mas não adiantou, no meu caso.
segue resultado do status squid.service:
OpenSuse:/ # service squid status
squid.service - Squid caching proxy
Loaded: loaded (/usr/lib/systemd/system/squid.service; disabled)
Active: active (running) since Fri 2015-10-30 09:56:11 BRST; 3s ago
Process: 3319 ExecStart=/usr/sbin/squid -F $SQUID_START_OPTIONS -f /etc/squid/squid.conf (code=exited, status=0/SUCCESS)
Process: 3314 ExecStartPre=/bin/sh -c test -d "`sed -n 's/^cache_dir \+[[:alnum:]]\+ \+\([[:graph:]\/]\+\) .*/\1/p' /etc/squid/squid.conf | sed '1 q'`/00" || /usr/sbin/squid -z -F -N -S -f /etc/squid/squid.conf (code=exited, status=0/SUCCESS)
Main PID: 3323 (squid)
CGroup: /system.slice/squid.service
├─3321 /usr/sbin/squid -F -sY -f /etc/squid/squid.conf
└─3323 (squid-1) -F -sY -f /etc/squid/squid.conf
Oct 30 09:56:11 OpenSuse.site squid[3323]: 0 Objects cancelled.
Oct 30 09:56:11 OpenSuse.site squid[3323]: 0 Duplicate URLs purged.
Oct 30 09:56:11 OpenSuse.site squid[3323]: 0 Swapfile clashes avoided.
Oct 30 09:56:11 OpenSuse.site squid[3323]: Took 0.04 seconds ( 0.00 objects/sec).
Oct 30 09:56:11 OpenSuse.site squid[3323]: Beginning Validation Procedure
Oct 30 09:56:11 OpenSuse.site squid[3323]: Completed Validation Procedure
Oct 30 09:56:11 OpenSuse.site squid[3323]: Validated 0 Entries
Oct 30 09:56:11 OpenSuse.site squid[3323]: store_swap_size = 0.00 KB
Oct 30 09:56:11 OpenSuse.site squid[3323]: ERROR: No forward-proxy ports configured.
Oct 30 09:56:12 OpenSuse.site squid[3323]: storeLateRelease: released 0 objects
=============================
OpenSuse:/ # systemctl status squid.service
squid.service - Squid caching proxy
Loaded: loaded (/usr/lib/systemd/system/squid.service; disabled)
Active: active (running) since Fri 2015-10-30 10:07:51 BRST; 8s ago
Process: 3436 ExecStart=/usr/sbin/squid -F $SQUID_START_OPTIONS -f /etc/squid/squid.conf (code=exited, status=0/SUCCESS)
Process: 3430 ExecStartPre=/bin/sh -c test -d "`sed -n 's/^cache_dir \+[[:alnum:]]\+ \+\([[:graph:]\/]\+\) .*/\1/p' /etc/squid/squid.conf | sed '1 q'`/00" || /usr/sbin/squid -N -d 1 -D -f /etc/squid/squid.conf (code=exited, status=0/SUCCESS)
Main PID: 3384 (squid)
CGroup: /system.slice/squid.service
‣ 3384 (squid-1) normally listens to port 3128
Desde ja muito obrigado.
att.,
Raphael Hidalgo
Posta ai
[code]
# squid -k parse
# cat /etc/squid/squid.conf
# iptables -L -nv
[/code]
Mensagem
[quote]
[1] Comentário enviado por raphaeluncp em 30/10/2015 - 10:22h
Bom dia meu amigo estou com o mesmo problema que vc, fiz as alterações sugeridas mas não adiantou, no meu caso.
segue resultado do status squid.service:
OpenSuse:/ # service squid status
squid.service - Squid caching proxy
Loaded: loaded (/usr/lib/systemd/system/squid.service; disabled)
Active: active (running) since Fri 2015-10-30 09:56:11 BRST; 3s ago
Process: 3319 ExecStart=/usr/sbin/squid -F $SQUID_START_OPTIONS -f /etc/squid/squid.conf (code=exited, status=0/SUCCESS)
Process: 3314 ExecStartPre=/bin/sh -c test -d "`sed -n 's/^cache_dir \+[[:alnum:]]\+ \+\([[:graph:]\/]\+\) .*/\1/p' /etc/squid/squid.conf | sed '1 q'`/00" || /usr/sbin/squid -z -F -N -S -f /etc/squid/squid.conf (code=exited, status=0/SUCCESS)
Main PID: 3323 (squid)
CGroup: /system.slice/squid.service
├─3321 /usr/sbin/squid -F -sY -f /etc/squid/squid.conf
└─3323 (squid-1) -F -sY -f /etc/squid/squid.conf
Oct 30 09:56:11 OpenSuse.site squid[3323]: 0 Objects cancelled.
Oct 30 09:56:11 OpenSuse.site squid[3323]: 0 Duplicate URLs purged.
Oct 30 09:56:11 OpenSuse.site squid[3323]: 0 Swapfile clashes avoided.
Oct 30 09:56:11 OpenSuse.site squid[3323]: Took 0.04 seconds ( 0.00 objects/sec).
Oct 30 09:56:11 OpenSuse.site squid[3323]: Beginning Validation Procedure
Oct 30 09:56:11 OpenSuse.site squid[3323]: Completed Validation Procedure
Oct 30 09:56:11 OpenSuse.site squid[3323]: Validated 0 Entries
Oct 30 09:56:11 OpenSuse.site squid[3323]: store_swap_size = 0.00 KB
Oct 30 09:56:11 OpenSuse.site squid[3323]: ERROR: No forward-proxy ports configured.
Oct 30 09:56:12 OpenSuse.site squid[3323]: storeLateRelease: released 0 objects
=============================
OpenSuse:/ # systemctl status squid.service
squid.service - Squid caching proxy
Loaded: loaded (/usr/lib/systemd/system/squid.service; disabled)
Active: active (running) since Fri 2015-10-30 10:07:51 BRST; 8s ago
Process: 3436 ExecStart=/usr/sbin/squid -F $SQUID_START_OPTIONS -f /etc/squid/squid.conf (code=exited, status=0/SUCCESS)
Process: 3430 ExecStartPre=/bin/sh -c test -d "`sed -n 's/^cache_dir \+[[:alnum:]]\+ \+\([[:graph:]\/]\+\) .*/\1/p' /etc/squid/squid.conf | sed '1 q'`/00" || /usr/sbin/squid -N -d 1 -D -f /etc/squid/squid.conf (code=exited, status=0/SUCCESS)
Main PID: 3384 (squid)
CGroup: /system.slice/squid.service
‣ 3384 (squid-1) normally listens to port 3128
Desde ja muito obrigado.
att.,
Raphael Hidalgo
[/quote]
Posta ai
[code]
# squid -k parse
# cat /etc/squid/squid.conf
# iptables -L -nv
[/code]
Contribuir com comentário
Enviar