Bug 747103 - squid does not start if /var/spool/squid is empty
Summary: squid does not start if /var/spool/squid is empty
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: squid
Version: 16
Hardware: i686
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Jiri Skala
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-18 20:06 UTC by Michael Weidner
Modified: 2014-11-09 22:35 UTC (History)
6 users (show)

Fixed In Version: squid-3.2.0.13-4.fc16
Clone Of:
Environment:
Last Closed: 2011-11-14 22:24:14 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Michael Weidner 2011-10-18 20:06:51 UTC
Description of problem:

If /var/spool/squid is enabled in the /etc/squid/squid.conf as cache_dir, squid does not start if /var/sppo/squid is empty, this is logged in /var/log/messages

Oct 18 18:30:20 han squid[3094]: Squid Parent: (squid-1) process 3147 started
Oct 18 18:30:20 han (squid-1): #011Failed to verify one of the swap directories, Check cache.log#012#011for details.  Run 'squid -z' to create swap directories#012#011if needed, or if running Squid for the first time.
Oct 18 18:30:20 han squid[3094]: Squid Parent: (squid-1) process 3147 exited with status 1

Before switching to systemd in older Fedora Releases, this was done automaticly in the init.d script.

Version-Release number of selected component (if applicable):

squid-3.2.0.13-1.fc16.i686

How reproducible:

Allways

Steps to Reproduce:
1. Enable cache_dir in /etc/squid/squid.conf
2. Make /var/spool/squid empty (i.e. "rm -r /var/spool/squid/*
3. Start squid with "systemctl start squid.service"
  
Actual results:

see above, squid does not start

Expected results:

Swap directories should be created and squid should start

Comment 1 Jiri Skala 2011-10-19 14:48:11 UTC
There is missing ExecStartPre option in the squid.service file that will call script invoking squid -z as was done in sysv initscript.

I'v tested it locally on F16 virtual machine. I'll commit it in next days (still watching BZ#7471{10,25})

Comment 2 Fedora Update System 2011-10-26 08:42:16 UTC
squid-3.2.0.13-2.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/squid-3.2.0.13-2.fc16

Comment 3 Michael Weidner 2011-10-26 10:49:25 UTC
I can confirm the bug is fixed with squid-3.2.0.13-3.fc16

Comment 4 Fedora Update System 2011-10-26 19:04:59 UTC
Package squid-3.2.0.13-3.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing squid-3.2.0.13-3.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-14951
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2011-11-04 21:49:13 UTC
Package squid-3.2.0.13-4.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing squid-3.2.0.13-4.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-14951
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2011-11-14 22:24:14 UTC
squid-3.2.0.13-4.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Marcos Mello 2012-09-03 13:56:52 UTC
I'm having this bug on F17, squid-3.2.0.16-1.fc17.x86_64.

Sep 03 10:47:28 XXX (squid-1)[12203]: Failed to verify one of the swap directories, Check cache.log
Sep 03 10:47:28 XXX squid[12188]: Squid Parent: (squid-1) process 12203 exited with status 1
Sep 03 10:47:28 XXX squid[12188]: Squid Parent: (squid-1) process 12203 will not be restarted due to repeated, frequent failures
Sep 03 10:47:28 XXX squid[12188]: Exiting due to repeated, frequent failures
Sep 03 10:47:28 XXX squid[12206]: squid: ERROR: Could not send signal 15 to process 1436: (3) No such process


cache.log

2012/09/03 10:47:28 kid1| Starting Squid Cache version 3.2.0.16 for x86_64-redhat-linux-gnu...
2012/09/03 10:47:28 kid1| Process ID 12203
2012/09/03 10:47:28 kid1| Process Roles: worker
2012/09/03 10:47:28 kid1| With 16384 file descriptors available
2012/09/03 10:47:28 kid1| Initializing IP Cache...
2012/09/03 10:47:28 kid1| DNS Socket created at [::], FD 7
2012/09/03 10:47:28 kid1| DNS Socket created at 0.0.0.0, FD 8
2012/09/03 10:47:28 kid1| Adding nameserver XXX.XXX.XXX.XXX from /etc/resolv.conf
2012/09/03 10:47:28 kid1| Adding nameserver XXX.XXX.XXX.XXX from /etc/resolv.conf
2012/09/03 10:47:28 kid1| Logfile: opening log daemon:/var/log/squid/access.log
2012/09/03 10:47:28 kid1| Logfile Daemon: opening log /var/log/squid/access.log
2012/09/03 10:47:28 kid1| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2012/09/03 10:47:28 kid1| Store logging disabled
2012/09/03 10:47:28 kid1| Swap maxSize 20971520 + 262144 KB, estimated 1633358 objects
2012/09/03 10:47:28 kid1| Target number of buckets: 81667
2012/09/03 10:47:28 kid1| Using 131072 Store buckets
2012/09/03 10:47:28 kid1| Max Mem  size: 262144 KB
2012/09/03 10:47:28 kid1| Max Swap size: 20971520 KB
2012/09/03 10:47:28 kid1| /var/spool/squid/00: (2) No such file or directory
FATAL:  Failed to verify one of the swap directories, Check cache.log
        for details.  Run 'squid -z' to create swap directories
        if needed, or if running Squid for the first time.
Squid Cache (Version 3.2.0.16): Terminated abnormally.
CPU Usage: 0.056 seconds = 0.030 user + 0.026 sys
Maximum Resident Size: 53408 KB
Page faults with physical i/o: 0


/var/log/squid/squid.out is empty.

/usr/libexec/squid/cache_swap.sh is failing (or not being executed) somehow.

Comment 8 Marcos Mello 2012-09-04 13:34:11 UTC
OK, cache_swap.sh was failing because systemd's ExecStartPre doesn't allow forking processes. Squid needs the "-N" (no daemon mode) there.

Comment 9 Marcos Mello 2012-09-04 13:36:07 UTC
Err, the "-N" (no daemon mode) *option* there.

Comment 10 Marcos Mello 2012-09-16 18:53:03 UTC
Please fix cache_swap.sh adding "-N" option to squid. The current F17 package (and probably F18/rawhide) is kind of broken as it will refuse to start in a clean install. 

Also take a look at Bug 854356

Thanks.

Comment 11 Jiri Skala 2012-09-20 07:29:27 UTC
(In reply to comment #10)
> Please fix cache_swap.sh adding "-N" option to squid. The current F17
> package (and probably F18/rawhide) is kind of broken as it will refuse to
> start in a clean install. 
> 
> Also take a look at Bug 854356
> 
> Thanks.

First of all I believe there should be opened new bug.

I went through the initial squid's code and I guess forking should be invoked after handling swap dirs. I don't see necessity forking due to this operation because the squid is terminated just after swap dirs creation.

Henrik, what's your opinion?

Comment 12 Marcos Mello 2012-09-21 12:35:39 UTC
Done: Bug 859393


Note You need to log in before you can comment on or make changes to this bug.