Error with Cron.sh

Moderator: crythias

Locked
jme
Znuny newbie
Posts: 20
Joined: 28 Jun 2010, 13:59
Znuny Version: 2.4

Error with Cron.sh

Post by jme »

Hi all,

regarding the documentation, at the end of installation, we have to execute the command Cron.sh

When i execute this command i've a error.

sudo ./Cron.sh start otrs
/opt/otrs/bin
Cron.sh - start/stop OTRS cronjobs - <$Revision: 1.19 $>
Copyright (C) 2001-2009 xxx, http://otrs.org/
"/opt/otrs/var/tmp/otrs-cron-tmp.31142":125: bad minute
errors in crontab file, can't install.
failed
Can anyone help me to solve that?

Thanks in advance
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Error with Cron.sh

Post by crythias »

unfortunately, this may not be so easy to diagnose as it's trying to install (I think) all the files that exist in $OTRS_HOME/var/cron ... so if one of those files has been manually edited, or incorrect, or not a real cron file, you'll have this issue.
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
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: Error with Cron.sh

Post by ferrosti »

In Cron.sh disable the line that says
rm -rf $CRON_TMP_FILE

Run it again. Then have a look at the file $OTRS_ROOT/var/tmp/otrs-cron-tmp.$$
Have a look at the line number given in the error description (125). I´d expect the column for 'minute' to be misconfigured as the error says.

Then have a look at the files in $OTRS_ROOT/var/cron, except the *.dist ones. You will find the matching misconfigured line in one of them.
Correct it, reenable the line in Cron.sh and give it another try.
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
jme
Znuny newbie
Posts: 20
Joined: 28 Jun 2010, 13:59
Znuny Version: 2.4

Re: Error with Cron.sh

Post by jme »

Hi,

i've found the problem :-)

I had a file "test" in the folder, i have created this file to change the *dist file to a regular file.

Thx
jme
Znuny newbie
Posts: 20
Joined: 28 Jun 2010, 13:59
Znuny Version: 2.4

Re: Error with Cron.sh

Post by jme »

Hi,

I've another error now, i receive this from the cron:

/bin/sh: /usr/share/otrs/bin/PostMasterMailbox.pl: not found

and this:

/bin/sh: /usr/share/otrs/bin/GenericAgent.pl: not found

Why does it go to usr/share/otrs ?

In the crontab i see that themap is $home/bin/PostMasterMailbox.pl

where is $HOME configured ?
If i change $HOME by /opt/otrs/ it works.

thx
Last edited by jme on 01 Jul 2010, 17:33, edited 1 time in total.
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: Error with Cron.sh

Post by ferrosti »

Can you please post your crontab here (mark it as 'Code' please).
Where do you receive this from cron? By mail or in /var/log/messages ?

Login as 'otrs' and post your environment variables for $HOME and $PATH, please.
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
jme
Znuny newbie
Posts: 20
Joined: 28 Jun 2010, 13:59
Znuny Version: 2.4

Re: Error with Cron.sh

Post by jme »

I received the log bi e-mail.

I've receves some more now:
ERROR: OTRS-GenericAgent-10 Perl: 5.10.1 OS: linux Time: Thu Jul 1 17:40:02 2010

Message: Module Kernel/Config/GenericAgent.pm not found!

Traceback (18274):
Module: /opt/otrs/bin/GenericAgent.pl (v1.59) Line: 108

ERROR: Can't load agent job file 'Kernel::Config::GenericAgent':
/bin/sh: /usr/share/otrs/bin/GenericAgent.pl: not found
Login as 'otrs' and post your environment variables for $HOME and $PATH, please.
How can i do that ?
administrator@Ubuntu1004OTRS:/opt/otrs/bin$ sudo crontab -l -u otrs
# --
# cron/aaa_base - base crontab package
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: aaa_base.dist,v 1.7 2009/02/16 20:35:25 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# Who gets the cron emails?
MAILTO="karl@inventivetelecom.com"
# --
# cron/fetchmail - fetchmail cron of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: fetchmail.dist,v 1.10 2009/02/16 20:53:10 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# fetch every 5 minutes emails via fetchmail
#*/5 * * * * [ -x /usr/bin/fetchmail ] && /usr/bin/fetchmail -a >> /dev/null
#*/5 * * * * /usr/bin/fetchmail -a --ssl >> /dev/null
# --
# cron/generic_agent - GenericAgent.pl cron of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: generic_agent.dist,v 1.12 2009/02/16 20:53:10 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# start generic agent every 20 minutes
*/20 * * * * /opt/otrs/bin/GenericAgent.pl >> /dev/null

# example to execute GenericAgent.pl on 23:00 with
# Kernel::Config::GenericAgentMove job file
#0 23 * * * $HOME/bin/GenericAgent.pl -c "Kernel::Config::GenericAgentMove" >> /dev/null
# --
# cron/generic_agent - GenericAgent.pl cron of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: generic_agent-database.dist,v 1.8 2009/02/16 20:55:11 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# start generic agent every 10 minutes
*/10 * * * * $HOME/bin/GenericAgent.pl -c db >> /dev/null
# --
# cron/pending_jobs - pending_jobs cron of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: pending_jobs.dist,v 1.11 2009/02/16 20:55:11 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# check every 120 min the pending jobs
45 */2 * * * $HOME/bin/PendingJobs.pl >> /dev/null
# --
# cron/postmaster - postmaster cron of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: postmaster.dist,v 1.9 2009/02/16 20:55:11 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# check daily the spool directory of OTRS
#10 0 * * * * [ -e /etc/init.d/otrs ] && /etc/init.d/otrs cleanup >> /dev/null; [ -e /etc/rc.d/init.d/otrs ] && /etc/rc.d/init.d/otrs cleanup >> /dev/null
10 0 * * * $HOME/bin/otrs.cleanup >> /dev/null
# --
# cron/postmaster_mailbox - postmaster_mailbox cron of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: postmaster_mailbox.dist,v 1.2 2009/02/16 20:55:11 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# fetch emails every 10 minutes
*/5 * * * * /opt/otrs/bin/PostMasterMailbox.pl >> /dev/null
# --
# cron/rebuild_ticket_index - rebuild ticket index for OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: rebuild_ticket_index.dist,v 1.9 2009/02/16 20:55:11 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# just every day
01 01 * * * $HOME/bin/RebuildTicketIndex.pl >> /dev/null
# --
# cron/session - delete old session ids of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: session.dist,v 1.11 2009/02/16 20:55:11 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# delete every 120 minutes old/idle session ids

55 */2 * * * $HOME/bin/DeleteSessionIDs.pl --expired >> /dev/null
# --
# cron/unlock - unlock old locked ticket of the OTRS
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: unlock.dist,v 1.10 2009/02/16 20:55:11 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

# unlock every hour old locked tickets
35 * * * * $HOME/bin/UnlockTickets.pl --timeout >> /dev/null
administrator@Ubuntu1004OTRS:/opt/otrs/bin$
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: Error with Cron.sh

Post by ferrosti »

Login as 'otrs' and post your environment variables for $HOME and $PATH, please.
How can i do that ?
sudo su - otrs
echo $HOME
echo $PATH

Return to the previous users login by typing 'exit'.

crontab looks good, as long as your home path points to /opt/otrs. Make sure that otrs actually is installed into this directory!
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Error with Cron.sh

Post by crythias »

echo $OTRS_HOME
as well, please? (It's likely configured in Config.pm.)
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
ferrosti
Znuny superhero
Posts: 723
Joined: 10 Oct 2007, 14:30
Znuny Version: 3.0
Location: Hamburg, Germany

Re: Error with Cron.sh

Post by ferrosti »

It's damn late and I had some beer...
AFAIR $OTSR_HOME is no environment variable. And ENVs are not configured in Config.pm.
But crythias is right, post the home path variable from your Config.pm as well, please.

I am not sure, but I think there were some variables configured in /etc/sysconfig/otrs as well.
openSuSE on ESX
IT-Helpdesk: OTRS 3.0
Customer Service: OTRS 3.0 (upgraded from 2.3)
Customer Service (subsidiary): OTRS 3.0
+additional test and development systems
jme
Znuny newbie
Posts: 20
Joined: 28 Jun 2010, 13:59
Znuny Version: 2.4

Re: Error with Cron.sh

Post by jme »

Hi,
administrator@Ubuntu1004OTRS:~$ sudo su - otrs
No directory, logging in with HOME=/
administrator@Ubuntu1004OTRS:~$ echo $HOME
/home/administrator
administrator@Ubuntu1004OTRS:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
administrator@Ubuntu1004OTRS:~$ echo $OTRS_HOME

administrator@Ubuntu1004OTRS:~$
# --
# Kernel/Config.pm - Config file for OTRS kernel
# Copyright (C) 2001-2009 xxx, http://otrs.org/
# --
# $Id: Config.pm.dist,v 1.21 2009/02/16 12:01:43 tr Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --
# Note:
#
# -->> OTRS does have a lot of config settings. For more settings
# (Notifications, Ticket::ViewAccelerator, Ticket::NumberGenerator,
# LDAP, PostMaster, Session, Preferences, ...) see
# Kernel/Config/Defaults.pm and copy your wanted lines into "this"
# config file. This file will not be changed on update!
#
# --

package Kernel::Config;

sub Load {
my $Self = shift;
# ---------------------------------------------------- #
# ---------------------------------------------------- #
# #
# Start of your own config options!!! #
# #
# ---------------------------------------------------- #
# ---------------------------------------------------- #

# ---------------------------------------------------- #
# database settings #
# ---------------------------------------------------- #
# DatabaseHost

# (The database host.)
$Self->{'DatabaseHost'} = 'localhost';
# Database
# (The database name.)
$Self->{'Database'} = 'otrs';
# DatabaseUser
# (The database user.)
$Self->{'DatabaseUser'} = 'otrs';
# DatabasePw
# (The password of database user. You also can use bin/CryptPassword.pl
# for crypted passwords.)
$Self->{'DatabasePw'} = 'akunamatata';
# DatabaseDSN
# (The database DSN for MySQL ==> more: "man DBD::mysql")
$Self->{DatabaseDSN} = "DBI:mysql:database=$Self->{Database};host=$Self->{DatabaseHost};";

# (The database DSN for PostgreSQL ==> more: "man DBD::Pg")
# if you want to use a local socket connection
# $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};";
# if you want to use a tcpip connection
# $Self->{DatabaseDSN} = "DBI:Pg:dbname=$Self->{Database};host=$Self->{DatabaseHost};";

# ---------------------------------------------------- #
# fs root directory
# ---------------------------------------------------- #
$Self->{Home} = '/opt/otrs';

# ---------------------------------------------------- #
# insert your own config settings "here" #
# config settings taken from Kernel/Config/Defaults.pm #
# ---------------------------------------------------- #
# $Self->{SessionUseCookie} = 0;
# $Self->{'CheckMXRecord'} = 1;

# ---------------------------------------------------- #


# data inserted by installer #
# ---------------------------------------------------- #
# $DIBI$
$Self->{'SystemID'} = 10;
$Self->{'SecureMode'} = 1;
$Self->{'Organization'} = 'Inventive Telecom Partners';
$Self->{'LogModule::LogFile'} = '/tmp/otrs.log';
$Self->{'LogModule'} = 'Kernel::System::Log::SysLog';
$Self->{'FQDN'} = 'support.inventivetelecom.com';
$Self->{'DefaultLanguage'} = 'fr';
$Self->{'AdminEmail'} = 'support@inventivetelecom.com';
$Self->{'DefaultCharset'} = 'utf-8';

# ---------------------------------------------------- #
# ---------------------------------------------------- #
# #
# End of your own config options!!! #
# #
# ---------------------------------------------------- #
# ---------------------------------------------------- #
}

# ---------------------------------------------------- #
# needed system stuff (don't edit this) #
# ---------------------------------------------------- #
use strict;
use warnings;

use vars qw(@ISA $VERSION);
use Kernel::Config::Defaults;
push (@ISA, 'Kernel::Config::Defaults');

use vars qw(@ISA $VERSION);
$VERSION = qw($Revision: 1.21 $)[1];

# -----------------------------------------------------#

I cannot fin dthe path /etc/sysconfig/.

Thx
Locked