www/squid: configctl proxy stop returns before Squid exits, so stop+start (e.g. Monit restart) fails
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 70/100
Línea de trabajo
Empieza por www/squid/src/opnsense/service/conf/actions.d/actions_proxy.conf y sigue cómo su acción de detención invoca el script rc de Squid y killall. Comprueba el comportamiento de detención del script rc y cómo la acción puede esperar dentro de un límite de tiempo a que Squid termine. Después, verifica que un configctl proxy start inmediato se ejecute correctamente tras la detención. La tarea está completa cuando la detención espera a que el proceso termine o alcanza un límite y lo fuerza a terminar antes de regresar.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
- I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
- I have searched the existing issues, open and closed, and I'm convinced that mine is new.
- The title contains the plugin to which this issue belongs
Describe the bug
configctl proxy stop returns before Squid has exited. A start issued right after it (for example by a Monit service check that runs stop then start) launches a new Squid while the old one is still shutting down and holding its ports, so the new instance fails and the proxy stays down until something starts it again.
The [stop] action in www/squid/src/opnsense/service/conf/actions.d/actions_proxy.conf is:
/usr/local/etc/rc.d/squid stop;
/usr/bin/killall squid;
/usr/local/sbin/pluginctl -c webproxy stop;
exit 0
Squid's graceful shutdown waits up to shutdown_lifetime (30 s by default, not set in the generated squid.conf), and nothing in the action waits for the process to exit. In our case configctl proxy stop returned right away while Squid kept shutting down for roughly 30 seconds.
This matters most when the proxy is transparent: with port-forward rules pointing HTTP/HTTPS at Squid, every stop-then-start that loses this race means a client-facing web outage.
To Reproduce
- Enable the web proxy (transparent HTTP/HTTPS is where it hurts).
- Run
configctl proxy stop; configctl proxy start. pgrep squidright afterstopstill shows the old Squid for up to ~30 s; thestartfails (ports in use / pid still present) and the proxy is not running afterwards.- Same result with a Monit service for Squid using
configctl proxy stop/configctl proxy startand a connection test with "restart" as action.
Expected behavior
configctl proxy stop returns only after Squid has exited (or after a bounded wait, then a hard kill), so a following start is reliable.
Suggested fix
Wait for the Squid processes to exit before returning, for example after the existing killall:
i=0; while pgrep -qx squid && [ $i -lt 40 ]; do sleep 1; i=$((i+1)); done
pgrep -qx squid && /usr/bin/killall -9 squid
(or make the rc script's stop wait for the pid). Setting a shorter shutdown_lifetime alone would only narrow the window.
Additional context
We worked around it with a Monit stop script that runs configctl proxy stop, waits up to 50 s for the process to exit, then kills it. With that, restarts are reliable (~40 s round trip). configctl proxy restart is not a substitute in Monit because it fails when Squid is not running.
Environment
OPNsense 26.7.10 (amd64), os-squid 1.5_1, squid 7.7. The [stop] action on master is unchanged.
- Lenguaje dominante
- PHP
- Estrellas
- 1.2k
- Forks
- 932
- Merge medio
- 1 d 11 h
- PR fusionados (30 d)
- 22
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de opnsense/plugins
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
net/haproxy: IPv6 literal in real server "Source address" generates an invalid `source` directivePosiblemente ocupada @fraenki la tomó hace 6 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
opnsense/plugins#5973 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[dns/ddclient] Support hiding unused standard fields per service (optional_hiding)Posiblemente ocupada @bringha1 la tomó hace 9 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
Todos los issues de opnsense/plugins
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Automattic/blocks-engine#7881 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
iruzen-dono/workless#117 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
magicsunday/webtrees-docker#285 ·
Los mantenedores suelen responder en 1 día
-
Flaky browser test: AreaHeadersTest 'shows Counting on the way while deferred tab counts load'Abiertoarea/tests type/bug when/soon
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
WP-CLI 3.0 fixes the cron lock and core download bugs described in the handbookPosiblemente ocupada @mayankmajeji la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
WordPress/hosting-handbook#521 ·