The OTRS Scheduler is an independent system process that executes tasks in background. These kind of processes are know as daemons in Unix / Linux systems or as services on Windows environments. It is independent but that doesn't mean that the Scheduler does everything alone, it is fully integrated into OTRS and can use any OTRS module as needed to complete each task.
For sanity reasons the Scheduler process needs to be restarted from time to time. This is done automatically by the scheduler process itself once a day, but it can be adjusted as needed using the SysConfig by editing the "Scheduler::RestartAfterSeconds" setting.
The OTRS Scheduler is a fully automated process, the only needed human interaction is to check its status periodically and start or stop it as needed.
If the Scheduler is stopped for any reason, all pending tasks and new tasks registered when the Scheduler is stopped will be executed as soon as the Scheduler starts again (unless the tasks are set to be executed in the future).
Планировщик не виден в Графическом Пользовательском Интерфейсе OTRS до того времени пока он остается работать.
There are two different types of notifications if the system detects that the scheduler is not running. This detection is based on the update frequency of the Scheduler process. If the difference between current time and the last process update time is 2 times the process update frequency a warning message will be displayed in the OTRS notification area. If it is over 4 times the process frequency then an alert will be displayed instead.
Параметр Планировщика обновление времени может быть настроен с помощью параметра "Scheduler::PIDUpdateTime" в файле SysConfig.
If you see a warning message it is not always necessary to take an action, but it is highly recommended to check if the scheduler process is running. If you see an alert, then there is a high chance that the scheduler is in fact not running and should be started.
По умолчанию Планировщик не запускает уведомлений, если есть действительный веб-сервис, зарегистрированный в базе данных и он отображается только для пользователей из группы "admin".
Чтобы отключить уведомления (не рекомендуется) или же изменить или добавить группы уведомлений, пожалуйста, отредактируйте настройку "Frontend::NotifyModule###800-Scheduler-Check" в файле SysConfig.
Figure: Уведомления планировщика.
By clicking on the Scheduler not running notification link (either warning or alert) a dialog box will open to let you start the Scheduler process again. The Scheduler can be started normally or forced to start, by clicking on the appropriate check box in the dialog.
A forced Scheduler start is only necessary if previous Scheduler process was terminated abnormally and the Process ID is still registered in the database.
Используйте инструменты командной строки, описанные ниже, чтобы иметь полный контроль над процессами Планировщика и иметь возможность проверить его реальное состояние.
Рисунок: Запуск Планировщика.
Командная строка Планировщика позволяет управлять процессами (Запуск / Остановка) или запрашивать их состояние. Также есть инструменты для регистрации процесса, который будет управлять операционной системой.
Included with OTRS there are two sets of CLI tools, one for Unix / Linux and another for Microsoft Windows.
Init.d files are special scripts that are called by the operating system at startup and shutdown.
OTRS provides init.d scripts to start / stop the OTRS Scheduler process automatically by the operating system. These scripts are located under OTRS_HOME/scripts.
The init.d scripts need to be copied to the correct location for your operating system. They need to have the proper permissions and some internal variables need to be set to work properly. If you used the OTRS RPMs to set up the system, this is taken care of automatically.
Init.d Скрипт Внутренних Переменных
OTRS_HOME - путь установки OTRS.
User - имя пользователя процесса apache.
Group - apache обрабатывает группу пользователей с таким именем.
Currently OTRS provides only init.d scripts for Linux platforms.
Таблица 4.7. List of init scripts and supported Operating Systems
Сценарий инициализации | Поддерживаемы операционные системы |
---|---|
otrs-scheduler-linux | Red Hat, Fedora, CentOS, SUSE, openSUSE, Debian, Ubuntu |
otrs-scheduler-gentoo-init.d, otrs-scheduler-gentoo-conf.d | Gentoo |
Пример 4.29. Example to start the OTRS Scheduler on linux
shell> /etc/init.d/otrs-scheduler-linux start
Возможные действия
start запуск процесса OTRS-Планировщика.
stop остановка процесса OTRS-Планировщика.
restart перезапуск процесса OTRS-Планировщика.
status запросить статус процесса OTRS-Планировщика.
Для корректной работы Планировщика необходима база данных, поскольку он регистрирует свой ID процесса, именно по этой причине необходимо:
Выполните скрипт init.d для запуска процесса Планировщика, после того как запущен процес базы данных.
Execute the Scheduler init.d script to stop the Scheduler before the database process shuts down.
If you want the Scheduler to run at system startup, please read the documentation of the operating system to find out the right location to place the init.d scripts, how to configure them to run automatically and how to set the run order.
Это часть Планировщика, который остается работать в фоновом режиме, проверяя задания, которые нужно выполнить. Она также обеспечивает основные функции для управления процессом.
Все Unix / Linux системы используют файл OTRS_HOME/bin/otrs.Scheduler.pl.
Доступные Опции
-a действие.
Возможные значения
start- старт процесса Планировщика.
stop- остановка процесса Планировщика.
status- для запроса статуса процесса Планировщика.
-f принудительный старт или остановка процесса Планировщика.
Пример 4.31. Example to force stop the OTRS Scheduler
shell> OTRS_HOME/bin/otrs.Scheduler.pl -a stop -f 1
Force stop the Scheduler is used remove the process ID from the database when the scheduler is not running and the process is still registered.
Force start the Scheduler is used to start the Scheduler process if the scheduler is not running and the process is registered.
Force start or stop are only necessary if the start of the process is needed to be done before the process update time expires. Otherwise an expired entry in the database is discarded by normal start.
On Windows, the OTRS Scheduler is registered as a Service via the Windows Service Control Manager (SCM). In order to have the OTRS Scheduler process to be controlled by the SCM is necessary to register this service. If you used the Windows Installer this is taken care of by the installer, and there are no manual actions required.
OTRS предоставляет сценарий OTRS_HOME/bin/otrs.Scheduler4WinInstaller.pl для регистрации и отмены регистрации OTRS-планировщика в SCM.
Registering and de-registering can only be performed by members of the Administrator group on Windows. You might need to right-click on cmd.exe and select 'Run as Administrator' before you can register the service correctly.
Пример 4.32. Example to register the OTRS Scheduler as a Windows Service
shell> perl OTRS_HOME/bin/otrs.Scheduler4WinInstaller.pl -a install
Доступные Опции
-a действие.
Возможные значения
install- для установки процесса Планировщика в Windows SCM.
remove- для удаления процесса Планировщика из Windows SCM.
After installing into the Windows SCM the OTRS Scheduler process can be used like any other service on Windows. It can be started, stopped and restarted and can be configured to be started manually or automatic.
Обратитесь к документации Windows для более подробного изучения Сервисов Windows и Windows SCM.
Это часть Планировщика, который остается работать в фоновом режиме, проверяя задания, которые нужно выполнить. Она также обеспечивает основные функции для управления процессом.
Microsoft Windows uses the file OTRS_HOME/bin/otrs.Scheduler4Win.pl.
Пример 4.33. Example to start the OTRS Scheduler on Windows
shell> OTRS_HOME/bin/otrs.Scheduler4Win.pl -a start
Доступные Опции
-a действие.
Возможные значения
start- старт процесса Планировщика.
stop- остановка процесса Планировщика.
status- для запроса статуса процесса Планировщика.
-f принудительный старт или остановка процесса Планировщика.
Пример 4.34. Example to force stop the OTRS Scheduler on Windows
shell> OTRS_HOME/bin/otrs.Scheduler4Win.pl -a stop -f 1
Force stopping the Scheduler is used to remove the process ID from the database when the scheduler is not running and the process is still registered.
Force starting the Scheduler is used to start the Scheduler process if the scheduler is not running and the process is still registered.
Force start or stop are only necessary if starting the process is needed to be done before the process update time expires. Otherwise an expired entry in the database would be discarded by a normal start.