Tigase脚本选择配置开机启动 第3章 ---7.1.2版本
Tigase Script Selection
As mentioned in each of the quick start sections, each distribution of Tigase XMPP server comes with a number of scripts that are customized for different versions of Linux.
Table 3.1. init.d chart
Operating system | init.d file path | Types of Operating Systems |
---|---|---|
Debian |
| Knoppix, Ubuntu (before v15.04), Raspbian or Duvian |
Gentoo |
| CoreOS (before v94.0.0), Tin Hat Linux or other *too based systems |
Mandriva |
| Specific init.d file for Mandriva Linux |
Redhat |
| RedHat (before v7.0) and other RPM based linux derivatives like CentOS (before v.7.14), openSUSE (before v12.2) |
Once you’ve located the appropriate distribution scripts (please take a look at the table above), copy it to your system’s init.d folder (usually it’s /etc/init.d/
):
sudo cp $SCRIPT_FILE_PATH /etc/init.d/tigase
You may also need to make it executable:
sudo chmod +x /etc/init.d/tigase
It is recommended that you open the script files or configuration files as some have some parameters that you will need to specify.
The conf.d script must contain the following parameters:
TIGASE_HOME="/home/tigase/tigase-server" TIGASE_USER=tigase TIGASE_CONF="etc/tigase.conf"
The following should be configured:
TIGASE_HOME
- Specifies the Tigase Server installation directory.TIGASE_USER
- Specifies the user that will run the program. This should be a user with SU permissions.TIGASE_CONF
- The location of tigase.conf file, relative to theTIGASE_HOME
directory.
Mandriva has a single init.d file, however it should be configured:
… export JAVA_HOME=/usr/java/jdk1.8.0 export TIGASE_DIR=/opt/tigase/server/ tigase=$TIGASE_DIR/scripts/tigase.sh prog=tigase config=$TIGASE_DIR/etc/tigase.conf …
The following should be configured:
JAVA_HOME
- The location of your JDK Installation.TIGASE_DIR
- Tigase Server installation directory.tigase
- The location of your tigase.sh script. This should not need adjusting if you maintain the default file structure.config
- The location of your tigase.conf file. This should not need adjusting if you maintain the default file structure.
pid
file will be stored in /var/run/ser.pid
Similar to Mandriva, you will need to configure the init.d file:
… JAVA_HOME=/usr/lib/jvm/java/ USERNAME=tigase USERGROUP=tigase NAME=tigase DESC="Tigase XMPP server" TIGASE_HOME=/home/tigase/tigase-server TIGASE_LIB=${TIGASE_HOME}/jars TIGASE_CONFIG=/etc/tigase.conf TIGASE_OPTIONS= TIGASE_PARAMS= PIDFILE= TIGASE_CONSOLE_LOG= …
USERNAME
- Username running Tigase, should have su permissions.USERGROUP
- The usergroup of the username.NAME
- OS name for Tigase program.DESC
- Optional description.TIGASE_HOME
- The location of your Tigase Server installation directory.TIGASE_LIB
- The location of your Tigase Jars folder, you should not need to adjust this if you setTIGASE_HOME
properly, and maintain the default file structure.TIGASE_CONFIG
- The location of your tigase.conf file relative toTIGASE_HOME
TIGASE_OPTIONS
- Legacy options for Tigase, most are now handled in init.properties or tigase.conf.TIGASE_PARAMS
- Parameters passed to command line when launching Tigase.PIDFILE
- Location of Tigase PID file if you wish to use custom directory. Default will be located in /logs or /var/temp directory.TIGASE_CONSOLE_LOG
- Location of Tigase Server console log file if you wish to use a custom directory. Default will be located in /logs directory, failing that /dev/null.
After you’ve copied the script, in order to install sysinit script you have to add it to the configuration:
/sbin/chkconfig --add tigase
Service can be enabled or disabled service with:
/sbin/chkconfig tigase <on|off|reset>
As with other distributions you should copy init.d script to the correct location. Afterwards it should be edited and correct values for variables need to be set:
… USERNAME=tigase USERGROUP=tigase NAME=tigase DESC="Tigase XMPP server" TIGASE_HOME=/usr/share/tigase TIGASE_CONFIG=/etc/tigase/tigase.config TIGASE_OPTIONS= TIGASE_PARAMS= PIDFILE= TIGASE_CONSOLE_LOG= …
USERNAME
- Username running Tigase, should have su permissions.USERGROUP
- The usergroup of the username.NAME
- OS name for Tigase program.DESC
- Optional description.TIGASE_HOME
- The location of your Tigase Server installation directory.TIGASE_CONFIG
- The location of your tigase-server.xml file relative (old configuration format)TIGASE_OPTIONS
- command line arguments passed to Tigase server (which may include path toinit.properies
(if correcttigase.conf
configuration will be found then it will translate toTIGASE_OPTIONS=" --property-file etc/init.properties "
TIGASE_PARAMS
- Parameters passed to command line when launching Tigase.PIDFILE
- Location of Tigase PID file if you wish to use custom directory. Default will be located in/var/run/tigase/tigase.pid
or under (in this case relative to tigase home directory)logs/tigase.pid
.TIGASE_CONSOLE_LOG
- Location of Tigase Server console log file if you wish to use a custom directory. Default will be located in /logs directory, failing that /dev/null.
Afterwards we need to install service in the system with following command:
update-rc.d tigase defaults
There are a number of benefits to running Tigase as a service, one of which is to ensure that the program will run even in the event of a power outage or accidental server restart, Tigase will always be up and running.
Once installation is complete, you should be able to start Tigase using the following command:
service tigase start
Tigase should begin running in the background. Since Tigase is now installed as a service, it can be controlled with any of the service commands, such as:
service tigase stop
service tigase restart
标签:
上一篇: 第5章配置 目录列表 ---7.1.2版本
下一篇: Tigase服务器网络说明 第3章快速入门指南 -- 7.1.2版本