[SOLVED] Cron Not Working on FreeBSD?

Moderator: crythias

Locked
skullz
Znuny superhero
Posts: 658
Joined: 24 Feb 2012, 03:58
Znuny Version: LTS and Features
Real Name: Mo Azfar
Location: Kuala Lumpur, MY
Contact:

[SOLVED] Cron Not Working on FreeBSD?

Post by skullz »

Hi all..
I have OTRS 3.2.1 version on my FreeBSD machine..
using mysql database in a remote machine (ubuntu)..

1. I setup a cron by using perl /usr/local/otrs/Cron.sh start otrs
2. Success. I even try to view the crontab file by crontab -l -u otrs. Success
3. I can fetch email manually using Admin>PostMasterMail Account > Fetch Mail.

The problem is, look like cronjob not working in fetching an email automatically.
Any idea?Thanks in advanced.
Last edited by skullz on 25 Feb 2013, 08:34, edited 1 time in total.
My Github
OTRS CE/LTS Discord Channel
Cant Update Package Anymore ? Check This

Professional OTRS, Znuny & OTOBO services: efflux.de/en
Free and premium add-ons: English
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: [Help] Cron Not Working on FreeBSD?

Post by crythias »

What does the system log say about the job?
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
skullz
Znuny superhero
Posts: 658
Joined: 24 Feb 2012, 03:58
Znuny Version: LTS and Features
Real Name: Mo Azfar
Location: Kuala Lumpur, MY
Contact:

Re: [Help] Cron Not Working on FreeBSD?

Post by skullz »

crythias wrote:What does the system log say about the job?
im sorry..do you mean otrs system log?
as i wrote above, i running cron.sh scripts as otrs..but when i check "service cron status", its show services not running..i cant start it as i got permission denied.
My Github
OTRS CE/LTS Discord Channel
Cant Update Package Anymore ? Check This

Professional OTRS, Znuny & OTOBO services: efflux.de/en
Free and premium add-ons: English
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: [Help] Cron Not Working on FreeBSD?

Post by crythias »

This time I mean freebsd system log. And it appears you know the problem.
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
skullz
Znuny superhero
Posts: 658
Joined: 24 Feb 2012, 03:58
Znuny Version: LTS and Features
Real Name: Mo Azfar
Location: Kuala Lumpur, MY
Contact:

Re: [Help] Cron Not Working on FreeBSD?

Post by skullz »

perhaps this is the logs from /var/log/cron

Image
My Github
OTRS CE/LTS Discord Channel
Cant Update Package Anymore ? Check This

Professional OTRS, Znuny & OTOBO services: efflux.de/en
Free and premium add-ons: English
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: [Help] Cron Not Working on FreeBSD?

Post by crythias »

$ grep otrs /etc/passwd
otrs:x:1001:1001:OTRS User,,,:/opt/otrs:/bin/false

What does your say? Whatever it says, this is the path that replaces $HOME for (otrs) in cron.
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
skullz
Znuny superhero
Posts: 658
Joined: 24 Feb 2012, 03:58
Znuny Version: LTS and Features
Real Name: Mo Azfar
Location: Kuala Lumpur, MY
Contact:

Re: [Help] Cron Not Working on FreeBSD?

Post by skullz »

crythias wrote:$ grep otrs /etc/passwd
otrs:x:1001:1001:OTRS User,,,:/opt/otrs:/bin/false

What does your say? Whatever it says, this is the path that replaces $HOME for (otrs) in cron.
look like my path is wrong..it shows /home/otrs
the actual path should /usr/local/otrs right?? (for freebsd)
i believe this is because when setup a freebsd, i already create otrs user..

i know this is out of topic (otrs), it is save to me to change user home directory??
Or
should i edit crontab instead, point the path to /usr/local/otrs/bin/otrsscript.pl??
thanks..this should solve my problem..
My Github
OTRS CE/LTS Discord Channel
Cant Update Package Anymore ? Check This

Professional OTRS, Znuny & OTOBO services: efflux.de/en
Free and premium add-ons: English
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: [Help] Cron Not Working on FreeBSD?

Post by crythias »

Yes, it is safe to change the home directory. You may need to use vipw twice, once for passwd, and another for the shadow copy. Read the man pages
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
skullz
Znuny superhero
Posts: 658
Joined: 24 Feb 2012, 03:58
Znuny Version: LTS and Features
Real Name: Mo Azfar
Location: Kuala Lumpur, MY
Contact:

Re: [Help] Cron Not Working on FreeBSD?

Post by skullz »

crythias wrote:Yes, it is safe to change the home directory. You may need to use vipw twice, once for passwd, and another for the shadow copy. Read the man pages
thanks..
cron working for now..
[SOLVED]
My Github
OTRS CE/LTS Discord Channel
Cant Update Package Anymore ? Check This

Professional OTRS, Znuny & OTOBO services: efflux.de/en
Free and premium add-ons: English
ashraf
Znuny newbie
Posts: 2
Joined: 27 Feb 2013, 09:36
Znuny Version: 3.1.8
Real Name: Ashraf

Re: [SOLVED] Cron Not Working on FreeBSD?

Post by ashraf »

Hi all,

Seems this thread solve.

my problem same as skullz, but i'm using SLES 11. How do i change the path ?
crythias wrote:$ grep otrs /etc/passwd
otrs:x:1001:1001:OTRS User,,,:/opt/otrs:/bin/false

What does your say? Whatever it says, this is the path that replaces $HOME for (otrs) in cron.
I have change mine from as below :

before :
CHBSOTRS01:/ # grep otrs /etc/passwd
otrs:x:1000:100:otrs:/home/otrs:/bin/bash

after:
CHBSOTRS01:/ # grep otrs /etc/passwd
otrs:x:1000:100:otrs:/opt/otrs:/bin/false

Try to send email and its not working, looks like cronjob still not working in fetching an email automatically.
when i tried to manually fetch at Admin tab in OTRS, its working.

Pleaseee help
ashraf
Znuny newbie
Posts: 2
Joined: 27 Feb 2013, 09:36
Znuny Version: 3.1.8
Real Name: Ashraf

Re: [SOLVED] Cron Not Working on FreeBSD?

Post by ashraf »

Problem solved when i restart the CRON job.

THank you
Locked