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.
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}/uCPSB11/CC/server/bin/cjstartsv | grep -v grep | wc -l` hcs_hsso_counter=`ps -ef | \ grep \ ${HCMDS_HOME}/uCPSB11/CC/server/repository/HBase64StgMgmtSSOService/hcs_hsso | \ grep -v grep | wc -l` httpsd_counter=`ps -ef | \ grep ${HCMDS_HOME}/uCPSB11/httpsd/sbin/httpsd | grep -v grep | wc -l` rotatelogs_counter=`ps -ef | \ grep ${HCMDS_HOME}/uCPSB11/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)
Correction is required depending on how the existing environment is set up.
-
If it has already been built by the setting method of case 1:
If the script file "ao_start_check" mentioned in case 1 contains "/uCPSB/", correct it to "/uCPSB11/".
-
If it has not been built by the setting method of case 1:
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
-