"OTRS Daemon Not Running" Issues

Moderator: crythias

Post Reply
TritonZach
Znuny newbie
Posts: 3
Joined: 30 Apr 2016, 20:21
Znuny Version: 5 Free

"OTRS Daemon Not Running" Issues

Post by TritonZach »

Hello all - trying to fix some mail fetch problems on OTRS 5.

I logged into the admin dashboard (ie, <address>/index.pl?>) and see the red "OTRS daemon is not running" warning. As a result of this, mail is not being automatically fetched for my queue. I am trying to get permissions issues with the daemon resolved (I think).

I execute the following commands as the otrs user and received this output:
otrs$ ls /opt/otrs/var/cron/
aaa_base otrs_daemon
You have new mail in /var/spool/mail/root


otrs$ /opt/otrs/bin/Cron.sh start
/opt/otrs
Cron.sh - start/stop OTRS cronjobs
Copyright (C) 2001-2012 xxx, http://otrs.org/
(using /opt/otrs) done

otrs$ ./otrs.Daemon.pl status
otrs.Daemon.pl - the otrs daemon
Copyright (C) 2001-2016 xxx, http://otrs.com/

ERROR: Permission denied: /opt/otrs/Kernel/Config/Files/ZZZAAuto.pm
ERROR: Permission denied: /opt/otrs/Kernel/Config/Files/ZZZAuto.pm
Daemon running
You have new mail in /var/spool/mail/root

Checking the root mail:

From otrs@generic Sat Apr 30 14:35:02 2016
Return-Path: <otrs@generic>
X-Original-To: root@localhost
Delivered-To: root@generic
Received: by generic (Postfix, from userid 1001)
id 5D37B18C04B6; Sat, 30 Apr 2016 14:35:02 -0400 (EDT)
From: "(Cron Daemon)" <otrs@generic>
To: root@generic
Subject: Cron <otrs@generic> $HOME/bin/otrs.Daemon.pl start >> /dev/null
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
Precedence: bulk
X-Cron-Env: <XDG_SESSION_ID=5530>
X-Cron-Env: <XDG_RUNTIME_DIR=/run/user/1001>
X-Cron-Env: <LANG=en_US.UTF-8>
X-Cron-Env: <MAILTO=root@localhost>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/otrs>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=otrs>
X-Cron-Env: <USER=otrs>
Message-Id: <20160430183502.5D37B18C04B6@>
Date: Sat, 30 Apr 2016 14:35:02 -0400 (EDT)

/bin/sh: /home/otrs/bin/otrs.Daemon.pl: No such file or directory


When I run ps:

otrs$ ps -aef | grep otrs
otrs 29691 1 0 13:39 pts/1 00:00:01 /usr/bin/perl -X ./otrs.Daemon.pl start

Checking crontab as root user:

root# crontab -u otrs -l
# Who gets the cron emails?
MAILTO="root@localhost"

# check OTRS daemon status
*/5 * * * * $HOME/bin/otrs.Daemon.pl start >> /dev/null

The errors in italics (obviously) seem to be the problem, but I do not know how to resolve it. I am able to click "Fetch" and the job finishes with emails then being visible on the dashboard. It appears have both a permissions issue and an issue where it's looking for a file that doesn't exist.

My system specs are as follows:
OS:
Red Hat Enterprise Linux Server release 7.2 (Maipo)

otrs$ cat RELEASE

PRODUCT = OTRS
VERSION = 5.0.8
BUILDDATE = Thu Mar 10 02:37:32 CET 2016
BUILDHOST = otrsbuild.otrs.com
Can anyone help?

Thanks!
TritonZach
Znuny newbie
Posts: 3
Joined: 30 Apr 2016, 20:21
Znuny Version: 5 Free

Re: "OTRS Daemon Not Running" Issues

Post by TritonZach »

Anybody with some wisdom? :)
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: "OTRS Daemon Not Running" Issues

Post by jojo »

read the posted messages more carefully

OTRS Home is wroong (user might be created wrongly) -> /home/otrs instead of /opt/otrs
also check the permissions or directly set them via the otrs.SetPermission.pl script
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
TritonZach
Znuny newbie
Posts: 3
Joined: 30 Apr 2016, 20:21
Znuny Version: 5 Free

Re: "OTRS Daemon Not Running" Issues

Post by TritonZach »

Thank you for your help!

For anyone else facing this issue, here is what I ran to fix it:
Run these as root user:

usermod -G apache otrs
usermod -m -d /opt/otrs otrs // may say usermod: directory /opt/otrs exists
./otrs.SetPermissions.pl --web-group=apache
./otrs.Daemon.pl start
./Cron.sh start
Post Reply