how enable squid service automatically

Taking care of your Linux box.
Post Reply
smk08
Naik
Posts: 56
Joined: Fri Aug 08, 2008 1:44 pm
Location: Sheikhupura, Pakistan

how enable squid service automatically

Post by smk08 »

Asslamu Alaikum

i am using squid 2.7 after compiling it through source code. i yet execute scripts for enabling service commands for it. i put the following command to /etc/rc.local to start squid automatically.

/usr/lcoal/squid/sbin/squid -D


but it is not functional.
Shahid Mahmood
0321-4538113
i am crazy to learn linux
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

i yet execute scripts for enabling service commands for it.
what does that mean?

Code: Select all

/usr/lcoal/squid/sbin/squid -D
why did you use -D?
but it is not functional.
what does that mean? what, exactly, happened when you rebooted the system?
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?
smk08
Naik
Posts: 56
Joined: Fri Aug 08, 2008 1:44 pm
Location: Sheikhupura, Pakistan

Post by smk08 »

Asslamu Alaikum

i use -D to disable DNS test.




Jazaku Mullah
Shahid Mahmood
0321-4538113
i am crazy to learn linux
lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Post by lambda »

i use -D to disable DNS test.
why do you need to do that?

where're the answers to my other questions?
Watch out for the Manners Taliban!
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?
ajt74
Cadet
Posts: 13
Joined: Wed Mar 28, 2007 1:39 pm
Location: Christchurch, New Zealand

Post by ajt74 »

1. Make init.d or rc.d script executable
2. If you are running Debian then use
root@skx:~# update-rc.d squid defaults

For any other distribution search the net

Cheers
"With faith, discipline and selfless devotion to duty, there is nothing worthwhile that you cannot achieve." - -- Muhammad Ali Jinnah
nasacis
Battalion Havaldaar Major
Posts: 269
Joined: Sat Dec 13, 2003 3:58 pm
Location: Faisalabad
Contact:

Post by nasacis »

use startup script to start squid automatically when your linux box startup.
create file /etc/rc.d/init.d and change mode 755 and make soft link to appropriate run level
like
ln -s /etc/rc.d/init.d/squid /etc/rc.d/rc3.d/S93squid
S mean start
93 is prority

regards

#!/bin/sh
#
# Basic startup script for Squid
#
case "$1" in
start)
echo "Starting Squid"
/usr/local/squid/bin/RunCache > /dev/null 2>&1 &
;;
stop)
echo "Shutting down Squid"
/usr/bin/killall -q RunCache
/usr/local/squid/sbin/squid -k shutdown
;;
restart)
echo "Restarting Squid"
/usr/local/squid/sbin/squid -k reconfigure
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac

exit 0
Nafees Ahmed
Cell: +92.300.8653568
UAN: 041-111432432
Nexlinx Faisalabad
www.nexlinx.net.pk
nafees29@gmail.com
nasacis
Battalion Havaldaar Major
Posts: 269
Joined: Sat Dec 13, 2003 3:58 pm
Location: Faisalabad
Contact:

Post by nasacis »

change path according to your squid installation in startup script
Nafees Ahmed
Cell: +92.300.8653568
UAN: 041-111432432
Nexlinx Faisalabad
www.nexlinx.net.pk
nafees29@gmail.com
Post Reply