[
https://issues.apache.org/jira/browse/OFBIZ-10287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17686635#comment-17686635
]
Daniel Watford commented on OFBIZ-10287:
----------------------------------------
This is an approach I'm experimenting with when running OFBiz in a docker
container.
{code:java}
#!/bin/bash
set -e
# Read a property value. Assumes all properties are single line and do not have
spaces around the '=' sign or comments following the value.
function getPropertyValue
{
echo "$1" | sed "/^$2=/!d; s///"
}
echo "Getting admin port and key..."
START_PROPERTIES_CONTENT=$(cat
/ofbiz/build/resources/main/org/apache/ofbiz/base/start/start.properties)
OFBIZ_ADMIN_PORT=$(getPropertyValue "$START_PROPERTIES_CONTENT"
"ofbiz.admin.port")
echo Admin port: $OFBIZ_ADMIN_PORT;
OFBIZ_ADMIN_KEY=$(getPropertyValue "$START_PROPERTIES_CONTENT"
"ofbiz.admin.key")
echo Admin key: $OFBIZ_ADMIN_KEY;
echo "Sending shutdown signal..."
echo "$OFBIZ_ADMIN_KEY:SHUTDOWN" | curl telnet://localhost:$OFBIZ_ADMIN_PORT
echo "Done"{code}
If you have the path to the relevant start.properties file, you can send the
shutdown signal to a specific OFBiz instance.
> gradlew --no-daemon "ofbiz --shutdown" does not work
> -----------------------------------------------------
>
> Key: OFBIZ-10287
> URL: https://issues.apache.org/jira/browse/OFBIZ-10287
> Project: OFBiz
> Issue Type: Bug
> Reporter: Jacques Le Roux
> Priority: Major
>
> When in production, if you use several OFBiz instances on your server, to
> stop them safely you need to use {{./gradlew --no-daemon terminateOfbiz}}
> which actually kills all OFBiz instances using "kill -9"
> {{./gradlew --no-daemon "ofbiz --shutdown"}} does not work, at least on demos
> VM where there is 3 instances. So if you use it you get an unstable situation
> and have to use "kill -9" manually.
> You always can use "terminateOfbiz", but it means that you have to restart
> all OFBiz instances. So it's easier to do that with {{all-manual-nicely.sh}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)