Solved

xinetd help

Posted on 2004-09-15
7
369 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

726 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