2.9 Settings for automatically starting JP1/AO when the OS starts (in Linux)
If the OS of the JP1/AO server is Linux, with the initial settings, the JP1/AO service is not automatically started when the OS starts.
For the JP1/AO service to start automatically when the OS starts, perform one of the following methods.
For Linux 8, use the method in CASE1. Also, replace uCPSB that is included in the path specified in the script file with uCPSB11.
CASE1: Set a new environment to use systemd (such as Red Hat Enterprise Linux 7)
- Setting method
- Create a Unit file of the automatic startup script for
the JP1/AO service.
Storage location: /usr/lib/systemd/system
File name: JP1_AO.service
If the file name is different, replace the part of "JP1_AO.service" in the following description.
The number on the left are line number. Line without line number are continued from the line above.
1 [Unit] 2 Description=JP1/AO service 3 After=2248-PD01.service hicommand64-hcs_hweb.service hicommand64-hcs_hsso.ser vice hicommand64-hcs_web.service hicommand64-hcs_ao.service 4 Requires=2248-PD01.service hicommand64-hcs_hweb.service hicommand64-hcs_hsso. service hicommand64-hcs_web.service hicommand64-hcs_ao.service 5 6 [Service] 7 Type=forking 8 Environment="LANG=ja_JP.utf8" 9 ExecStartPre=/home/jp1ao/ao_start_check 10 ExecStart=/opt/HiCommand/Base64/bin/hcmds64srv -start -server AutomationWebSe rvice 11 TimeoutStartSec= 600 12 13 [Install] 14 WantedBy=multi-user.target graphical.target
-
Execute the following command to set up the attributes.
chmod 644 /usr/lib/systemd/system/JP1_AO.service
chgrp root /usr/lib/systemd/system/JP1_AO.service
chown root /usr/lib/systemd/system/JP1_AO.service
-
Create a script file specified in the ExecStartPre option.
/home/jp1ao/ao_start_check
#!/bin/sh HCMDS_HOME=/opt/HiCommand/Base64 for i in `seq 1 10` do cjstartsv_counter=`ps -ef | \ grep ${HCMDS_HOME}/uCPSB/CC/server/bin/cjstartsv | grep -v grep | wc -l` hcs_hsso_counter=`ps -ef | \ grep \ ${HCMDS_HOME}/uCPSB/CC/server/repository/HBase64StgMgmtSSOService/hcs_hsso | \ grep -v grep | wc -l` httpsd_counter=`ps -ef | \ grep ${HCMDS_HOME}/uCPSB/httpsd/sbin/httpsd | grep -v grep | wc -l` rotatelogs_counter=`ps -ef | \ grep ${HCMDS_HOME}/uCPSB/httpsd/sbin/rotatelogs | grep -v grep | wc -l` pdprcd_counter=`ps -ef | \ grep ${HCMDS_HOME}/HDB/lib/servers/pdprcd | grep -v grep | wc -l` pdmlgd_counter=`ps -ef | \ grep ${HCMDS_HOME}/HDB/lib/servers/pdmlgd | grep -v grep | wc -l` pdrdmd_counter=`ps -ef | \ grep ${HCMDS_HOME}/HDB/lib/servers/pdrdmd | grep -v grep | wc -l` sleep 60 if [ $cjstartsv_counter -ge 1 -a \ $hcs_hsso_counter -ge 1 -a \ $httpsd_counter -ge 22 -a \ $rotatelogs_counter -ge 4 -a \ $pdprcd_counter -ge 1 -a \ $pdmlgd_counter -ge 1 -a \ $pdrdmd_counter -ge 1 ]; then exit 0 fi done exit 1
-
Execute the following command to set the attributes.
chmod 554 /home/jp1ao/ao_start_check
chgrp root /home/jp1ao/ao_start_check
chown root /home/jp1ao/ao_start_check
-
Execute the following command to enable automatic startup of the JP1/AO service.
systemctl daemon-reload
systemctl enable JP1_AO.service
-
Execute the following command and confirm that "enabled" is displayed.
systemctl list-unit-files | grep "UNIT FILE\|JP1_AO.service"
- Create a Unit file of the automatic startup script for
the JP1/AO service.
- Release method
-
If JP1/AO is running, execute the following command to stop JP1/AO.
/opt/HiCommand/Base64/bin/hcmds64srv -stop
-
Execute the following command to disable automatic startup for the JP1/AO service.
systemctl disable JP1_AO.service
-
Execute the following command and check that "disabled" is displayed.
systemctl list-unit-files | grep "UNIT FILE\|JP1_AO.service"
-
Execute the following command to delete the Unit file for the JP1/AO service.
rm -i /usr/lib/systemd/system/JP1_AO.service
Execute the following command to delete the script file.
rm -i /home/jp1ao/ao_start_check
-
CASE2: Already configured in an environment that uses systemd (such as Red Hat Enterprise Linux 7)
If automatic startup has already been set up in the existing environment using the following method and there is no problem, there is no need to change the setting.
If automatic startup fails using the following method, cancel the following settings and then perform the setting method for CASE1.
-
Setting method
-
Create a Unit file of the automatic startup script for the JP1/AO service.
Storage location: /etc/systemd/system
File name: JP1_AO.service
If the file name is different, replace the part of "JP1_AO.service" in the following description.
[Unit] Description=JP1/AO service [Service] Type=forking Environment="LANG=ja_JP.utf8" ExecStart=/opt/HiCommand/Base64/bin/hcmds64srv -start -server AutomationWebService [Install] WantedBy=multi-user.target graphical.target
-
Execute the following command to set up the attributes.
chmod 644 /etc/systemd/system/JP1_AO.service
chgrp root /etc/systemd/system/JP1_AO.service
chown root /etc/systemd/system/JP1_AO.service
-
Execute the following command to enable automatic startup for the JP1/AO service.
systemctl daemon-reload
systemctl enable JP1_AO.service
-
Execute the following command and check that "enabled" is displayed.
systemctl list-unit-files | grep "UNIT FILE\|JP1_AO.service"
-
-
Release method
-
If JP1/AO is running, execute the following command to stop JP1/AO.
/opt/HiCommand/Base64/bin/hcmds64srv -stop
-
Execute the following command to disable automatic startup for the JP1/AO service.
systemctl disable JP1_AO.service
-
Execute the following command and check that "disabled" is displayed.
systemctl list-unit-files | grep "UNIT FILE\|JP1_AO.service"
-
Execute the following command to delete the Unit file for the JP1/AO service.
rm -i /etc/systemd/system/JP1_AO.service
-
CASE3: Environments that use automatic startup scripts (such as Red Hat Enterprise Linux 6)
- Setting method
In the startup script of the OS, specify the value that is set in the LANG environment variable and specify a setting that executes the hcmds64srv command.
Because the services of the common component are set to start automatically at OS startup, you must specify "AutomationWebService" as the server option so that only the JP1/AO service will be started.
When only the JP1/AO service is started with the server option specified, it is necessary to start the common component and database services beforehand. Therefore, it is necessary to check to see whether the JP1/AO service is started after checking the existence of common component and database process.
When the OS is stopped, the JP1/AO service and the services of the common component are set to automatically stop, so you do not need to set automatic stop.
Example:
#!/bin/sh # chkconfig: 2345 99 01 # description: JP1/Automatic Operation PROG_NAME=startao start() { /home/jp1ao/startao2 & } case "$1" in start) start ;; *) echo "Usage: ${PROG_NAME} start" exit 1 esac exit 0
/home/jp1ao/startao2#!/bin/sh HCMDS_HOME=/opt/HiCommand/Base64 start() { export LANG=ja_JP.utf8 ${HCMDS_HOME}/bin/hcmds64srv -start -server AutomationWebService rtn_code=$? logger -i -s -t [AUTOMATION] \ "${HCMDS_HOME}/bin/hcmds64srv -start -server AutomationWebService[${rtn_code}]" } for i in `seq 1 10` do cjstartsv_counter=`ps -ef | \ grep ${HCMDS_HOME}/uCPSB/CC/server/bin/cjstartsv | grep -v grep | wc -l` hcs_hsso_counter=`ps -ef | \ grep \ ${HCMDS_HOME}/uCPSB/CC/server/repository/HBase64StgMgmtSSOService/hcs_hsso | \ grep -v grep | wc -l` httpsd_counter=`ps -ef | \ grep ${HCMDS_HOME}/uCPSB/httpsd/sbin/httpsd | grep -v grep | wc -l` rotatelogs_counter=`ps -ef | \ grep ${HCMDS_HOME}/uCPSB/httpsd/sbin/rotatelogs | grep -v grep | wc -l` pdprcd_counter=`ps -ef | \ grep ${HCMDS_HOME}/HDB/lib/servers/pdprcd | grep -v grep | wc -l` pdmlgd_counter=`ps -ef | \ grep ${HCMDS_HOME}/HDB/lib/servers/pdmlgd | grep -v grep | wc -l` pdrdmd_counter=`ps -ef | \ grep ${HCMDS_HOME}/HDB/lib/servers/pdrdmd | grep -v grep | wc -l` sleep 60 if [ $cjstartsv_counter -ge 1 -a \ $hcs_hsso_counter -ge 1 -a \ $httpsd_counter -ge 22 -a \ $rotatelogs_counter -ge 4 -a \ $pdprcd_counter -ge 1 -a \ $pdmlgd_counter -ge 1 -a \ $pdrdmd_counter -ge 1 ]; then start exit 0 fi done logger -i -s -t [AUTOMATION] "Common Component seems to be dead." exit 1
- Release method
-
If JP1/AO is running, execute the following command to stop JP1/AO.
/opt/HiCommand/Base64/bin/hcmds64srv -stop
- Delete the created startup script.
Execute the following command to delete the script file.
rm -i /home/jp1ao/startao2
-