Identity Access Manager service termination in DEVTEST 10.4 on Linux and MAC

Document ID : KB000117457
Last Modified Date : 12/10/2018
Show Technical Document Details
Introduction:
When stopping IAM,  the jboss-modules are not stopped even after IdentityAccessManager service is stopped. it has to be stopped manually.


$ sudo sh ../IdentityAccessManager/bin/IdentityAccessManagerService status 
IdentityAccessManagerService is stopped. 

$ ps -ef|grep DevTest|grep -v grep 
root 74252 74198 0 Oct03 ? 00:03:22 ../../jre/bin/java -D[Standalone] -server -Djboss.http.port=51112 -Djboss.https.port=51111 -Djboss.bind.address.management=0.0.0.0 -Djboss.bind.address=0.0.0.0 -Diam.truststore=../iam-truststore.ks -Diam.truststore.pass=passphrase -Dkeycloak.migration.action=import -Dkeycloak.migration.provider=iam-updater -Dkeycloak.migration.dir=../realms-to-import -Dkeycloak.migration.strategy=IGNORE_EXISTING -Diam.version=1.2.0 -Dorg.jboss.boot.log.file=/vol_01/apps_01/webapps/CA/DevTest/IdentityAccessManager/standalone/log/server.log -Dlogging.configuration=file:/vol_01/apps_01/webapps/CA/DevTest/IdentityAccessManager/standalone/configuration/logging.properties -jar /vol_01/apps_01/webapps/CA/DevTest/IdentityAccessManager/jboss-modules.jar -mp /vol_01/apps_01/webapps/CA/DevTest/IdentityAccessManager/modules org.jboss.as.standalone -Djboss.home.dir=/vol_01/apps_01/webapps/CA/DevTest/IdentityAccessManager -Djboss.server.base.dir=/vol_01/apps_01/webapps/CA/DevTest/IdentityAccessManager/standalone
Environment:
DevTest 10.4
Instructions:
Whenever we start Identity Access Manager Service, all the associated child processes will be automatically started. But when we stop the IAM service it is directly stoping the parent service without stoping all the associated child processes. As a result IAM could not stop successfully. 
To fix this permanently we need to do changes at installer level, which can't be done as part of this fix at this point of time but can be done in the next release. 


As a Workaround for now, you can do the following changes to <DEV_TEST_HOME>/IdentityAccessManager/bin/IdentityAccessManagerService.sh: 


Steps to Follow: 
*********** 
1. Open dentityAccessManagerService.sh in an text editor 
2. Look for the section - STOP 



;; 
stop) 
echo "Shutting down IdentityAccessManagerService" 


Comment below line by adding # as a starting character

#$INSTALL4J_JAVA_PREFIX "$app_java_home/bin/java" -Dinstall4j.jvmDir="$app_java_home" -Dexe4j.moduleName="$prg_dir/$progname" -classpath "$local_classpath" com.install4j.runtime.launcher.UnixLauncher stop 

Then Add the below line : 
$prg_dir/jboss-cli.sh --connect command=:shutdown > /dev/null 2>&1 & 


So your script should look like: 


stop) 
echo "Shutting down IdentityAccessManagerService" 

#$INSTALL4J_JAVA_PREFIX "$app_java_home/bin/java" -Dinstall4j.jvmDir="$app_java_home" -Dexe4j.moduleName="$prg_dir/$progname" -classpath "$local_classpath" com.install4j.runtime.launcher.UnixLauncher stop 

$prg_dir/jboss-cli.sh --connect command=:shutdown > /dev/null 2>&1 & 



Once the above changes are saved, you can rerun the above script to stop IAM.