Solved

xinetd help

Posted on 2004-09-15
7
363 Views
Last Modified: 2010-03-18
I need a little help with setting up a backup for my Squid box. I have Squid setup in reverse proxy mode for a web site. I'm looking to setup a failover if the Squid service fails for any reason. I was told xinetd could help with this. I need something that checks that Squid, ports 80 and 443 are working. If not I need xinetd to fire up and pass the request to the backend server.

Can this be done? If so how would I do it? Or is there a better way?
0
Comment
Question by:GentooOS
  • 4
  • 3
7 Comments
 
LVL 14

Expert Comment

by:pablouruguay
ID: 12065940
you can use a simple bash script. i use this script for check my ip. modify and use it. is better i think.

you need to use crontab to check every  1 min example.

#!/bin/sh
while [ 1 ]; do
    HAVE_ADSL=`ifconfig ppp0 | grep -c 'error fetching interface information:
Device not found'`
    if [ "$HAVE_ADSL" -gt 0 ]; then
        /sbin/rcnetwork restart dsl0
    fi
    sleep 60
done
0
 

Author Comment

by:GentooOS
ID: 12067231
Thanks pablouruguay.

I'm new to Linux and not sure what your bash script is doing.  Could you explain each line?   How would I use this method to check the squid service and that ports 80 and 443 are being accepted?

Thanks
0
 
LVL 14

Accepted Solution

by:
pablouruguay earned 500 total points
ID: 12067961
#!/bin/sh
while [ 1 ]; do
    HAVE_ADSL=`netstat -a | grep -c https
    if [ "$HAVE_ADSL" -gt 0 ]; then
        /sbin/httpd restart
    fi
    sleep 60
done


and other

#!/bin/sh
while [ 1 ]; do
    HAVE_ADSL=`netstat -a | grep -c :httpd
    if [ "$HAVE_ADSL" -gt 2 ]; then
        /sbin/httpd restart dsl0
    fi
    sleep 60
done

if i wrong correct please......










0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 

Author Comment

by:GentooOS
ID: 12068159
what does -gt 0 and -gt 2 mean?

I'd like to start xinetd if Squid fails and forward ports 80 and 443 to the backend server as squid would most likely fail again after restart.

Thanks.
0
 
LVL 14

Expert Comment

by:pablouruguay
ID: 12068426
the output of grep command


i cant understand "WHY" xinetd... if you like to forward ports you need iptables.  NOT xinetd
0
 

Author Comment

by:GentooOS
ID: 12068458
OK, Could you help me doing this with using iptables?
0
 
LVL 14

Expert Comment

by:pablouruguay
ID: 12068608
mmmm i dont think so... jlevie, redimidio or owens  are the correct guys for this job,  they understan much better iptables than me sorry
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now