如何使用unix脚本启动和停止ping联合

时间:2015-02-25 06:35:55

标签: ping federation

我需要一个脚本来使用unix脚本启动和停止pingfederate服务器。我正在寻找使用脚本

启动和停止pingfederate的最佳实践

1 个答案:

答案 0 :(得分:1)

http://documentation.pingidentity.com/display/PF72/Running+PingFederate+as+a+Service有:

#! /bin/sh

start() {
  echo "starting PingFederate.."
  su - <pf_user> \
  -c '<pf_install>/pingfederate/sbin/pingfederate-run.sh \
  > /dev/null 2> /dev/null'
}

stop() {
  echo "stopping PingFederate.."
  su - <pf_user> \
  -c '<pf_install>/pingfederate/sbin/\
     pingfederate-shutdown.sh'
}

restart(){
  stop
  # padding time to stop before restart
  sleep 60
  # To protect against any services that are not stopped,
  # uncomment the following command.
  # (Warning: this kills all Java instances running as
  # <pf_user>.)
  #   su - <pf_user> -c 'killall java'
  start
}

case "$1" in
  start)
     start
     ;;
  stop)
     stop
     ;;
  restart)
     restart
     ;;
  *)
  echo "Usage: <pf_user> {start|stop|restart}"
  exit 1
esac
exit 0