# Squid initialization failure

## wwsung

Hi,

I recently tried to setup my home proxy server with squid. I previously had used SuSE 9.0 for the same purpose with no problem. I had an Athalon XP 1600 and a 160 GB hard drive with the following partition scheme:

hda1 /boot ext2

hda2 swap 

hda3 reiserfs

hda4 (lvm2 logical volume)

/dev/lv/squid reiserfs (for the cache using ufs)

When I tried to start squid (/etc/squid/squid start), I got the following error:

* Initializing cache directory: /squid/cache/squid

/sbin/runscript.sh: line 532: 29413 Aborted

/usr/bin/squid -z -F 2>/dev/null

* Error initializing: /var/cache/squid

Gentoo-dev-source 2.6.9-r6

512MB RAM

Athalon XP1600

Any suggestion? Thanks,

WS   :Confused: 

----------

## zrubi

 *wwsung wrote:*   

> 
> 
> I had an Athalon XP 1600 and a 160 GB hard drive with the following partition scheme:
> 
> /dev/lv/squid reiserfs (for the cache using ufs)
> ...

 

You can see now what the problem is...

Tell him were your squid partition is, and give correct permissions...

(cache_dir in your squid.conf)

----------

## wwsung

Thanks. It was a typo. I did enter the correct directory path in my /etc/squid/squid.conf as /squid/cache/squid. I also mkdir with all the correct permission but it failed. I also tried to put ext3 instead but I got the same result.   :Sad: 

WS

----------

## zrubi

 *wwsung wrote:*   

> I did enter the correct directory path in my /etc/squid/squid.conf as /squid/cache/squid.

 

OK, You shoud look the cache.log. 

The reason must be there.

If not, try to increase the logging level to

```

debug_options ALL,3

```

----------

## wwsung

Hmm,

I could not find any log info at all.  

BTW, where do you set the debug_level?

 :Crying or Very sad: 

WS

----------

## zrubi

 *wwsung wrote:*   

> 
> 
> I could not find any log info at all.
> 
> 

 

It sould be at '/var/log/squid/cache.log'

 *Quote:*   

> 
> 
> BTW, where do you set the debug_level?
> 
> 

 

Put this somewhere in your squid.conf:

debug_options ALL,3

----------

## jubajuba

 *wwsung wrote:*   

> Hi,
> 
> I recently tried to setup my home proxy server with squid. I previously had used SuSE 9.0 for the same purpose with no problem. I had an Athalon XP 1600 and a 160 GB hard drive with the following partition scheme:
> 
> hda1 /boot ext2
> ...

 

I get the same error. 

```

oenone squid # /etc/init.d/squid start

' * Initializing cache directory: /var/cache/squid/

/sbin/runscript.sh: line 532: 27117 Aborted                 /usr/sbin/squid -z -F 2>/dev/null

 * Error initializing: /var/cache/squid/

```

My config for the cache area:

```

cache_dir ufs /var/cache/squid 512 16 256

```

Can't see what's wrong. 

I've tried setting the debugging level to 3, still don't get anything in my log dir for squid. (/var/log/squid/)

----------

## zrubi

 *jubajuba wrote:*   

> 
> 
> I get the same error. 
> 
> ```
> ...

 

OK, try to run this command:

```
/usr/sbin/squid -z -F
```

This will try to create swap directories.

----------

## wwsung

I didn't check the forum for a few day figured that I will give up. I followed your suggestion with the /usr/sbin/squid -z -F and fixed a couple squid.conf error and I am in business again. 

Thanks a lot.

WS

----------

## DawgG

i suggest with squid you do everything by hand; the initscripts are quite unsatisfactory.

the squid-docs helped me a lot.

before you can see any log-files or debug-msgs it's gotta run first. before it runs, create the cache-dirs with

```

squid -z

```

(straight from the squid-docs)

also, as far as i know, the filesystem-directive in squid.conf  does not have anything to do with the actual filesystem on your harddrive. mine is formatted as reiser and squid uses the ufs-directive.

debug-level is set with directive

```

#  TAG: debug_options

#Default:

 debug_options ALL,1             # "normal"

# debug_options ALL,1 33,2      # acls are shown

# debug_options ALL,1 33,2 28,9 # intensive acl-debugging

```

(straight from the squid-docs)

this was from my squid.conf for testing acls.

the default does not tell you very much except that squid is doing sth.

the second line shows which acls are evaluated

the third line shows which acls are evaluated and all the return codes (log gets VERY LARGE)

the output is sent to <LOGDIR>/cache.log

----------

## epretorious

For posterity: I too experienced the same generic failure:

```
gateway squid # /etc/init.d/squid start

 * Initializing cache directory: /var/cache/squid

/etc/init.d/squid: line 32: 21961 Aborted                 /usr/sbin/squid -z -F 2>/dev/null

 * Error initializing: /var/cache/squid
```

After verifying that /var/cache/squid/ already existed, I followed zrubi's advice and executed

```
squid -z
```

squid complained...

```
gateway squid # squid -z

FATAL: Could not determine fully qualified hostname.  Please set 'visible_hostname'

 

Squid Cache (Version 2.5.STABLE10): Terminated abnormally.

CPU Usage: 0.019 seconds = 0.015 user + 0.004 sys

Maximum Resident Size: 0 KB

Page faults with physical i/o: 0

Aborted
```

...so I just set the visible_hostname variable (in /etc/squid/squid.conf) and - viola!!! - everthing works just fine now.    :Wink: 

----------

## epretorious

Oh - somebody else already posted the same solution.    :Embarassed: 

----------

