Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
xinetd help
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Gentoo20
n00b
n00b


Joined: 14 Sep 2004
Posts: 12

PostPosted: Tue Sep 14, 2004 8:17 pm    Post subject: xinetd help Reply with quote

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?

Thanks for any help. Gentoo forums are the best!!
Back to top
View user's profile Send private message
aetius
Tux's lil' helper
Tux's lil' helper


Joined: 09 Jul 2004
Posts: 118

PostPosted: Wed Sep 15, 2004 3:53 pm    Post subject: Reply with quote

You might be able to warp xinetd to do that, but I don't think it would be a good idea. xinetd is intended to manage connections for various sub-services (ftp, telnet, etc) and when a connection request comes in, it spawns a server to deal with that connection request. This was a solution to the problem of having lots of services running and taking up memory without actually doing anything. On most modern systems xinetd is unnecessary.

Probably the simplest solution would be to write a small script that checks to see if squid is working, and if not adds an iptables rule(s) that forwards traffic on to the web server itself, bypassing squid. Once squid meets the criteria of being back up, the script would automatically remove the iptables rule(s) and squid would begin receiving traffic again. You could run the script every 30 seconds or every minute or whatever. The main issue would be how to tell if squid was up and working correctly -- possibly a test page that could be requested and checked by the script? Would have to think on that. Checking the process itself is out, because squid could be hung or looping or something and that state might not be detectable via ps. Checking to see if the ports are open has the same issue, squid could be unresponsive and the ports would appear to be open.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum