LinuxQuestions.org
Review your favorite Linux distribution.
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 03-09-2007, 10:42 PM   #1
anwar
Member
 
Registered: Aug 2005
Location: Philippines
Distribution: Slackware 11.0
Posts: 44

Rep: Reputation: 15
Add Squid at startup?


Hi! How do I add squid at startup?
I have squid installed at /home/squid (home has seperate partition, bigger space).

the executable is at /home/squid/sbin/squid

how do I add it so when my machine starts its started as well?

Thanks again!
 
Old 03-10-2007, 07:57 AM   #2
XGizzmo
Member
 
Registered: Mar 2007
Distribution: Slackware
Posts: 264

Rep: Reputation: 69
Try this make a file in /etc/rc.d called rc.squid in it add this
Code:
#!/bin/sh
#
# Start the Squid proxy server
#
if [ "$1" = "stop" ]; then
 echo "Stopping squid..."
 /usr/sbin/squid -k shutdown
 elif [ "$1" = "restart" ]; then
 echo "Restarting squid..."
 /usr/sbin/squid -k shutdown
 sleep 1
 /usr/sbin/squid
 elif [ "$1" = "start" ]; then
 echo "Starting squid: /usr/sbin/squid"
 /usr/sbin/squid -D
 else
 echo "usage $0 start|stop|restart"
fi

Then edit rc.local and add
Code:
if [ -x /etc/rc.d/rc.squid ]; then
   /etc/rc.d/rc.squid start
fi
lastly do "chmod +x /etc/rc.d/rc.squid"
 
Old 03-10-2007, 09:51 PM   #3
anwar
Member
 
Registered: Aug 2005
Location: Philippines
Distribution: Slackware 11.0
Posts: 44

Original Poster
Rep: Reputation: 15
Thanks man! What type of scripting is that? Also any tutorials on those? Thanks!
 
Old 03-10-2007, 09:58 PM   #4
anwar
Member
 
Registered: Aug 2005
Location: Philippines
Distribution: Slackware 11.0
Posts: 44

Original Poster
Rep: Reputation: 15
BTW, it didn't work!
 
Old 03-10-2007, 10:09 PM   #5
XGizzmo
Member
 
Registered: Mar 2007
Distribution: Slackware
Posts: 264

Rep: Reputation: 69
My bad i forgot to edit the paths to match where you have it installed
change the /usr/sbin/squid lines to /home/squid/sbin/squid.

The scripting is just plain old bash scripting.
http://tldp.org/LDP/abs/html/
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html

Last edited by XGizzmo; 03-10-2007 at 10:13 PM.
 
Old 03-11-2007, 10:58 AM   #6
anwar
Member
 
Registered: Aug 2005
Location: Philippines
Distribution: Slackware 11.0
Posts: 44

Original Poster
Rep: Reputation: 15
It worked!!! Thanks man! Thanks for the links too!
 
  


Reply



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
how to run squid at startup Warlord88 SUSE / openSUSE 4 09-26-2006 09:46 AM
Mandriva startup scripts (need to add something to startup before X starts) thunderweasel Mandriva 3 01-01-2006 12:55 AM
how to add this to startup? bahadur Linux - Networking 8 10-15-2005 04:03 PM
squid (pam auth) add group ? stomach Linux - Software 3 09-09-2005 10:53 AM
squid on startup nuzzy Linux - Software 1 02-22-2002 08:46 PM

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

All times are GMT -5. The time now is 09:31 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