0

I have build a parcel and a csd that go together and work fine when deploying to a cluster.

However, when I stop the service a child process started by a startup script keeps on running in the background.

I have tried many things but I went back to something more "brutal".

CSD extract

 "startRunner" : {
         "program" : "scripts/rexster.sh",
         "args" : [ "start" ],
         "environmentVariables" : {
                    "CONF_FILE" : "${conf_file}",
                    "REXSTER_PORT" : "${rexster_port}",
                    "HBASE_ZK" : "${hbase_zk_quorum}",
                    "REXSTER_SHUTDOWN_PORT" : "${rexster_shutdown_port}",
                    "HBASE_TABLE_NAME" : "${hbase_tablename}",
                    "MEM_XMX" : "${memory_xmx}",
                    "MEM_XMS" : "${memory_xms}"
                  }
        },

       "stopRunner" : {
          "relevantRoleTypes" : ["TITAN_REXTER_SERVER"],
          "runner" : {
            "program" : "scripts/rexster.sh",
            "args" : [ "stop" ]
            }
          }
      }

scripts/rexster.sh extract

...
    ;;
  (stop)
    echo "Stopping rexster"
    exec kill -9 `ps aux | grep java | grep titan | awk '{print $2}'`
#    exec stopRexster.sh $TITAN_HOME
    ;;
  (*)
    echo "Don't understand [$CMD]"
    ;;
esac

But the process keeps on running in the background:

usr/java/jdk1.7.0_67-cloudera/bin/java -server -Xms128m -Xmx512m -Dtitan.logdir=../log com.tinkerpop.rexster.Application -s -c /opt/cloudera/parcels/TITAN-1.0/lib/titan-0.5.2-hadoop2-CDH5.3/conf/rexster-hbase.xml
Havnar
  • 2,558
  • 7
  • 33
  • 62

1 Answers1

0

The stoprunner wasn't placed correctly. It is defined per role, after the role definition.

 <...ROLE...>}]
,
     "stopRunner" : {
     "masterRole":"TITAN_REXTER_SERVER",
     "relevantRoleTypes" : ["TITAN_REXTER_SERVER"],
     "runner" : {
            "program" : "scripts/rexster.sh",
            "args" : [ "stop" ],
            "environmentVariables" : {
                "CONF_FILE" : "${conf_file}",
                "REXSTER_PORT" : "${rexster_port}",
                "HBASE_ZK" : "${hbase_zk_quorum}",
                "REXSTER_SHUTDOWN_PORT" : "${rexster_shutdown_port}",
                "HBASE_TABLE_NAME" : "${hbase_tablename}"
            }
        }
       }
Havnar
  • 2,558
  • 7
  • 33
  • 62