【问题标题】:starting WSO2 carbon with su以 su 开始 WSO2 碳
【发布时间】:2014-05-19 12:27:18
【问题描述】:

我确实在 Ubuntu 10.4 服务器上安装了 WSO2 身份服务器并将其连接到 MySQL 数据库。现在我确实创建了一个用户 wso2user 并授予该用户对 WSO2 文件夹的完全权限。当我使用以下命令启动服务器时:

#! /bin/sh
su wso2user -c '/opt/identitywso2/bin/wso2server.sh'

服务器启动,我可以登录,但我的命令提示符留在 shell 中并显示最后一条日志消息:

[2014-05-19 14:14:27,938]  INFO {org.wso2.carbon.identity.entitlement.internal.EntitlementServiceComponent} -  Started thrift entitlement service at port:10500
[2014-05-19 14:14:43,534]  INFO {org.wso2.carbon.identity.entitlement.internal.SchemaBuilder} -  XACML policy schema loaded successfully. 

可能出了什么问题?我想开始发球,而不需要留在 shell 中。

感谢您的任何提示。 卢卡斯

【问题讨论】:

  • 您可能希望使用 osgi 控制台启动产品,以查看 osgi 捆绑包是否已正确解析。为此,以/opt/identitywso2/bin/wso2server.sh -DosgiConsole 启动您的服务器。然后,当服务器启动时,在控制台输入ss命令。

标签: wso2 ubuntu-10.04 wso2carbon


【解决方案1】:

这是我的脚本,基于 WSO2 API Manager,但您也可以将其用于任何其他 WSO2 产品。脚本基于 Suse EE SP3。将此文件放入 /etc/init.d 并进行检查配置。

#!/bin/sh
#
# /etc/init.d/wso2
# init script for wso2.
#
# chkconfig: 2345 90 60
# description: wso2 indexer service
#
RETVAL=0

. /etc/rc.status

BAD_USER="This script should be run as root or as wso2 user. Exiting......."

cmd="/bin/sh -c"
if [ "$USER" != 'root' -a "$USER" != 'wso2' -a "$USER" != '' ]; then echo $BAD_USER && exit 1;fi
if [ "$USER" == 'root' -o "$USER" == '' ]; then cmd="su - wso2 -c";fi

wso2pid=`pidof java`

wso2_start() {
  echo Starting wso2...
  $cmd "/opt/wso2/am/bin/wso2server.sh --start"
}
wso2_stop() {
  echo Stopping wso2...
  $cmd "/opt/wso2/am/bin/wso2server.sh --stop"
  if [ -n "$wso2pid" ]
  then
    echo -n "Waiting for wso2 ($wso2pid)"
    while [[ ( -d /proc/$wso2pid ) ]]
    do
      echo -n "."
      sleep 1
    done
    echo "Stopped"
  fi
}
wso2_restart() {
  echo Restarting wso2...
  $cmd "/opt/wso2/am/bin/wso2server.sh --restart"
}
wso2_status() {
  echo -n "Status of wso2 is "
  if [ -n "$wso2pid" ]
  then echo "Running. ($wso2pid)"
  else echo "Stopped."
  fi
}

case "$1" in
  status)
    wso2_status
    ;;
  start)
    wso2_start
    ;;
  stop)
    wso2_stop
    ;;
  restart)
    wso2_restart
    ;;
  *)
    echo "Usage: $0 {start|stop|restart}"
    exit 1
    ;;
esac

exit $RETVAL

【讨论】:

  • 嗨,马克,非常感谢您提供的脚本。将命令更改为 wso2server.sh --start 确实有所帮助。但我将在稍后阶段使用该脚本。卢卡斯
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-07-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多