Asponte Labs > Blog Detail

Web Content Viewer- Asponte Custom Skin


Managing WebSphere Portal using systemd

  • Created By: Ryan Mullett
  • Updated: January 27, 2017
  • Tags: portal, websphere


Anyone who has done admin work on a Linux system in the past few years knows that for 99% of installs today you will be using an OS that has replaced the traditional init system with systemd. While this can allow for more control in some instances, it is also more work to get up and running than just dropping an init script for startup procedures on a server. This leaves us having to not only write a startup script, but to also create a service in order to go the officially supported route and startup the way that RedHat and many others recommend. While systemd is technically backwards compatible with init scripts, systemd does not observe numbering of the scripts which can lead to dependency issues and failed script startups (not something we are looking to touch for our Portal!).


The Script

For this blog, I am using the same setup I had for my post on changing the portal hostname of a contained cluster. This mean I have a seld-contained cluster all on the same host with DB2/DMGR/IHS/Portal all on the same system. The script will likely need to be modified to fit into a new environment, and I have had to make small tweaks here and there removing and adding sections based on what I am running on a system. This script should be dropped in /usr/local/sbin/ and the PASSWORD variable unfortunately will need to be changed to your password for your WAS environment. Running the script will require you to pass in start/stop/restart depending on what you want to do.

#! /bin/bash

start() {

#start db2 instances
for i in `/opt/ibm/db2/V10.5/bin/db2ilist`;
 su - $i -c "db2start"

"${PORTAL_HOME}/bin/" WebSphere_Portal

#Start IHS Instance
/opt/IBM/HTTPServer/bin/apachectl -k start

stop() {
#stop IHS Instance
/opt/IBM/HTTPServer/bin/apachectl -k stop

"${WAS_HOME}/profiles/${WAS_PROFILE_NAME}/bin/" -username $USERNAME -password $PASSWORD
"${PORTAL_HOME}/bin/" WebSphere_Portal -username $USERNAME -password $PASSWORD
"${PORTAL_HOME}/bin/" -username $USERNAME -password $PASSWORD

#stop db2 instances
for i in `/opt/ibm/db2/V10.5/bin/db2ilist`;

 su - $i -c "db2stop"



#restart IHS/DB2/DMGR/Portal

case $1 in
        start|stop|restart) "$1" ;;

The Service

Once you have confirmed that your script is able to start/stop/restart your portal environment, you can move onto creating the actual Daemon that will control portal. We want to put this file in /etc/systemd/system/websphere.service.

Description=IBM Portal Cluster
ExecStart=/usr/local/sbin/ start
ExecStop=/usr/local/sbin/ stop
ExecReload=/usr/local/sbin/ restart

Once you have this setup, you can control WebSphere using systemctl start websphere. If you want to run Portal at startup you can utilize systemctl enable websphere which will automatically run the websphere.service at startup and start your WebSphere service.

Call Us 888-926-9434
Complementary Content