The Scheduler command line tools let you control the Scheduler process (Start / Stop) or query it status. There are also tools to register the process to be controlled by the operating system.
Included with OTRS there are two set of CLI tools, one for Unix / Linux OS and another for MS Windows OS.
Init.d files are special scripts that are called by the operating system at startup and shutdown (or restart) times.
OTRS provide init.d scripts to start / stop the OTRS Scheduler process automatically by the operating system, this scripts are located under OTRS_HOME/scripts.
Init.d scripts needs to be copied to the correct location for your operating system, they need to had the proper permissions and some internal variables needs to be set to work properly.
Init.d Script Internal Variables
OTRS_HOME - the path of your OTRS installation.
User - the apache process user name.
Group - the apache process user's group name.
Currently there are only init.d scripts for Linux platforms.
Table 21.1. List of Init Scripts And Supported Operating Systems
Init Script | Supported OS |
---|---|
otrs-scheduler-linux | Red Hat, Fedora, CentOS, SUSE, openSUSE, Debian, Ubuntu |
otrs-scheduler-gentoo-init.d, otrs-scheduler-gentoo-conf.d | Gentoo |
Example 21.1. Example To Start The OTRS Scheduler Form An Init.d Script
shell> /etc/init.d/otrs-scheduler-linux start
Available Actions
start to start the OTRS Scheduler process.
stop to stop the OTRS Scheduler process.
restart to restart the OTRS Scheduler process.
status to query the OTRS Scheduler process status.
The Scheduler needs the database to be available to register its Process ID, for this reason is necessary to:
Execute the Scheduler init.d script to start the Scheduler process after the database process is up and running.
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 for the right location to place the init.d scripts, how to configure them to run automatically and how to set the run order.
This is the part of the Scheduler that stays running in the background checking for tasks to execute. It also provides the main functions to control the process.
All Unix / Linux uses the file OTRS_HOME/bin/otrs.Scheduler.pl.
Available Options
-a action.
Possible Values
start- to start the Scheduler process.
stop- to stop the Scheduler process.
status- to query Scheduler process status.
-f to force the start or stop of the Scheduler process.
Example 21.3. 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 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.
The integration of the services into the MS Windows Operating System is done via the Windows Service Control Manager (SCM). In order to make the OTRS Scheduler process to be controlled by the SCM is necessary to register this service
OTRS provides the script OTRS_HOME/bin/otrs.Scheduler4WinInstaller.pl to register or unregister the OTRS Scheduler into the SCM.
Example 21.4. Example To Register The OTRS Scheduler Into the Widows SCM
shell> OTRS_HOME/bin/otrs.Scheduler4WinInstaller.pl -a install
Available Options
-a action.
Possible Values
install- to install the Scheduler process into the Windows SCM.
remove- to remove the Scheduler process from the Windows SCM.
After installing into the Widows SCM the OTRS Scheduler process can be used as any other service in Windows. It can be started, stopped and restarted and can be configured to be started manually or automatic.
To learn more about Windows Services and the Windows SCM please read the Windows documentation, and Microsoft online help.
This is the part of the Scheduler that stays running in the background checking for tasks to execute. It also provides the main functions to control the process.
Windows Operating System uses the file OTRS_HOME/bin/otrs.Scheduler4Win.pl.
Example 21.5. Example To Start The OTRS Scheduler
shell> OTRS_HOME/bin/otrs.Scheduler4Win.pl -a start
Available Options
-a action.
Possible Values
start- to start the Scheduler process.
stop- to stop the Scheduler process.
status- to query Scheduler process status.
-f to force the start or stop of the Scheduler process.
Example 21.6. Example To Force Stop The OTRS Scheduler
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 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.