File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
OracleIdentityGovernance/samples/scripts Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -718,6 +718,27 @@ else
718718fi
719719}
720720
721+ forceRmPodman ()
722+ {
723+ # Get the main process for the container.
724+ CONTAINER_ID=$( podman ps -a | grep " $AI " | awk ' {print $1}' )
725+ if [ -n " ${CONTAINER_ID} " ]; then
726+ echo Container ID : " $CONTAINER_ID "
727+ CONTAINER_PROCESS_ID=$( ps -ef | grep -v grep | grep " $CONTAINER_ID " | awk ' {print $2}' )
728+ echo Container Process ID: ${CONTAINER_PROCESS_ID}
729+
730+ # Kill any processes containing the process ID.
731+ # This kills the child processes too.
732+ kill -9 ` ps -ef | grep -v grep | grep ${CONTAINER_PROCESS_ID} | awk ' {print $2}' `
733+
734+ # Stop the container, as Podman doesn't notice the processes are dead until you interact with the container.
735+ echo " Removing container. Ignore errors."
736+ podman rm -f " $AI "
737+ else
738+ echo " Container Already Removed"
739+ fi
740+ }
741+
721742# shellcheck source=/dev/null
722743stop ()
723744{
@@ -779,6 +800,7 @@ kill()
779800 podman exec " $AI " /bin/bash -c ' agent --config /app/data/conf/config.json ido lcm -i status_check; while [[ "$?" != "2" && "$?" != "255" ]]; do sleep 5s;agent --config /app/data/conf/config.json ido lcm -i status_check; done' > /dev/null
780801 fi
781802 podman rm -f " $AI "
803+ forceRmPodman
782804 fi
783805}
784806
You can’t perform that action at this time.
0 commit comments