         # su -l hbase -c "/usr/lib/hbase/bin/hbase-daemon.sh --config /etc/hbase/conf stop regionserver"
         # cmd: "su -l #{hbase_user.name} -c \"/usr/lib/hbase/bin/hbase-daemon.sh --config #{hbase_conf_dir} stop regionserver\""
         cmd: 'service hbase-regionserver stop'
-      , (err, stopped) ->
-        callback err, stopped
+      , callback
   webhcat_status: (ctx, callback) ->
     {webhcat_pid_dir} = ctx.config.ryba
     # lifecyle.is_pidfile_running ctx, "#{webhcat_pid_dir}/webhcat.pid", (err, running) ->

        # cmd: "su -l #{hdfs_user.name} -c \"/usr/lib/hadoop/sbin/hadoop-daemon.sh --config #{hadoop_conf_dir} --script hdfs stop journalnode\""
        cmd: 'service hadoop-hdfs-journalnode stop'
        # code_skipped: 1
      , (err, stopped) ->
        callback err, stopped
  nn_status: (ctx, callback) ->
    ctx.execute
      cmd: "service hadoop-hdfs-namenode status"
      code_skipped: [1, 3]
    , (err, stopped) ->
      callback err, stopped
  nn_start: (ctx, callback) ->
    {hdfs_user, hadoop_conf_dir, hdfs_site, nameservice, ha_client_config, hdfs_namenode_timeout} = ctx.config.ryba
    state = (started) ->
      callback null, started
    lifecyle.nn_status ctx, (err, running) ->
      # return callback err, false if err or running
      return callback err if err 
      return state false if running
      ctx.log "NameNode start"
      ctx.execute
        # su -l hdfs -c "/usr/lib/hadoop/sbin/hadoop-daemon.sh --config /etc/hadoop/conf --script hdfs start namenode"
        # cmd: "su -l #{hdfs_user.name} -c \"/usr/lib/hadoop/sbin/hadoop-daemon.sh --config #{hadoop_conf_dir} --script hdfs start namenode\""
        cmd: 'service hadoop-hdfs-namenode start'
        # code_skipped: 1
      , (err, started) ->
        return callback err if err
        return callback null, false unless started
        ipc_port = url.parse(ha_client_config["dfs.namenode.rpc-address.#{nameservice}.#{ctx.config.shortname}"]).port or 8020
        http_port = if hdfs_site['dfs.https.enable'] is 'false'
        then url.parse(ha_client_config["dfs.namenode.http-address.#{nameservice}.#{ctx.config.shortname}"]).port or 50070
        else url.parse(ha_client_config["dfs.namenode.https-address.#{nameservice}.#{ctx.config.shortname}"]).port or 50470
        ctx.waitIsOpen ctx.config.host, [ipc_port, http_port], timeout: hdfs_namenode_timeout, (err) ->
          return callback err if err
          state true
  nn_stop: (ctx, callback) ->
    {hdfs_user, hadoop_conf_dir} = ctx.config.ryba
    lifecyle.nn_status ctx, (err, running) ->

        # su -l oozie -c "/usr/lib/oozie/bin/oozied.sh stop"
        cmd: "su -l #{oozie_user.name} -c \"/usr/lib/oozie/bin/oozied.sh stop\""
        # code_skipped: 1
      , callback
  hbase_master_status: (ctx, callback) ->
    # {hbase_pid_dir, hbase_user} = ctx.config.ryba
    ctx.log "HBase Master status"
