Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Trouble after power outage

Hey all,

I posted this in the installation/Setup forum, but think this is actually a better fit, my apologies for the x-post.  Admins please feel free to delete one of them.

A former coworker of mine set up OSTicket for our company about a year ago, and it has been working great!!

....Up until about a week and a half ago.  We had a power outage and subsequent generator failure that caused all of our systems to lose power and go down hard.  We have everything back up and running, with the exception of OSTicket not fetching emails!  It used to check once per minute, but is no longer doing so.  However, auto cron is working, as it fetches emails and opens tickets as soon as I log into the web appliance.

I have spent the last two days reading all sorts of things on this forum, and reading the wiki, but it just isn't making sense to me.  It is setup on a Cent OS server, and I have extremely limited Linux experience.  I have never used cron before.  In reading other threads with similar problems, it seems like most people just point them to the IMAP/POP3 setup wiki...which I have read like 10 times now, but just isn't making sense.  I apologize for my lack of knowledge here, but I'm just going to need some additional help.

I am attaching my system info below, but please let me know what else I can provide to help troubleshoot this!!

Comments

  • Link
    osticket info.JPG
    959 x 521 - 98K
  • edited September 2016
    Since you are running CentOS then you may be running SELinux.
    First thing I would do is read this:
    https://www.centos.org/docs/5/html/5.2/Deployment_Guide/sec-sel-enable-disable.html

    Disable SELinux for now, remember to re-enable it if the problem is not resolved.

    NExt read this:
    https://www.centos.org/forums/viewtopic.php?t=17840
    It talks about seeing your cronjobs so that you can hopefully determine if your cronjob is running cron.php
  • Thanks ntozier.  

    The selinux file in /etc/sysconfig shows 

    SELINUX=disabled
        and
    SELINUXTYPE=targeted

    so it appears SELinux is already disabled?
  • I don't run SELinux, so I don't know how to disable it.
  • Well I believe SELinux is disabled.

    When looking in /var/spool/cron as your second link suggests, there is nothing at all in that folder.
  • Then thats likely your problem.  To collect emails you have to use cron to run the cron.php as described in the docs.  This CentOS documentation on automating tasks may assist you.
    https://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-autotasks.html



  • I am confused as to the relationship between the cron jobs, and the auto cron that runs as soon as I log into the osticket web system.  If it works when I log in, does that mean that the cron is set up correctly, it just isn't running every minute like it is supposed to? Or is it unrelated?
  • Q: If it works when I log in, does that mean that the cron is set up
    correctly, it just isn't running every minute like it is supposed to?
    A: they really have nothing to do with each other.  Autocron (which is honestly only there as a very last resort) is a way to trigger cron.php on staff activity IF no other cron or rcron solution will work for them.  If c ron is setup correctly at the OS (CentOS) level then autocron isn't needed.
  • OK gotcha.  I am now attaching /etc/crontab as well as cron.php that is referenced in crontab...maybe that will help?

    cron.php.jpg
    993 x 602 - 131K
    crontab.jpg
    1024 x 577 - 94K
  • is /usr/bin/php your path to PHP5?
  • I don't really know for sure how to check that.  But there are two files in that directory about php, /usr/bin/php and /usr/bin/php-cgi
  • rpm -q php
  • rpm -q php command returns

    php-5.3.3-46.el6_6.i686
  • As an additional note...

    I have debug logging turned on.  If I turn OFF auto-cron, I get nothing at all in the logs.  With auto-cron ON, I just get auto-cron messages.
  • You appear to have only one version of PHP installed (which is good).
    I would delete the cron job, and create a new one.
    You ought to be able to good setting up a task in your version of CentOS (I've never run CentOS personally).  It's probably fairly similar to other flavors of Linux.

    Do you have access to your mail server connection logs?  Being able to check and see if the server is trying to connect would be good.  What user does your webserver run as?  You might want to check that users crontab also.
  • So I entered a Terminal in CentOS, and ran 

    php -f /var/www/html/api/cron.php

    It grabbed the email I had just sent and immediately opened a ticket.  So....which part of the equation is the issue?  Is it the crontab file?  What "runs" or sees the crontab file?  I did check to see that the crond service is running (which I'm guess is what runs the crontab file)??


  • So I went back and was looking at the crontab file, and comparing it against the example given on the wiki.  I noticed on my crontab, it was running as user "httpd", while the example had it as "nobody".  I switched it to nobody in my crontab file, and it worked!

    I am now seeing a Cron Job run every minute in the osticket log, and it is opening tickets from email!  I'm not sure how the other guy had it set up before, because I looked at old Cron logs on the server and they weren't showing it running (even up to a month ago before the problems started), but it's working now!
  • edited September 2016
    Excellent.  :)

    Individual users have their own crontab files, so he could have had it running under the httpd user.  Or his personal user account.
Sign In or Register to comment.