Re: how to start squid automatically with user squid

From: Adam Rice <adam@dont-contact.us>
Date: Thu, 10 Feb 2000 10:31:44 +0000

Carlos Canchaya wrote:
> My question is, what do I need to do in order to start
> squid automaticly ( not as root but as squid user ), every time I restart
> my server???
>
> I mean, where and how do I put the script
>
> /usr/local/squid/bin/squid ????

It varies, depending on which version of Unix you are using. On Solaris,
I created a
script called "squid" in /etc/init.d

#!/bin/sh

SQUID=/usr/local/squid/bin/squid

case "$1" in
'start')
        if [ -x "$SQUID" ]; then
                echo "Squid caching web proxy server starting."
                $SQUID
        fi
        ;;

'stop')
        if [ -x "$SQUID" ]; then
                $SQUID -k shutdown
        fi
        ;;

*)
        echo "usage: $0 start|stop"
        exit 1
        ;;
esac

And then did

ln /etc/init.d/squid /etc/rc3.d/S90squid
ln /etc/init.d/squid /etc/rc2.d/K90squid

to specify at what point in the startup sequence the squid program is
run.

On most Linux systems the process is similar (except that you'd usually
use symlinks instead of hardlinks, and the script would normally take a
"restart" command line as well). Often there is a README file in
/etc/init.d that will provide guidance.

Adam Rice
Received on Thu Feb 10 2000 - 07:51:22 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:51:06 MST