Author Topic: squid error  (Read 875 times)

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
squid error
« on: 7 December 2002, 00:10 »
i installed squid, when i run "squid -z" (to create the swap directorys) it gives me the error:
Code: [Select]
I never had to set the 'cache_effective_user' on my squid installation before and it will run 'squid start' (but it doesnt work because there is no swap directories) without a dont run as root message. Should i make a user named squid and then set it as the cache_effective_user??
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
squid error
« Reply #1 on: 7 December 2002, 00:56 »
Yes you should run it as user "squid", and you have to create the top level cache directory as root and change ownership of that directory to the squid user so when you do the "squid -z" the squid user has permissions to create the cache directories under that top level cache directory. On my system that directory looks like this:

Code: [Select]

[ December 06, 2002: Message edited by: void main ]

Someone please remove this account. Thanks...

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
squid error
« Reply #2 on: 7 December 2002, 01:13 »
my /var/lib/squid (which is the default cache dir in slackware) is owned by nobody. SO should i still make it to squid and run it as squid isntead of nobody? And when i am making the user squid do i set a password for it?
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
squid error
« Reply #3 on: 7 December 2002, 02:04 »
Sounds like Slackware set squid up to run under the user "nobody". To make it run under the user "squid" you would have to create the "squid" username and it's home directory would be the same as the cache directory, on my system the /etc/passwd entry looks like this:

Code: [Select]

Notice the login shell is "/dev/null", this insures that no one can log in as that user, however you want to also set the passwd field in /etc/shadow to "!!" like this:

Code: [Select]

I usually create a user normally and then go change those few things manually with vim but there should be options to the "adduser" or "useradd" command to create them that way from the start. Here's the useradd equivelant that you would want to use:

# adduser -M -d /var/lib/squid -s /dev/null

and then go edit the /etc/shadow and make sure the second field is "!!" (or just type "passwd -l squid" which will do the same thing).

[ December 06, 2002: Message edited by: void main ]

Someone please remove this account. Thanks...

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
squid error
« Reply #4 on: 7 December 2002, 02:21 »
when i set the cache_effective_user as squid it gives me the same error message.
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
squid error
« Reply #5 on: 7 December 2002, 02:28 »
quote:
Originally posted by The Master of Reality / B0B:
when i set the cache_effective_user as squid it gives me the same error message.


What does an "ls -ld /var/lib/squid" tell you?

[ December 06, 2002: Message edited by: void main ]

Someone please remove this account. Thanks...

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
squid error
« Reply #6 on: 7 December 2002, 02:45 »
Code: [Select]
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
squid error
« Reply #7 on: 7 December 2002, 03:22 »
Is there anything else in those subdirectories that would not be owned by the user squid? To make sure do:

# chown -R squid:squid /var/lib/squid

Also, look in your error logs for other possible messages (/var/log/messages and the logs in the squid log direcetory).

One thing that looks odd to me is you say the squid cache is /var/lib/squid, yet there are other subdirectories in there. The logs should not be in the cache directory and there should not be a directory called "cache" under it. The cache directory should be able to be completely empty and when you run "squid -z" it will create a structure somgthing like this:

Code: [Select]

I think you have some things wrong with your configuration.
Someone please remove this account. Thanks...

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
squid error
« Reply #8 on: 7 December 2002, 03:25 »
the squid cache directory is set to /var/lib/squid/cache the squid log directory is /var/lib/squid/logs  (those are set in /etc/squid/squid.conf). And squid (user) home is /var/lib/squid
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
squid error
« Reply #9 on: 7 December 2002, 03:33 »
I don't know that the squid user's home directory has anything to do at all with the operation of Squid but if you were to set it up with the same logic as mine is set up then the home directory should be "/var/lib/squid/cache". I doubt that will fix anything. Is the /var/lib/squid/cache directory completely empty? If it's not delete everything under it and try the "squid -z" again.

In the mean time I'm heading over to http://www.squid-cache.org/ to look at the FAQ.
Someone please remove this account. Thanks...

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
squid error
« Reply #10 on: 7 December 2002, 21:00 »
i uninstalled the slackware package for squid and then compile my own squid 3 beta, its quite a bit different, but sweeet. It works fine.
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
squid error
« Reply #11 on: 7 December 2002, 21:27 »
it will if i make it shut down... mu ha ha ha ha ha!
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'