Find the answer to your Linux question:
Results 1 to 5 of 5
Hi! I have a very odd problem here. I have two Red Hat servers (7.2 and 7.3) with real Internet addresses. In the first one I have mainly apache with ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2002
    Posts
    11

    big problem with presence on the Internet


    Hi!

    I have a very odd problem here. I have two Red Hat servers (7.2 and 7.3) with real Internet addresses. In the first one I have mainly apache with perl, ssh and qmail, and in the other I have bind and ssh. When I'm on the Intranet I can access those services without a problem, and If I'm working on the servers I can see internet. The problem is that after a while (about 15 mins or something like that), the servers can't be seen from the Internet, although they can be seen from the intranet where I'm working. The strangest part is that if I ping an Internet location from the servers when they are down to the Internet, they become available to be seen from the Internet again for a short while. Please help me, because I don't know what to do next.

    riclucx

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    That seems like a problem with your ISP. If nothing else helps, set up cron to ping something periodically.

  3. #3
    Just Joined!
    Join Date
    Oct 2002
    Location
    southern ontario, canada
    Posts
    37
    r u behind a firewall?
    that might be the problem.

  4. #4
    Just Joined!
    Join Date
    Dec 2002
    Posts
    11
    I don't think the firewall is the problem, because I have windows NT servers running too and they don't have a problem. I turned off almost all the services and I don't know if this could be the problem. I wrote a program in C doing an infinite loop and increasing a counter for making a ping when the counter has reached certain number and I run it in the lowest priority (19), this is very cpu consuming but I don't know how to setup crond.

  5. #5
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    I have several things to say about that C program. First, if you run it in nice 19, it is still CPU consuming, but that doesn't matter, since all other programs would take priority. However, doing it that way isn't really the best way of doing it, to say the least. In a multitasking operating system, you should always use blocking system calls to wait. The way to do this would be as simple as this:

    Code:
    #include <unistd.h>
    #include <stdlib.h>
    
    int main&#40;int argc, unsigned char **argv&#41;
    &#123;
        while&#40;1&#41;
        &#123;
            system&#40;"ping 217.215.27.171"&#41;;
            sleep&#40;60&#41;;
        &#125;
    &#125;
    This would, of course, run "ping 217.215.27.171" about once every minute (plus the time that ping executes, but it's not like it matters). In case you're wondering, that's my IP address.
    Non-blocking indefinite loops should always be avoided.

    However, you don't need to do this, of course. crond is very simple to set up. Just look at /etc/crontab (and see crontab(5)). If you don't want to find out yourself, though, just add this to your /etc/crontab:

    Code:
    * * * * * root ping 217.215.27.171
    That would run "ping 217.215.27.171" once every minute. The asterisks match every minute, hour, day of month, month and day of week, respectively.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •