LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   squid question (https://www.linuxquestions.org/questions/slackware-14/squid-question-348336/)

heraklez 07-30-2005 10:30 AM

squid question
 
Hello, I am installing squid on my machine, and I read Tomasz Chmielewski How To. He says that I should create secure squid user:

useradd -d /cache/ -r -s /dev/null squid >/dev/null 2>&1

I would like to know what is the meaning of this.
I read the useradd man page but I don't see the -r option.
Why does "-s" points to /dev/null?

win32sux 07-30-2005 12:40 PM

i don't know what the -r is for... i've never used it, and like you said, it doesn't show up in the manual...

-s is given /dev/null so that the account will have an invalid shell... most distros come with a /bin/false binary which is made specially for this... for example, this is what i use to add an account for squid in slackware
Code:

groupadd squid

useradd -g squid -d /cache -s /bin/false squid

just my :twocents:...

heraklez 07-30-2005 01:50 PM

Thank you very much Win32sux. I have another question:
I have a directory called /opt/squid/sbin, it contains squid executable.
There is another directory called /opt/squid/bin, and it contains RunCache, RunAccel, squidclient.
I do cat /opt/squid/bin/RunCache, and it show this:
#!/bin/sh
#
#$Id: RunCache.in,v 1.9.8.1 2003/01/06 20:52:55 wessels Exp $

prefix=/opt/squid
exec_prefix=/opt/squid
logdir=${prefix}/var
PATH=${exec_prefix}/sbin:/bin:/usr/bin
export PATH

conf=""
if test "$1" ; then
conf="-f $1"
shift
fi

failcount=0
while : ; do
echo "Running: squid -sY $conf >> $logdir/squid.out 2>&1"
echo "Startup: `date`" >> $logdir/squid.out
start=`date '+%d%H%M%S'`
squid -NsY $conf >> $logdir/squid.out 2>&1
stop=`date '+%d%H%M%S'`
...... etc.


Now my question is this: is RunCache a link to squid?

win32sux 07-30-2005 02:53 PM

Quote:

Originally posted by heraklez
is RunCache a link to squid?
no, it's a shell script...
Quote:

Squid is normally run by starting the RunCache script. RunCache... restarts Squid if it dies for some reason...
http://squid-docs.sourceforge.net/latest/html/x897.html

Quote:

The RunCache program attempts to restart Squid if it dies for some reason, and logs basic Squid debug output both to the file "/usr/local/squid/squid.out" and to syslog.
http://squid-docs.sourceforge.net/la...tml/x1013.html


AFAIK most people don't use the RunCache script...

Quote:

I have a directory called /opt/squid/sbin, it contains squid executable.
There is another directory called /opt/squid/bin, and it contains RunCache, RunAccel, squidclient.
just curious: why aren't you using the traditional slackware locations like /usr/sbin and /usr/bin for those??



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