創建自啓動腳本: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