LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-22-2006, 07:34 AM   #1
pujakofriendly
LQ Newbie
 
Registered: Sep 2006
Distribution: slackware
Posts: 11

Rep: Reputation: 0
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 =)
 
Old 10-22-2006, 08:02 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
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
 
Old 10-22-2006, 02:36 PM   #3
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
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.
 
Old 11-24-2006, 09:49 PM   #4
pujakofriendly
LQ Newbie
 
Registered: Sep 2006
Distribution: slackware
Posts: 11

Original Poster
Rep: Reputation: 0
it work..

thank you very much...
 
Old 12-02-2006, 07:18 AM   #5
yawe_frek
Member
 
Registered: Sep 2005
Distribution: feather 0.72-usb, DSL,CentOS,Ubuntu, Redhat 9
Posts: 144

Rep: Reputation: 15
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.
 
Old 12-02-2006, 07:32 AM   #6
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
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
 
  


Reply

Tags
squid



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
squid running on boot time with the debug level (-d 1) pujakofriendly Linux - Networking 0 10-21-2006 11:05 AM
Running Squid on Boot? SBN Linux - Software 3 10-18-2006 03:41 AM
running script at boot time bigtl Fedora 3 12-19-2005 11:30 AM
running dhcpd at boot time Fritz_Monroe Slackware 6 06-16-2005 06:43 PM
how can I get/make a proper squid daemon startup script for boot time binkybuckle Debian 0 07-05-2003 07:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:13 PM.

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