Appreciations accepted

Vladlen Litvinov, the author: If you have some job offer for me, I'm ready to discuss it. View Vladlen Litvinov's profile on LinkedIn

Password

Friday, December 14, 2012

How to create the service for BPM (or another WAS profile) in Red Hat EL?

You have already installed your BPM environment and you need to start and stop it with OS.
Or you don’t like to use startServer command every time.
RHEL (or Centos, Fedora) permits to use services for these actions.

Surely, the standart installation creates this service but it is better to create it yourself.

Let's your BPM Home is /opt/IBM/BPM8/

Then:

1. [ibmuser@bpmtest ffdc]# sudo su
2. [root@bpmtest ffdc]# vi /etc/init.d/bpmd
Press Insert Key
Copy-Paste this script:

#!/bin/sh
# chkconfig: 2345 99 10
# description: Run IBM BPM

TW_HOME=/opt/IBM/BPM8

case "$1" in
    start)
        $TW_HOME/profiles/ProcCtr01/bin/startServer.sh server1
 ;;
    stop)
        $TW_HOME/profiles/ProcCtr01/bin/stopServer.sh server1
 ;;
    restart)
 $0 stop
 sleep 10
 $0 start
 ;;
    *)
 echo $"Usage: $0 {start|stop|restart}"
 exit 1

esac
exit $script_result

Press Esc, Shift-q, w,q, Enter

3. [root@bpmtest ffdc]# chmod +x /etc/init.d/bpmd
4. [root@bpmtest ffdc]# chkconfig --add bpmd

5. [root@bpmtest ffdc]# vi /opt/IBM/BPM8/profiles/ProcCtr01/properties/soap.client.props
Press Insert Key
Add administrator's login and password

#------------------------------------------------------------------------------
# - authenticationTarget ( BasicAuth[default], KRB5. These are the only supported selection
# on a pure client for JMX SOAP Connector Client. )
#------------------------------------------------------------------------------

com.ibm.SOAP.authenticationTarget=BasicAuth
com.ibm.SOAP.loginUserid=admin
com.ibm.SOAP.loginPassword=admin

Press Esc, Shift-q, w,q, Enter

6. [root@bpmtest ffdc]# /opt/IBM/BPM8/bin/PropFilePasswordEncoder.sh
/opt/IBM/BPM8/profiles/ProcCtr01/properties/soap.client.props com.ibm.SOAP.loginPassword

Check that the password is encrypted:

#------------------------------------------------------------------------------
# - authenticationTarget ( BasicAuth[default], KRB5. These are the only supported selection
# on a pure client for JMX SOAP Connector Client. )
#------------------------------------------------------------------------------

com.ibm.SOAP.authenticationTarget=BasicAuth
com.ibm.SOAP.loginUserid=admin
com.ibm.SOAP.loginPassword={xor}PjsyNjE=

7. Now you can use the service:

service bpmd start
service bpmd stop
service bpmd restart

But if you use not-root installation (and it is right!), correct the script:


#!/bin/sh
# chkconfig: 2345 99 10
# description: Run IBM BPM


TW_HOME=/opt/IBM/BPM8
IBM_OWNER=ibmuser
 
case "$1" in
start)
        su - $IBM_OWNER -c "/$TW_HOME/profiles/ProcCtr01/bin/startServer.sh server1"
;;
stop)
        su - $IBM_OWNER -c "/$TW_HOME/profiles/ProcCtr01/bin/stopServer.sh server1"
;;
restart)
$0 stop
sleep 10
$0 start
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1

esac
exit $script_result

This case you can use the service as:

sudo service bpmd start
sudo service bpmd stop
sudo service bpmd restart

No comments:

Post a Comment