LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-12-2011, 01:15 AM   #1
alieblice
Member
 
Registered: Jul 2011
Posts: 80

Rep: Reputation: Disabled
squid PID disappear after seconds


HI

I have a problem after compiling squid 2.7
when i start it with command "squid " its pid come in list of "ps -e" out put and disappear after seconds and i didnt change any thing on squid.conf
I have this problem with squid 3.1 too

os= virtual debian 6
 
Old 08-12-2011, 02:15 AM   #2
alieblice
Member
 
Registered: Jul 2011
Posts: 80

Original Poster
Rep: Reputation: Disabled
now i find out that i have this problem
squid: ERROR: No running copy

there was some solutions in this forum and other sites but none of them work
can you pleas tell me the right way
 
Old 08-12-2011, 03:00 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

How exactly did you compiled squid and why didn't you use the squid package of your distro?
Anyway, run:
Code:
/path/to/squid-dir/sbin/squid -k parse
and see what you get (replace /path/to/squid-dir with the path you used to install squid sources)
Also did you check the squid logs for errors?
 
Old 08-12-2011, 03:13 AM   #4
alieblice
Member
 
Registered: Jul 2011
Posts: 80

Original Poster
Rep: Reputation: Disabled
thanks for responding
i compile it with this command
Code:
./configure  --prefix=/usr   --localstatedir=/var  --libexecdir=${prefix}/lib/squid  --srcdir=.  --datadir=${prefix}/share/squid  --sysconfdir=/etc/squid --enable-ssl --with-logdir=/var/log  --with-pidfile=/var/run/squid.pid
i need to compile because i need this " --enable-ssl "
is ther any way that i can enable "--enable-ssl" on the deb format of squid


i did that many times no error is in output
her is the out put
Code:
root@debian:/usr/local/squid# sbin/squid -k parse
2011/08/12 04:04:07| Processing Configuration File: /usr/local/squid/etc/squid.conf (depth 0)
2011/08/12 04:04:07| Processing: acl manager proto cache_object
2011/08/12 04:04:07| Processing: acl localhost src 127.0.0.1/32 ::1
2011/08/12 04:04:07| Processing: acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
2011/08/12 04:04:07| Processing: acl localnet src 10.0.0.0/8	# RFC1918 possible internal network
2011/08/12 04:04:07| Processing: acl localnet src 172.16.0.0/12	# RFC1918 possible internal network
2011/08/12 04:04:07| Processing: acl localnet src 192.168.0.0/16	# RFC1918 possible internal network
2011/08/12 04:04:07| Processing: acl localnet src fc00::/7       # RFC 4193 local private network range
2011/08/12 04:04:07| Processing: acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines
2011/08/12 04:04:07| Processing: acl SSL_ports port 443
2011/08/12 04:04:07| Processing: acl Safe_ports port 80		# http
2011/08/12 04:04:07| Processing: acl Safe_ports port 21		# ftp
2011/08/12 04:04:07| Processing: acl Safe_ports port 443		# https
2011/08/12 04:04:07| Processing: acl Safe_ports port 70		# gopher
2011/08/12 04:04:07| Processing: acl Safe_ports port 210		# wais
2011/08/12 04:04:07| Processing: acl Safe_ports port 1025-65535	# unregistered ports
2011/08/12 04:04:07| Processing: acl Safe_ports port 280		# http-mgmt
2011/08/12 04:04:07| Processing: acl Safe_ports port 488		# gss-http
2011/08/12 04:04:07| Processing: acl Safe_ports port 591		# filemaker
2011/08/12 04:04:07| Processing: acl Safe_ports port 777		# multiling http
2011/08/12 04:04:07| Processing: acl CONNECT method CONNECT
2011/08/12 04:04:07| Processing: http_access allow manager localhost
2011/08/12 04:04:07| Processing: http_access deny manager
2011/08/12 04:04:07| Processing: http_access deny !Safe_ports
2011/08/12 04:04:07| Processing: http_access deny CONNECT !SSL_ports
2011/08/12 04:04:07| Processing: http_access allow localnet
2011/08/12 04:04:07| Processing: http_access allow localhost
2011/08/12 04:04:07| Processing: http_access allow all
2011/08/12 04:04:07| Processing: http_port 3128
2011/08/12 04:04:07| Processing: hierarchy_stoplist cgi-bin ?
2011/08/12 04:04:07| Processing: coredump_dir /usr/local/squid/var/cache
2011/08/12 04:04:07| Processing: refresh_pattern ^ftp:		1440	20%	10080
2011/08/12 04:04:07| Processing: refresh_pattern ^gopher:	1440	0%	1440
2011/08/12 04:04:07| Processing: refresh_pattern -i (/cgi-bin/|\?) 0	0%	0
2011/08/12 04:04:07| Processing: refresh_pattern .		0	20%	4320
2011/08/12 04:04:07| Initializing https proxy context


about the log files
there is no squid log file in these addresses
/var/log
/etc/squid
/usr/local/squid/logs
 
Old 08-12-2011, 03:53 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
root@debian:/usr/local/squid# sbin/squid -k parse
According to your ./config --prefix option, squid binary should be in /usr/sbin/squid, but you're running it from /usr/local/squid/sbin/squid, so are you sure you are not mixing squid installations somehow?

About the logs, they should be under /var/log according to your ./configure script. Also you may check system logs (/var/log/syslog, /var/log/messages)
And you can run squid in debug mode and watch the output:
Code:
squid -Nd1
 
Old 08-12-2011, 06:07 AM   #6
alieblice
Member
 
Registered: Jul 2011
Posts: 80

Original Poster
Rep: Reputation: Disabled
thanks for answering

this line is from syslog
Code:
Aug  1 06:43:14 debian squid[1104]: Cannot open '/var/logs/access.log' for writing.#012#011The parent directory must be writeable by the#012#011user 'nobody', which is the cache_effective_user#012#011set in squid.conf.

this is the output of /usr/sbin/squid -Nd1
Code:
root@debian:/var/log# /usr/sbin/squid -Nd1
WARNING: Cannot write log file: /var/logs/cache.log
/var/logs/cache.log: Permission denied
         messages will be sent to 'stderr'.
2009/08/01 06:54:31| Starting Squid Cache version 2.7.STABLE9-20110812 for i686-pc-linux-gnu...
2009/08/01 06:54:31| Process ID 1140
2009/08/01 06:54:31| With 1024 file descriptors available
2009/08/01 06:54:31| Using epoll for the IO loop
2009/08/01 06:54:31| Performing DNS Tests...
2009/08/01 06:54:31| Successful DNS name lookup tests...
2009/08/01 06:54:31| DNS Socket created at 0.0.0.0, port 37160, FD 5
2009/08/01 06:54:31| Adding domain localdomain from /etc/resolv.conf
2009/08/01 06:54:31| Adding domain localdomain from /etc/resolv.conf
2009/08/01 06:54:31| Adding nameserver 172.16.49.2 from /etc/resolv.conf
2009/08/01 06:54:31| logfileOpen: opening log /var/logs/access.log
FATAL: Cannot open '/var/logs/access.log' for writing.
	The parent directory must be writeable by the
	user 'nobody', which is the cache_effective_user
	set in squid.conf.
Squid Cache (Version 2.7.STABLE9-20110812): Terminated abnormally.
CPU Usage: 0.012 seconds = 0.000 user + 0.012 sys
Maximum Resident Size: 9936 KB
Page faults with physical i/o: 0
Aborted
root@debian:/var/log#

i think the problem coming from the user "nobody" according to this line
Code:
parent directory must be writeable by the#012#011user 'nobody', which is the cache_effective_user#012#011set in squid.conf.
[/CODE]

should i change squids user to some user that have much more permission ?
 
Old 08-12-2011, 06:36 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Not necessarily.
If you have created the directory /var/logs for squid logging (different than system's /var/log), you can chown it to nobody
You can add a directory under /var/logs and make that owned by nobody:
Code:
chown -R nobody /var/logs

Last edited by bathory; 08-12-2011 at 08:42 AM.
 
Old 08-12-2011, 08:03 AM   #8
alieblice
Member
 
Registered: Jul 2011
Posts: 80

Original Poster
Rep: Reputation: Disabled
thanks for replying

i didnt create special log folder for it
but when i see that it says that it cant read "/var/logs/access.log"
i create "access.log" fore it and chmod it to make sure squid can read it after that i start it again it says that it cant open "NAME OF ONOTHER FILE" i created that too but again it says it cant ....

i think squid should run as a user that have enough permition
i put user nobody in group of root but nothing chainge
 
Old 08-12-2011, 08:41 AM   #9
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
i put user nobody in group of root but nothing chainge
Don't do it. There is no need of a special user to run squid.
And there is no need to create the log file yourself. Once started squid will create it automatically.

What gives:
Code:
ls -ld /var/logs
If it's not owned by nobody, run:
Code:
chown -R nobody /var/logs
 
Old 08-12-2011, 08:58 AM   #10
alieblice
Member
 
Registered: Jul 2011
Posts: 80

Original Poster
Rep: Reputation: Disabled
thank you very much
the problem solved and its works fine

i was need to chown these directoris to user nobody that squid could read and write in them
chown -R nobody /var/cache
chown -R nobody /var/logs
 
  


Reply



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
What happens if device files disappear for a few seconds? larold Linux - Kernel 1 01-26-2010 11:13 AM
squid dead but pid file exist jatender Linux - Server 2 11-06-2007 10:55 AM
squid dead but pid file exists chenboly Linux - Networking 3 05-31-2007 02:10 PM
squid pid ashfaq Linux - Software 2 01-19-2006 01:36 AM
/service/qmail-send/log: up (pid 1924) 20682 seconds, want down fuzzyash Linux - Software 0 02-18-2004 08:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:28 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration