建立自启动脚本:
- vim /etc/init.d/subversion
复制代码 输入如下内容:
- #!/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
复制代码 修改文件为可运行文件:
查看subversion开机启动情况:
如没有,则添加到系统启动队列中:
- chkconfig --add subversion
复制代码重新检查subversion开机启动情况,若成功,则应显示如下内容: - subversion 0:off 1:off 2:on 3:on 4:on 5:on 6:off
复制代码使用下列命令对subversion进行重启、停止、启动: - service subversion restart/stop/start
复制代码
|