scheduler inactive after server restart

Moderator: crythias

Locked
doskey123
Znuny newbie
Posts: 6
Joined: 16 Nov 2011, 18:25
Znuny Version: 3.0.11

scheduler inactive after server restart

Post by doskey123 »

Hi,

everytime I restart the otrs server the otrs scheduler service fails to start on it's own.

I've tested with a clean installation of:
OTRS 3.1.4 / ITSM 3.1.4
SLES11SP1


I've added the otrs, apache2, mysql and otrs-scheduler-linux to the runlevels 3,5

However, after a restart the scheduler and cronjobs are inactive.

Code: Select all

crontab -u otrs -l
no crontab for otrs

ps -ef | grep /opt/otrs/
root      3458  3285 33 15:14 pts/0    00:00:00 grep /opt/otrs/


It seems like the init script can't load the scheduler:

Code: Select all

/etc/init.d/otrs-scheduler-linux start
Starting OTRS Scheduler                                              done

/etc/init.d/otrs-scheduler-linux status
Checking for OTRS Scheduler ...not running
I can only fix this manually after every restart:
- stopping the otrs service
- starting the otrs scheduler with /opt/otrs/bin/otrs.Scheduler.pl -a start
- starting the otrs service again

Afterwards cronjobs+scheduler are running again and mails are fetched until the next restart.

Code: Select all

ps -ef | grep /opt/otrs/
root      3510     1  1 15:20 ?        00:00:26 /usr/bin/perl -w /opt/otrs/bin/otrs.Scheduler.pl -a start
The initscript also produces a status now:

Code: Select all

/etc/init.d/otrs-scheduler-linux status
Checking for OTRS Scheduler ...running 3510
Does anyone how to fix the init script for SLES11 or is there something I've overlooked?

Kind Regards,
Doskey
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: scheduler inactive after server restart

Post by crythias »

/opt/otrs/bin/Cron.sh start otrs
crontab -l -u otrs
(big list)
/opt/otrs/bin/Cron.sh stop otrs
crontab -l -u otrs
(blank?)
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
doskey123
Znuny newbie
Posts: 6
Joined: 16 Nov 2011, 18:25
Znuny Version: 3.0.11

Re: scheduler inactive after server restart

Post by doskey123 »

crythias wrote:/opt/otrs/bin/Cron.sh start otrs
crontab -l -u otrs
(big list)
/opt/otrs/bin/Cron.sh stop otrs
crontab -l -u otrs
(blank?)
I get that exact behavior only if I start the otrs scheduler service manually before that.

Else it's blank on both commands as the scheduler is not running.


some observations:
- The init script never loads the scheduler, it uses "startproc -u $User $Scheduler -a start" and if I replace the user variable with "root" or do a manual test it'll start the scheduler ( startproc -u root /opt/otrs/bin/otrs.Scheduler.pl -a start )
- after the edit of the init script the scheduler will load after restart

However still no cron is loaded and the otrs postmaster reports it's not running. And it's permissions are changed:
-rw-r--r-- 1 otrs www 4170 May 10 14:40 otrs.PostMaster.pl

Code: Select all

service otrs status
Checking for httpd2:                                            running
Checking database connection... (Trying to connect to database
DSN: DBI:mysql:database=otrs;host=localhost;
DatabaseUser: otrs

It looks Ok!).
Checking OTRS Scheduler service.... 0
done.
Checking /opt/otrs/bin/otrs.PostMaster.pl ... (not active) failed.
Checking otrs spool dir... done.
If I do a service otrs stop / start now it'll work again and the permissions of the postmaster script are reset (to -rwxr-xr-x 1 otrs www 4170 May 10 14:40 otrs.PostMaster.pl ), so atleast that's one step less. Before I also had to start the scheduler.
doskey123
Znuny newbie
Posts: 6
Joined: 16 Nov 2011, 18:25
Znuny Version: 3.0.11

Re: scheduler inactive after server restart

Post by doskey123 »

Ok I solved the init script problem for the scheduler, probably because I ran the scheduler manually as root for tests before the /opt/otrs/var/run folder had the wrong permissions.

With that OK the OTRS service still has to manually restarted after reboot as it fails to start the otrs.PostMaster.pl .

Code: Select all

service otrs status
Checking for httpd2:                                                                                                                              running
Checking database connection... (Trying to connect to database
DSN: DBI:mysql:database=otrs;host=localhost;
DatabaseUser: otrs

It looks Ok!).
Checking OTRS Scheduler service.... 0
done.
Checking /opt/otrs/bin/otrs.PostMaster.pl ... (not active) failed.
Checking otrs spool dir... done.

Right after a reboot the permissions of otrs.PostMaster.pl are 644 and if I restart the service they'll be set to 755 as defined in the init script.

It seems like the OTRS init script doesn't set the permissions after the reboot. All other cronjobs are also missing, after a service restart they're ok.

Code: Select all

     # --
      # enable otrs.PostMaster.pl
      # --
      echo -n " Enable $OTRS_POSTMASTER ..."
      if chmod 755 $OTRS_POSTMASTER; then
          echo " done."
          rc_status
      else
          echo " failed."
      fi

------------------------------


  stop)
      echo "Shutting down $OTRS_PROG "

      # --
      # disable otrs.PostMaster.pl
      # --
      echo -n " Disable $OTRS_POSTMASTER ..."
      if chmod 644 $OTRS_POSTMASTER; then
          echo " done."
          rc_status
      else
          echo " failed."
      fi
anmol77
Znuny newbie
Posts: 1
Joined: 22 Apr 2016, 09:12
Znuny Version: 512661

Re: scheduler inactive after server restart

Post by anmol77 »

thanks for information ....
Locked