File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
OracleIdentityGovernance/samples/scripts Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -718,6 +718,28 @@ else
718
718
fi
719
719
}
720
720
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
+ # shellcheck disable=SC2046
733
+ kill -9 ` ps -ef | grep -v grep | grep ${CONTAINER_PROCESS_ID} | awk ' {print $2}' `
734
+
735
+ # Stop the container, as Podman doesn't notice the processes are dead until you interact with the container.
736
+ echo " Removing container. Ignore errors."
737
+ podman rm -f " $AI "
738
+ else
739
+ echo " Container Already Removed"
740
+ fi
741
+ }
742
+
721
743
# shellcheck source=/dev/null
722
744
stop ()
723
745
{
@@ -779,6 +801,7 @@ kill()
779
801
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
780
802
fi
781
803
podman rm -f " $AI "
804
+ forceRmPodman
782
805
fi
783
806
}
784
807
You can’t perform that action at this time.
0 commit comments