为 Tracd 服务编写一个启动脚本

这儿写了怎么安装配置Trac 服务http://www.sunnyu.com/?p=86
为了做trac配置时的参数调整重新启动,特别做了这个启动脚本。
可以传入参数
stop 停止旧有服务
auth 以密码验证方式启动。

可以修改开始部分的port,tracenvtype几个参数值来达到启动方式的控制
当使用密码验证方式时,注意修改basic-auth选项使用过的 密码文件名称

  1. #!/bin/sh
  2.  
  3. port=8081
  4. tracenv=/var/trac
  5. type=noauth
  6.  
  7. #first stop old running
  8. pid=`ps -fe |grep tracd |awk '{if ($3 == 1) print $2}'`
  9.  
  10. if [ -n "$pid" ]; then
  11.   echo "killing old tracd: $pid …."
  12.   kill $pid
  13. fi
  14.  
  15. echo "starting tracd …."
  16.  
  17. case $1 in
  18.   "auth")
  19.   echo "using basic auth"
  20.  LD_LIBRARY_PATH=/usr/local/ssl/lib /usr/local/bin/tracd -d \
  21.     –basic-auth=*,/var/trac/.passwd,trac \
  22.     –port $port -e $tracenv >/dev/null 2>&1
  23.   ;;
  24.  
  25.   "stop")
  26.   ;;
  27.  
  28.  
  29.   *)
  30.   echo "not using auth"
  31.  LD_LIBRARY_PATH=/usr/local/ssl/lib /usr/local/bin/tracd -d \
  32.     –port $port -e $tracenv >/dev/null 2>&1
  33. esac
  34. echo "done"

Popularity: 4% [?]

Related

Comments

Comments are closed.