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.