CentOS开机启动subversion

创建自启动脚本:redis

vim /etc/init.d/subversion

输入以下内容:vim

#!/bin/bash
#
# subversion startup script for the server
#
# chkconfig: 2345 90 10
# description: start the subversion
#
# Source function library
. /etc/rc.d/init.d/functions
 
#脚本名称
prog=subversion

#redis安装目录
SVN_HOME=/opt/subversion
export SVN_HOME

case "$1" in
    start)
    echo "Starting subversion..."
    $SVN_HOME/ctlscript.sh start
    ;;
 
 
stop)
    echo "Stopping subversion..."
    $SVN_HOME/ctlscript.sh stop
    ;;
 
 
restart)
    echo "Restarting subversion..."
    $SVN_HOME/ctlscript.sh restart
    ;;
 
 
*)
    echo "Usage: $prog {start|stop|restart}"
    ;;
esac
exit 0

修改文件为可运行文件:bash

chmod a+x subversion

查看subversion开机启动状况:rest

chkconfig --list

如没有,则添加到系统启动队列中:code

chkconfig --add subversion

从新检查subversion开机启动状况,若成功,则应显示以下内容:server

subversion 0:off 1:off 2:on 3:on 4:on 5:on 6:off队列

 

使用下列命令对subversion进行重启、中止、启动:ip

service subversion restart/stop/start
相关文章
相关标签/搜索