Require autostart Linux scripts for HCL Connections 6.5 services | RHEL 7

Hello,

I have HCL Connections 6.5 installed on Linux - RHEL 7.8. I want to create a service in Linux that will restart all of WebSphere when we reboot our server.

I want the deployment manager, nodeagent, Connections server, IHS service and db2services to restart.

Please do assist. Thank you in advance.

Hi Elango Gopal ,

You can refer to below link and see if it is helpful

https://www.ibm.com/mysupport/s/question/0D50z000062koOpCAI/how-do-i-create-linux-services-for-websphere-application-servers?language=en_US

Regards

Hi

You can look here for WebSphere sample scripts: https://ranierimazili.wordpress.com/2016/11/18/starting-websphere-as-a-systemd-service/

Using this approach I've set up Dmgr and nodeagents to start automatically and for the application servers I used the Monitoring policy settings in IBM Solutions Console

Hi Anatoly, Thanks for the response. Yes, I have done this for node agent and DMGR, it works.

Setup the monitoring policy setting, the application server will start automatically when nodeagent is in running state.

However, will the Application server stop automatically when we reboot the Linux OS without stopping Application server? Will monitoring policy setting do the job...

Thanks.

Yes, the nodeagent will start the app servers with monitoring policy set to RUNNING

Hi Anatoly, Thanks for your response. Yes, nodeagent will start the app servers when Linux OS booting up but what about stopping WAS server automatically? will this monitoring policy help to stop the WAS server when shutdown the Linux OS.

Thank you.

For DB2 you can follow this guide

https://www.ibm.com/support/pages/db2-autostart-not-supported-red-hat-enterprise-linux-version-7

And this one for IHS

https://www.ibm.com/support/pages/how-configure-ibm-http-server-autostart-linux

I developed some Shell scripts which start / stop the whole Connections WebSphere Infrastructure:

https://github.com/becketalservices/WebSphere_scripts

Hi Martin, Thanks for your response. I want to write the script that the server has to start after nodeagent is started. Can you please help on that.

Hi, the scripts (startInfrastructure.sh / stopInfrastructure.sh) take care about the right start / stop order.

to start:

1) Start Dmgr if it is on the system

2) Start all node agents on the system

3) Start all Application servers on the system.

to stop:

1) Stop all Application servers on the system and wait until they are down

2) Stop all node agents on the system

3) Stop dmgr if it is found on the system

So you just need to add 1 service that takes care about everything, independent of the number of node agents and application servers on the system.

Thank you so much for your kind response.

Hello Martin, Can you please me to the auto startup script for DB2 as well. And where did you mentioned in the WAS script that it should start after DB2 gets started?

Hi,

the dependency is configured in the websphere.service description.

The 2 file are placed in the directory /etc/systemd/system and then added as service to the multi-user.target.wants directory. I don't know the correct command now.

You need to adapt the service descriptions to your needs. e.g. run as root.

db2fmcd.service.txtwebsphere.service.txt

Hello Martin, I have installed WAS and Connections using root user, not created any non-root user.

I need your help that how to stop using root user and how to pass the password while stop the script. Please refer the below output. Thanks.

[root@connections startup]# ls
startAllNodes.sh startAllServer.sh startInfrastructure.sh stopAllNodes.sh stopAllServer.sh stopInfrastructure.sh

[root@connections startup]# ./stopInfrastructure.sh
ERROR: Script must not be executed as root.

[root@connections startup]# ./stopAllServer.sh
Profile: /local/connections/IBM/WebSphere/AppServer/profiles/Dmgr01
Profile: /local/connections/IBM/WebSphere/AppServer/profiles/AppSrv01
Process with PID is running. Need to stop
Stop Server /local/connections/IBM/WebSphere/AppServer/profiles/AppSrv01 - ICCluster_server1
ADMU0116I: Tool information is being logged in file
/local/connections/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/ICCluster_server1/stopServer.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU3100I: Reading configuration for server: ICCluster_server1
Realm/Cell Name: <default>
Username:

Regarding the startInfrastructure.sh and stopInfrastrucuture.sh scripts. Remove this 4 lines from the script which prevent the start as root:

if [ "$EUID" == "0" ]; then
echo "ERROR: Script must not be executed as root."
exit 1
fi

!!! All scripts contain the installation path of the WAS Server. You may need to adapt this path. !!!

Regarding the stop - missing password.

The username and password is configured in the soap.client.props found in <WASProfile>/properties/ direcotry of all profiles.
The configured attributes are

com.ibm.SOAP.loginUserid=
com.ibm.SOAP.loginPassword=


To encrypt the password, use the tool PropFilePasswordEncoder.sh found in the bin directory of each profile.

Thank you so much martin, yes it does work now.

Can you please share db2auto start script DB2 11.1. I tried many scripts but it doesn't work in DB2 11.1.

Hi Martin, Kindly correct to /etc/systemd/system instead of /opt/systemd/system in the readme file. Thank you.

  1. download the websphere.service file from the unit folder into /opt/systemd/system

You could adapt these calls to wasservice.sh:

/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/bin/wasservice.sh   -add "IC01_DM"            -serverName dmgr                  -profilePath "/opt/IBM/WebSphere/AppServer/profiles/Dmgr01"   -wasHome "/opt/IBM/WebSphere/AppServer"
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/wasservice.sh -add "IC02_NA"            -serverName nodeagent             -profilePath "/opt/IBM/WebSphere/AppServer/profiles/AppSrv01" -wasHome "/opt/IBM/WebSphere/AppServer"
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/wasservice.sh -add "IC03_ICCluster"     -serverName ICCluster_server1     -profilePath "/opt/IBM/WebSphere/AppServer/profiles/AppSrv01" -wasHome "/opt/IBM/WebSphere/AppServer"
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/wasservice.sh -add "IC04_IBMViewer"     -serverName IBMViewerMember1      -profilePath "/opt/IBM/WebSphere/AppServer/profiles/AppSrv01" -wasHome "/opt/IBM/WebSphere/AppServer"
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/wasservice.sh -add "IC05_IBMDocsProxy"  -serverName IBMDocsProxyMember1   -profilePath "/opt/IBM/WebSphere/AppServer/profiles/AppSrv01" -wasHome "/opt/IBM/WebSphere/AppServer"
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/wasservice.sh -add "IC06_IBMDocs"       -serverName IBMDocsMember1        -profilePath "/opt/IBM/WebSphere/AppServer/profiles/AppSrv01" -wasHome "/opt/IBM/WebSphere/AppServer"
/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/wasservice.sh -add "IC07_IBMConversion" -serverName IBMConversionMember01 -profilePath "/opt/IBM/WebSphere/AppServer/profiles/AppSrv01" -wasHome "/opt/IBM/WebSphere/AppServer"

If you don't have configured wasadmin username and password in soap.client.properties, you have to append them to each row:

-stopArgs "-username wasadmin -password *******"

Then you can start/stop the services using these commands directly:

service IC01_DM_was.init             start
service IC02_NA_was.init             start
service IC03_ICCluster_was.init      start
service IC04_IBMViewer_was.init      start
service IC05_IBMDocsProxy_was.init   start
service IC06_IBMDocs_was.init        start
service IC07_IBMConversion_was.init  start
service IC08_IHS.init                start

service IC01_DM_was.init restart
service IC02_NA_was.init restart
service IC03_ICCluster_was.init restart
service IC04_IBMViewer_was.init restart
service IC05_IBMDocsProxy_was.init restart
service IC06_IBMDocs_was.init restart
service IC07_IBMConversion_was.init restart
service IC08_IHS.init restart

service IC08_IHS.init stop
service IC07_IBMConversion_was.init stop
service IC06_IBMDocs_was.init stop
service IC05_IBMDocsProxy_was.init stop
service IC04_IBMViewer_was.init stop
service IC03_ICCluster_was.init stop
service IC02_NA_was.init stop
service IC01_DM_was.init stop

For stopping DB2 you can call (as root):

sudo -i -u db2inst1 db2stop

Hi Thomas, Thanks for your response.

In this script, where did you mentioned that server have to start after nodeagent started. I am talking about the dependency service, meaning that nodeagent should get started before the server start.

I'm not sure, but I think that init.d calls this scripts in the same runlevel in alphabetical order - that's why I named them this way. At least, it seams to work for us. ;-)