trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mkby <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #562: [TRAFODION-1609]
Date Fri, 01 Jul 2016 05:56:46 GMT
Github user mkby commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/562#discussion_r69251632
  
    --- Diff: core/sqf/sql/scripts/install_local_hadoop ---
    @@ -847,20 +847,31 @@ EOF
     
       cat <<EOF >$MY_SW_SCRIPTS_DIR/swstatus
     #!/bin/sh
    -cd ${MY_SW_ROOT}
    -. $MY_SW_SCRIPTS_DIR/sw_env.sh
    -NUM_JAVA_PROCS=\`ps -aef | grep \$USER | grep java | grep -v grep | wc -l\`
    -NUM_MYSQLD_PROCS=\`ps -aef | grep \$USER | grep mysqld | grep -v grep | wc -l\`
    +cd \${MY_SW_ROOT}
    +. \$MY_SW_SCRIPTS_DIR/sw_env.sh
    +JPS_OUTPUT=\`jps\`
    +SERVICES='HMaster NodeManager ResourceManager NameNode DataNode SecondaryNameNode'
    +for s in \$SERVICES; do
    +    if [[ ! \$JPS_OUTPUT =~ \$s ]]; then
    +        MISS_SERVICE="\$s \$MISS_SERVICE"
    +    fi
    +done
     
    -if [ "\$1" == "-v" ]; then
    -  ps -aef | grep \$USER | grep java | grep -v grep
    -  ps -aef | grep \$USER | grep mysqld | grep -v grep
    +if [[ \$MISS_SERVICE != '' ]]; then
    +    echo "ERROR: Service \"\$MISS_SERVICE\" are not up!"
    +    exit 1
    +else
    +    echo "The local hadoop services are up!"
     fi
     
    -echo "\$NUM_JAVA_PROCS java servers and \$NUM_MYSQLD_PROCS mysqld processes are running"
    -
    -jps | grep -v Jps
    -
    +NUM_MYSQLD_PROCS=\`ps -aef | grep \$USER | grep mysqld | grep -v grep | wc -l\`
    +if [[ \$NUM_MYSQLD_PROCS -ne 0 ]]; then
    +    echo "\$NUM_MYSQLD_PROCS mysqld processes are running"
    +    exit 0
    +else
    +    echo "ERROR: mysqld process is not running!"
    +    exit 1
    +fi
     EOF
     
    --- End diff --
    
    Thanks, I see. But they're all start/stop scripts, I don't want to modify them. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message