You are not logged in.

#1 2015-03-09 08:39:20

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

squid-rotate.service failed at boot

I'm running squid as a personal proxy on this PC here. I noticed that the service "squid-rotate.service" has failed at start-up of the PC today:

$ systemctl status squid-rotate.service 
● squid-rotate.service - Squid Rotate
   Loaded: loaded (/usr/lib/systemd/system/squid-rotate.service; static; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2015-03-09 07:35:05 CET; 1min 50s ago
  Process: 345 ExecStart=/usr/bin/squid -k rotate (code=exited, status=1/FAILURE)
 Main PID: 345 (code=exited, status=1/FAILURE)

Mar 09 07:35:05 box squid[345]: squid: ERROR: No running copy
Mar 09 07:35:05 box systemd[1]: squid-rotate.service: main process exited, code=exited, status=1/FAILURE
Mar 09 07:35:05 box systemd[1]: Failed to start Squid Rotate.
Mar 09 07:35:05 box systemd[1]: Unit squid-rotate.service entered failed state.
Mar 09 07:35:05 box systemd[1]: squid-rotate.service failed.

I think the reason is that it was started before squid was running. That "squid -k rotate" is supposed to send a signal to a running squid process. The service completed after I later started it manually through "systemctl start squid-rotate.service" and I also checked that it did its job (checked the file dates in /var/log/squid/ to see if things were rotated over there). It seems to me, it only failed because it was run at boot too early.

What's the correct way to fix this?

My ideas are to copy "/usr/lib/systemd/system/squid-rotate.service" to "/etc/systemd/system/" and then either try adding "After=squid" or "ExecStart=/bin/sh -c "/bin/sleep 20 ; /usr/bin/squid -k rotate"".

I'm wondering if "After=..." will work as it's a service unit that gets started because there's a "squid-rotate.timer" file. It's not a service that's normally enabled. How do I test if a change will work without waiting for a week?

Offline

Board footer

Powered by FluxBB