LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Add Squid at startup? (https://www.linuxquestions.org/questions/slackware-14/add-squid-at-startup-536166/)

anwar 03-09-2007 10:42 PM

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! :)

XGizzmo 03-10-2007 07:57 AM

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"

anwar 03-10-2007 09:51 PM

Thanks man! What type of scripting is that? Also any tutorials on those? Thanks!

anwar 03-10-2007 09:58 PM

BTW, it didn't work!

XGizzmo 03-10-2007 10:09 PM

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

anwar 03-11-2007 10:58 AM

It worked!!! Thanks man! Thanks for the links too! :)


All times are GMT -5. The time now is 04:20 PM.