LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   squid running on boot time with the debug level (-d 1) (https://www.linuxquestions.org/questions/slackware-14/squid-running-on-boot-time-with-the-debug-level-d-1-a-494585/)

pujakofriendly 10-22-2006 07:34 AM

squid running on boot time with the debug level (-d 1)
 
i make my squid start on boot time with the command /usr/local/squid/sbin/squid -NCd1

in the ealier time i did not know what the means of this parameter.
the problem is because of the parameter "N" and "d1" the squid show all of it process during boot time and i cannot log in to my machine using slackware.

may u guys help me here.
tq =)

Alien Bob 10-22-2006 08:02 AM

Try to boot your machine in single-user mode. Chances are big that your squid boot script will not be started then (assuming you put the command into /etc/rc.d/rc.local).
Boot the computer, and in the LILO screen, type "linux 1".
If your LILO label that starts Slackware is something else than "linux", then use that word of course. Appending the "1" to the label will make Slackware boot in runlevel "1" which is meant for emergency repairs like this.
Once you are logged in, edit your squid script so that it uses the correct parameters, save the file and reboot.

Eric

Woodsman 10-22-2006 02:36 PM

Quote:

i make my squid start on boot time with the command /usr/local/squid/sbin/squid -NCd1
The N option mean no daemon mode.
The C option means do not catch (ignore) fatal signals.
The d1 option means run with a debug level of one (1).

Running squid this way is great for initial troubleshooting but is not needed after testing. Just run squid with no parameters: /usr/local/squid/sbin/squid.

Quote:

the problem is because of the parameter "N" and "d1" the squid show all of it process during boot time and i cannot log in to my machine using slackware.
Any time you run a program, that process takes control of the shell session until the program terminates and releases control of the shell. Most people run such programs using the & suffix, which tells the program to run in the background and release control of the shell environment. Like this:

/usr/local/squid/sbin/squid &

A cleaner way to run squid is with an /etc/rc.d script. Use one of the existing scripts as a template and then you can start, stop, and restart squid more easily. Something like this:

Code:

#!/bin/sh
# Start/stop/restart squid (a web caching proxy server)

# Start squid:
squid_start() {
if [ -x /usr/sbin/squid ] ; then
echo "Starting squid: /usr/sbin/squid"
/usr/sbin/squid
fi
}

# Stop squid:
squid_stop() {
echo "Stopping squid: /usr/sbin/squid"
if [ "`ps ax | grep '/usr/sbin/squid'`" != "" ] ; then
/usr/sbin/squid -k shutdown &>/dev/null
else
echo "Squid does not seem to be running."
fi
}

# Restart squid:
squid_restart() {
squid_stop
sleep 2
squid_start
}

case "$1" in
'start')
squid_start
;;
'stop')
squid_stop
;;
'restart')
squid_restart
;;
*)
echo "usage rc.squid: start|stop|restart"
esac

Copy and place the script in /etc/rc.d. Name the script rc.squid. Be sure to chmod the script executable. Then instead of running /usr/local/squid/sbin/squid -NCd1, place the following in /etc/rc.d.rc.local:

Code:

# Start the squid caching proxy server:
if [ -x /etc/rc.d/rc.squid ]; then
/etc/rc.d/rc.squid start
fi

I hope this helps.

pujakofriendly 11-24-2006 09:49 PM

it work..
 
thank you very much...:cool:

yawe_frek 12-02-2006 07:18 AM

meaning of some special_characters
 
i am learning how to bash script and i have been coming across some special characters like

"$1"
$ 0
:
.

what does is special characters do ?

Thanks.

Alien Bob 12-02-2006 07:32 AM

Quote:

Originally Posted by yawe_frek
i am learning how to bash script and i have been coming across some special characters like
"$1"
$ 0

You really need to read a good guide on shell programming to avoid asking this kind of basic questions in the SLackware forum. I suggest reading the Advanced Bash-Scripting Guide and specifically the chapter on special variable types which covers the positional parameters.

Eric


All times are GMT -5. The time now is 08:25 AM.