?
Solved

xinetd help

Posted on 2004-09-15
7
Medium Priority
?
373 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 1000 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
Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

 

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

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

762 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