1. 程式人生 > >SVN服務器 Linux 開機自動啟動代碼

SVN服務器 Linux 開機自動啟動代碼

svn服務器 linux 開機自動啟動代碼




  ~ ll /etc/rc.d/rc.local
-rwxr-xr-x 1 root root 810 Oct  9 09:30 /etc/rc.d/rc.local




  ~ cat /etc/rc.d/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run ‘chmod +x /etc/rc.d/rc.local‘ to ensure
# that this script will be executed during boot.

touch /var/lock/subsys/local

#add_S by chunli, for autostart svnserve!
while true
do
    sleep 1
    ps -ef > /tmp/tmp_svnserve
    cat /tmp/tmp_svnserve | grep ‘/usr/bin/svnserve -d‘
    if [ $? -eq 0 ]
    then
        rm -rf /tmp/tmp_svnserve
        exit
    else
        /usr/bin/svnserve -d -r /home/svn/
    fi
done
#add_E by chunli, for autostart svnserve!
  ~


本文出自 “李春利” 博客,轉載請與作者聯系!

SVN服務器 Linux 開機自動啟動代碼