[SOLVED] Scheduler process is registered but might not be running

Moderator: crythias

Locked
Sayannara
Znuny advanced
Posts: 118
Joined: 22 May 2012, 12:37
Znuny Version: OTRS 7.06
Real Name: Yann
Company: FVE
Contact:

[SOLVED] Scheduler process is registered but might not be running

Post by Sayannara »

Thank you for your solution.

I am exactly in the same situation. OTRS 3.1.11 from Windows to OpenSuse. My email are not fetched at all.

Cordeos said
you should now have a single
I deleted an old record from table process_id but these two records are always created
  • PostMasterMailbox
  • otrs.Scheduler
How to prevent creating PID PostMasterMailbox ? Could it be created because I execute it with otrs account ?
Can't create PID PostMasterMailbox, because it's already running (FETO1S194.fednet.local/1994)!
Last edited by Sayannara on 16 Dec 2015, 11:07, edited 2 times in total.
Centos 7 / OTRS::ITSM 6 Business Solutions / MariaDB / Apache
Sayannara
Znuny advanced
Posts: 118
Joined: 22 May 2012, 12:37
Znuny Version: OTRS 7.06
Real Name: Yann
Company: FVE
Contact:

Re: Scheduler process is registered but might not be running

Post by Sayannara »

Thanks crythias for the move.

I finaly got it to work but I dont why... I deleted records from DB and when I use PostMasterMailbox.pl it doesn't create a PID PostMasterMailbox. I also can fetch email manually. I modified /opt/otrs/var/cron/postmaster_mailbox to fetch email every minutes

Code: Select all

*/1 * * * *    $HOME/bin/otrs.PostMasterMailbox.pl >> /dev/null
but it does not...

question is still there, why sometimes postMasterMailbox create is own PID ?
Centos 7 / OTRS::ITSM 6 Business Solutions / MariaDB / Apache
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Scheduler process is registered but might not be running

Post by crythias »

Sayannara wrote:question is still there, why sometimes postMasterMailbox create is own PID ?
To prevent it from running again while it's running.

If it takes longer than 1 minute to grab the current set of emails, it's probably not worth it to try to grab again the same set of emails (possibly duplicating the email). If you want the email to be received faster, you might want to let OTRS be the destination for email rather than a holding mailbox. Then tickets can be handled as they're sent/received, not when they're being polled.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Sayannara
Znuny advanced
Posts: 118
Joined: 22 May 2012, 12:37
Znuny Version: OTRS 7.06
Real Name: Yann
Company: FVE
Contact:

Re: Scheduler process is registered but might not be running

Post by Sayannara »

Alright! Thank you. 1 minute is only for testing

I didn't know we can let OTRS to be the detination, any doc about this ?

I have now only 1 PID which is the good one otrs.Scheduler. I can from /etc/init.d/otrs-scheduler-linux and/or from /opt/otrs/bin/otrs.Scheduler.pl start, stop and get status without any issue.

I also executed /opt/otrs/binCron.sh start otrs

and as I said before I have in this file /opt/otrs/bin/otrs.PostMasterMailbox.pl

Code: Select all

*/5 * * * *    /opt/otrs/bin/otrs.PostMasterMailbox.pl >> /dev/null
But Cron job does not fetch email. Manually it works.

Please suggest. What am I missing ?
How can I know if Cron is really working ? And what is actually registred to be scheduled ?
Centos 7 / OTRS::ITSM 6 Business Solutions / MariaDB / Apache
Sayannara
Znuny advanced
Posts: 118
Joined: 22 May 2012, 12:37
Znuny Version: OTRS 7.06
Real Name: Yann
Company: FVE
Contact:

Re: Scheduler process is registered but might not be running

Post by Sayannara »

This website is pretty cool to understand how to create Cron jobs and how to list current jobs

http://www.thegeekstuff.com/2009/06/15- ... -examples/

Code: Select all

crontab -l -u otrs
output:
MAILTO="root@localhost"
20 0 * * 0 $HOME/bin/otrs.DeleteCache.pl --expired >> /dev/null
30 0 * * 0 $HOME/bin/otrs.LoaderCache.pl -o delete >> /dev/null
*/20 * * * * $HOME/bin/otrs.GenericAgent.pl >> /dev/null
*/10 * * * * $HOME/bin/otrs.GenericAgent.pl -c db >> /dev/null
45 */2 * * * $HOME/bin/otrs.PendingJobs.pl >> /dev/null
10 0 * * * $HOME/bin/otrs.cleanup >> /dev/null
*/2 * * * * /opt/otrs/bin/otrs.PostMasterMailbox.pl >> /dev/null
01 01 * * * $HOME/bin/otrs.RebuildTicketIndex.pl >> /dev/null
55 */2 * * * $HOME/bin/otrs.DeleteSessionIDs.pl --expired >> /dev/null
35 * * * * $HOME/bin/otrs.UnlockTickets.pl --timeout >> /dev/null
In OTRS logs I can see
Tue Dec 15 09:20:03 2015 notice OTRS-otrs.GenericAgent.pl-01 Run GenericAgent Job 'send escalation notifications' from config file.
Tue Dec 15 09:00:02 2015 notice OTRS-otrs.GenericAgent.pl-01 Run GenericAgent Job 'send escalation notifications' from config file.
The job for GenericAgent.pl works, please, please any thaught why postMailMaster does not ?

">> /dev/null" shouold redirect log to the file null right ? Why is this file empty ?

And where is the $HOME variable set ? With my OpenSuse 13.1 if I echo $HOME it is /root so the path would be /root/bin/ and there is no otrs.scripts there, how can this work ?

crythias my OTRS's god :D ?
Centos 7 / OTRS::ITSM 6 Business Solutions / MariaDB / Apache
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Scheduler process is registered but might not be running

Post by crythias »

in your cron job, PostMasterMailbox is an absolute path. Make sure it's a valid path.

Individual cron files are in otrs/var/cron

Code: Select all

bin/Cron.sh start otrs
(or stop, or restart)

$HOME is the path set for the user-that's-running home. cron runs as otrs, not root.
you might

Code: Select all

grep otrs /etc/passwd
to get otrs's knowledge of $HOME
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Sayannara
Znuny advanced
Posts: 118
Joined: 22 May 2012, 12:37
Znuny Version: OTRS 7.06
Real Name: Yann
Company: FVE
Contact:

Re: Scheduler process is registered but might not be running

Post by Sayannara »

Yes I start Cron.sh with otrs user.
Yes the absolute path is valid.
Yes I have a good status with otrs-scheduler-linux status and otrs.Scheduler.pl -a status.
Yes the PID is correctly registred in process_id. But i had to delete old records in process_id
Yes I can see otrs cron jobs with crontab -l -u otrs.
Yes I read the INSTALL.

OK thanks for the $Home variable.

I'm stucked now with the scheduler which do not schedule anything.
Centos 7 / OTRS::ITSM 6 Business Solutions / MariaDB / Apache
Sayannara
Znuny advanced
Posts: 118
Joined: 22 May 2012, 12:37
Znuny Version: OTRS 7.06
Real Name: Yann
Company: FVE
Contact:

Re: Scheduler process is registered but might not be running

Post by Sayannara »

Well I'm a Cron expert now but still can't get it to work. I suppose I changed something somewhere. I revert to a last snapshot and it works.

If somebody has this issue this thread should at least help him.
Centos 7 / OTRS::ITSM 6 Business Solutions / MariaDB / Apache
Sayannara
Znuny advanced
Posts: 118
Joined: 22 May 2012, 12:37
Znuny Version: OTRS 7.06
Real Name: Yann
Company: FVE
Contact:

Re: [SOLVED] Scheduler process is registered but might not be running

Post by Sayannara »

OMG I understand what is going on! I lost so much time because of this :(

A PostMasterMailbox PID is created in the otrs DB, table process_id IF there is an encoding issue (please have a look of this thread => viewtopic.php?f=62&t=31058). I reproduced the issue 3 times.

The source of this issue is NOT Cron but enconding ’ = apostrophe
Centos 7 / OTRS::ITSM 6 Business Solutions / MariaDB / Apache
Locked