LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 09-28-2006, 12:33 AM   #1
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Migrating Squid from NT to Slackware


Any Squid SMEs here? I hope so!

I have been using Squid on my NT4 box for a long time. Many thanks to the person who supports this porting! Squid definitely helped me with my dialup connection and I intend to keep using Squid to augment my new broadband connection.

I installed squid from a package on linuxpackages.net. All went well.

I want to migrate my squid cache from my NT4 box to my slack box. I copied the files, modified the permissions to nobody and then started squid. Squid started fine but did not like the swap.state file. I'm no expert, but based upon what I can see, squid is ignoring the copied cache because of the swap.state file.

The NT version was built with STABLE10 and this slack version is STABLE13.

Any ideas about convincing the new version to accept the significantly large cache and rebuild the swap.state file, or convert the swap.state file to a format that STABLE13 likes?

I dislike the idea of throwing away this valuable cache. I can observe the impact the cache has on all of my surfing, whether on dialup only several days ago, or even now, with broadband. The idea of rebuilding that cache is discouraging.

I appreciate any help and insight!
 
Old 09-28-2006, 04:17 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,334

Rep: Reputation: Disabled
From the Squid 2 FAQ:

Quote:
If you remove the swap.state while Squid is not running, you will not lose your entire cache. In this case, Squid will scan all of the cache directories and read each swap file to rebuild the cache. This can take a very long time, so you'll have to be patient.
Eric
 
Old 09-28-2006, 02:33 PM   #3
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Thanks Eric.

I saw that snippet yesterday, but for whatever reason my mind did not absorb the information in a useful manner. A day later, some sleep, and time away from the problem helps me see the text in a different light. That is, my solution is embedded in that text snippet, but yesterday was not intuitively obvious to me.

When I copied the cache from NT4 to Slackware, I also copied the swap.state file. In my defense I had no idea the file would be incompatible with the version of squid I installed on Slackware. The snippet above does provide a clue. The solution seems to be 1) copy the cache, 2) do not copy the swap.state file, 3) start squid manually (squid -NCd1) to send output directly to the screen and provide immediate feedback , and 4) wait---as long as necessary for squid to rebuild the cache index (swap.state).

I have a cache that is almost 1 GB in size, so I'll be sure to run the rebuilding process while I am doing something else. However, I am reasonably certain this approach will work. Thanks again!

Question:

I'm confused by the squid.conf directive cache_dir.

At my NT4 box, currently I have squid configured with:

cache_dir ufs o:/squid/cache 1024 16 256

My original understanding is that the 1024 (megabytes) refers to the total squid cache size. That is, when squid fills the sublevels to the point of being within 95% of 1024 MB (1 GB) of cached files, squid then will begin the process of deleting least recently used files. But yesterday I ran across a snippet that implied the 1024 number refers to each sublevel. That is, of the 16 sublevels defined above, squid will store 1024 MB of files in each sublevel. Which is correct?

The embedded instructions in squid.conf does not explain this in detail, or I am not reading the text correctly. My reading remains the former interpretation, but if I am wrong and the 1024 refers to each sublevel, then I need to know because I don't have the drive space to store 1024 MB x 16 (16 GB) worth of files.

Question:

Unlike SquidNT, yesterday I quickly learned that installing squid in GNU/Linux requires me to pay attention to file and directory permissions. After some web surfing, I noticed that some people recommend creating a new user and group account called squid, and assigning the log and cache directories permissions to that user and group. Some people just leave things be and use nobody/nogroup. Anybody here have any insight in the difference and a preference? I understand why squid refuses to run as root. I'm just asking which method people prefer: 1) leave things as is with nobody/nogroup or create squid/squid and modify the squid.conf cache_effective_user and cache_effective_group directives?
 
Old 09-29-2006, 03:17 AM   #4
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
For curious visitors to this thread, the solution outlined above worked great. The time to rebuild the swap.state file on my older hardware required only 72 seconds for a 800 MB of cached files. Not bad!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up Squid on Slackware Rustylinux Slackware 5 10-01-2006 11:33 PM
migrating from mandrake to slackware ttilt Slackware 5 10-26-2004 03:16 PM
Squid and Slackware win32sux Slackware 6 08-02-2004 08:55 AM
migrating BSD to Slackware passwd file bgovoni Linux - General 0 04-22-2004 06:31 PM
Slackware + Squid kemplej Slackware 3 02-09-2004 09:02 AM


All times are GMT -5. The time now is 10:28 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration