用su启动WSO2碳

用su启动WSO2碳,wso2,ubuntu-10.04,wso2carbon,Wso2,Ubuntu 10.04,Wso2carbon,我确实在Ubuntu 10.4服务器上安装了WSO2 Identity server,并将其连接到MySQL数据库。现在我创建了一个用户wso2user,并授予该用户对WSO2文件夹的完全权限。使用以下命令启动服务器时: #! /bin/sh su wso2user -c '/opt/identitywso2/bin/wso2server.sh' 服务器启动,我可以登录,但my命令提示符保留在shell中,并显示最后一条日志消息: [2014-05-19 14:14:27,938] INFO

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

#! /bin/sh
su wso2user -c '/opt/identitywso2/bin/wso2server.sh'
服务器启动,我可以登录,但my命令提示符保留在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. 
有什么不对劲吗?我想开始发球而不必呆在壳里

谢谢你的提示。
Lucas

这是我的脚本,基于WSO2 API Manager,但您也可以用于任何其他WSO2产品。脚本基于Suse EE SP3。将此文件放在/etc/init.d中,然后执行checkconfig

#!/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

您可能希望使用osgi控制台启动该产品,以了解osgi捆绑包是否已正确解析。为此,请以
/opt/identityws2/bin/wso2server.sh-DosgiConsole
启动服务器。然后,当服务器启动时,在控制台中输入
ss
命令。将命令更改为wso2server.sh--start确实有帮助。但我将在稍后阶段使用脚本。卢卡斯