Skip to content

Commit

Permalink
Start/Stop commands do not work properly on MacOs diennea#165 (dienne…
Browse files Browse the repository at this point in the history
  • Loading branch information
CaioK authored Apr 8, 2020
1 parent 80a7ea6 commit f3eaf24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions majordodo-services/src/main/resources/bin/service
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ start() {
echo "Starting service..."

if [ "$PROCESS_PID" != 'X' ]; then
if [ -n "`ps h -p $PROCESS_PID`" ]; then
if ps -p $PROCESS_PID > /dev/null; then
echo "Process $PROCESS_PID already running"
RETVAL=1
return
Expand All @@ -123,7 +123,7 @@ console() {
echo "Starting service..."

if [ "$PROCESS_PID" != 'X' ]; then
if [ -n "`ps h -p $PROCESS_PID`" ]; then
if ps -p $PROCESS_PID > /dev/null; then
echo "Process $PROCESS_PID already running"
RETVAL=1
return
Expand All @@ -142,18 +142,18 @@ stop() {
if [ "$PROCESS_PID" != 'X' ]; then
echo "Stopping service, pid $PROCESS_PID..."

if [ -n "`ps h -p $PROCESS_PID`" ]; then
if ps -p $PROCESS_PID > /dev/null; then
command kill -SIGTERM $PROCESS_PID
RETVAL=$?
i=$KILL_GRACE_TIME
while [ -n "`ps h -p $PROCESS_PID`" -a "$i" -gt "0" ]; do
while ps -p 1 > /dev/null && [ "$i" -gt "0" ]; do
echo "Waiting for $PROCESS_PID to die..."
i=$[$i-1]
sleep 1
done

if [ -n "`ps h -p $PROCESS_PID`" ]; then
echo "Process $PROCESS_PID did not exist on request. Killing"
if ps -p $PROCESS_PID > /dev/null; then
echo "Process $PROCESS_PID did not exit on request. Killing"
command kill -SIGKILL $PROCESS_PID
RETVAL=$?
sleep 1
Expand Down Expand Up @@ -206,7 +206,7 @@ stacktrace() {
status() {
if [ "$PROCESS_PID" != 'X' ]; then

if [ -n "`ps h -p $PROCESS_PID`" ]; then
if ps -p $PROCESS_PID > /dev/null; then
echo "Service is running, pid $PROCESS_PID"
else
echo "Pidfile $BASE_DIR/$PIDFILENAME does exist, but process is not running"
Expand Down
2 changes: 1 addition & 1 deletion majordodo-services/src/main/resources/bin/setenv.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Basic Environment and Java variables

#JAVA_HOME=
JAVA_OPTS="-Xmx1g -Xms1g -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -Djava.net.preferIPv4Stack=true -XX:MaxDirectMemorySize=1g -Djava.security.auth.login.config=conf/jaas.conf "
JAVA_OPTS="-Xmx1g -Xms1g -XX:+UseParallelGC -Djava.net.preferIPv4Stack=true -XX:MaxDirectMemorySize=1g -Djava.security.auth.login.config=conf/jaas.conf "


if [ -z "$JAVA_HOME" ]; then
Expand Down

0 comments on commit f3eaf24

Please sign in to comment.