SUSE Linux subversion服务器自启动


通过以下几个步骤,将svnserve设置为开机自启动的服务了。
 
  1. 阅读/etc/init.d/svnserve脚本,从下面的片段中得到启发,去改/etc/sysconfig/svnserve中的设置
 
  ...
SVNSERVE_BIN=/usr/bin/svnserve
...
SVNSERVE_CONFIG=/etc/sysconfig/svnserve
...
. $SVNSERVE_CONFIG
...
case "{GetProperty(Content)}" in
start)
echo -n "Starting svnserve "
## Start daemon with startproc(8). If this fails
## the return value is set appropriately by startproc.
startproc -u "$SVNSERVE_USERID" -g "$SVNSERVE_GROUPID" -e $SVNSERVE_BIN $SVNSERVE_OPTIONS
...


 
  2. 修改/etc/sysconfig/svnserve文件中的下列内容
 
  #####注意去掉-R,否则会强制只读;
 
  #####注意仓库的路径要拼写正确
 
  SVNSERVE_OPTIONS="-d -r /home/zhangrui/project/svnRepository/sft"
 
  #####设为存在的用户和用户组,我就设为自己常用登录的用户了
 
  SVNSERVE_USERID="zhangrui"
 
  SVNSERVE_GROUPID="users"
 
  3. 在YAST——>系统——>系统服务 中开启svnserve服务(level3,5)
 
  或者用root运行chkconfig -s svnserve on
 
  后记:方法当然不止一个,网上有说用自启动脚本的,有说用xinetd启动的。我还是喜欢自己用的这个方法,会在启动过程中出现一行“Starting svnserve done”。

本文作者:
« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3