LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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: 68
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: 68
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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/Novell 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


All times are GMT -5. The time now is 07:02 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration