Find the answer to your Linux question:
Results 1 to 6 of 6
Hi Folks, I hope someone can offer some advice on what might be happening with a cron problem I'm having. I have a script that requires three cron jobs which ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2014
    Posts
    6

    Question Cron Job Error messages suddenly started - mount -t proc none /proc


    Hi Folks,

    I hope someone can offer some advice on what might be happening with a cron problem I'm having.

    I have a script that requires three cron jobs which I've been running since 2008 without problems. In 2012 I switched to VPS managed hosting and in July 2013 I installed the latest version of script.

    On Monday night this week I started receiving emails reporting the following error with one of the cron jobs.

    Error, do this: mount -t proc none /proc
    The cron was set to run every 25 minutes and the error is produced each time it runs.

    */25 * * * * /usr/bin/perl /home/mysite/public_html/cgi-bin/arp3/arp3-popreader.pl 1>&2 > /dev/null
    My hosting support seem to be struggling with this and want to point the finger at the script. My position is that the script has remained unchanged since 31 July 2013, has worked fine since then and therefore something else must have changed to be causing this problem?

    My server is running CENTOS 5.10 x86_64 virtuozzo / WHM 11.40.1 (build 10)

    One thing I have noticed which seems a bit odd. Is when the cron is set to run every 25 minutes, I get two error messages 25 minutes apart and then the third one is timed 10 minutes later! Here are some of the time stamps of messages -

    8.00
    8.25
    8.50
    9.00
    9.25
    9.50
    10.00
    10.25
    10.50

    Notice how every third message is being generated only ten minutes after the previous cron on the top of the hour. As the cron is set for every 25 minutes, it shouldn't be running a cron at these points. Should it?

    The command line for the cron works fine when executed from a browser, so I know my script is still OK.

    The other two crons for this script are not generating any error. I've tried deleting cron job, rebooting server and re-establishing cron job, plus changing cron times, but the errors messages keep coming!

    Any ideas what may have gone wrong and what can be done to fix this issue?

    I hope someone can advise?

    Closing down for the day, but will check back tomorrow in hope of salvation or a lifeline!

    Many thanks,

    Myles

  2. #2
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    794
    */25 should run at minute 00, so that is valid. It's not every 25 minutes, it's if (Minute % 25 == 0) run...

    There's no telling what's wrong with your script. Perhaps your just started receiving emails, and the error has been there all along. Either way, we can't be of much help to you unless we can see the script.

  3. #3
    Just Joined!
    Join Date
    Feb 2014
    Posts
    6
    OK, thanks for your response.

    The function of the script is to empty the "catch all" mailbox of my autoresponder whenever the script is run.

    Here's a copy of it. I've blocked out my mailbox password, but that is the only change I've made.

    Code:
    #!/usr/bin/perl
     
    ###################################################
    # AutoResponse Plus (tm)                          #
    # Copyright ECom24 Ltd 2000 - 2013                #
    # All rights reserved                             #
    # autoresponseplus.com                 #
    ###################################################
    
    $ARP3_CGI_PATH = "/home/magicalw/public_html/cgi-bin/arp3";
    
    $mailHost = "mail.magicalwonders.com";
    # On a CPanel server this will be mail.yourdomain.com
    
    $mailUser = "arplus\@magicalwonders.com";
    # Remember \@ if this is an email address
    # Example: you\@yourdomain.com
    # On a CPanel server this will be whatever+yourdomain.com
    
    $mailPassword = "xxxxxxxxxxx";
    
    #######################################
    # CHANGE NOTHING BELOW THIS LINE      #
    #######################################
    print "Content-type: text/html\n\n";
    
    exit if scalar(split "\n",`ps | grep 'arp3-popreader.pl'`) > 1;
    
    use Net::POP3;
    $pop = Net::POP3->new($mailHost);
    if ($pop) {
        $lastDate = "00000000000000";
        if (open (LOG, "<$ARP3_CGI_PATH/temp/pop.last")) {
            $lastDate = <LOG>;
            close(LOG);
        }
        %months = (Jan=>"01",Feb=>"02",Mar=>"03",Apr=>"04",May=>"05",Jun=>"06",Jul=>"07",Aug=>"08",Sep=>"09",Oct=>"10",Nov=>"11",Dec=>"12");
        @dozen = ("00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10");
        $count = 0;
        $msgs_number = $pop->login($mailUser, $mailPassword);
        for ($msg = $msgs_number; $msg > 0; --$msg) {
            $header = $pop->top($msg);
            $currDate = "00000000000000";
            foreach $line (@{$header}) {
                if ($line =~ /(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),)? (\d+) (\w+) (\d+) (\d\d):(\d\d):(\d\d)/) {
                    $d = $1;
                    $d = $dozen[$d] if (10 > $d);
                    $m = $months{$2};
                    $currDate = "$3$m$d$4$5$6";
                    last;
                }
            }
            if ($currDate > $lastDate) {
                if (!$count++ && open (LOG, ">$ARP3_CGI_PATH/temp/pop.last")) {
                    print LOG $currDate;
                    close(LOG);
                }
                open (CAPTURE, "|/usr/bin/perl $ARP3_CGI_PATH/arp3-emailcapture.pl");
                $pop->get($msg, *CAPTURE);
                $pop->delete($msg);
                close(CAPTURE);
            } else {
                last;
            }
        }
        $pop->quit();
        print "Count: $count\n";
    }
    I'm a bit lost as to how the script can be suddenly causing the issue. It's been doing it's job for a long time without a problem.

    I can run the script from my browser, and it executes without any php errors.

    I was hoping that the error message "Error, do this: mount -t proc none /proc " might actually mean something useful and point towards what the problem is?

    My knowledge of Linux is less than what can be written on the back of a stamp, so I'm hoping for some clues.

  4. #4
    Linux Newbie
    Join Date
    Nov 2009
    Posts
    214
    Well, "mount -t proc none /proc" appears to be somebody trying to mount the proc filesystem.

    The keyword "none" could be anything but, in this case, should be "proc" perhaps.

    Maybe you could put some debugging type displays in your perl script so that, perhaps, you can see when the message is being produced. Either before or during your script.

  5. #5
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    794
    I'm not seeing anything jump out at me. Try running the script from the command line without the '1>&2 > /dev/null' and see what it says.

  6. #6
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    586
    Quote Originally Posted by voidpointer69 View Post
    Well, "mount -t proc none /proc" appears to be somebody trying to mount the proc filesystem.

    The keyword "none" could be anything but, in this case, should be "proc" perhaps.

    Maybe you could put some debugging type displays in your perl script so that, perhaps, you can see when the message is being produced. Either before or during your script.
    The "none" in this case should be "none".

Posting Permissions

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