mac下svn开机自启动配置

在 /Library/LaunchDaemons下

步骤:

  1. /Library/LaunchDaemons下新建org.tigris.subversion.svnserve.plist。

  2. org.tigris.subversion.svnserve.plist内容:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Disabled</key>
        <false/>
        <key>UserName</key>
        <string>Lovell</string>
        <key>Label</key>
        <string>org.tigris.subversion.svnserve</string>
        <key>ProgramArguments</key>
        <array>
            <string>/opt/subversion/bin/svnserve</string>
            <string>--inetd</string>
            <string>--root</string>
            <string>/Users/Lovell/Desktop/develop-work/svn-workspace/svn</string>
        </array>
        <key>ServiceDescription</key>
        <string>SVN Version Control System</string>
        <key>Sockets</key>
        <dict>
            <key>Listeners</key>
            <array>
                <dict>
                    <key>SockFamily</key>
                    <string>IPv4</string>
                    <key>SockServiceName</key>
                    <string>svn</string>
                    <key>SockType</key>
                    <string>stream</string>
                </dict>
                <dict>
                    <key>SockFamily</key>
                    <string>IPv6</string>
                    <key>SockServiceName</key>
                    <string>svn</string>
                    <key>SockType</key>
                    <string>stream</string>
                </dict>
            </array>
        </dict>
        <key>inetdCompatibility</key>
        <dict>
            <key>Wait</key>
            <false/>
        </dict>
    </dict>
</plist>

提示:查看svnserve路径方法:

which svnserve
红色字体,第一个是你的账户名,第二个是你的svnserve所在路径,自己改自己的,第三个是你数据仓库,自己改自己的。

#授权开机启动权限给root,否则报/Library/LaunchDaemons/org.tigris.subversion.svnserve.plist: Path had bad ownership/permissions无权限错误
sudo chown -R root /Library/LaunchDaemons/org.tigris.subversion.svnserve.plist
#授权svn仓库的使用权限给当前用户
sudo chown -R Lovell /Users/Lovell/Desktop/develop-work/svn-workspace/svn
电脑重启,可用。

参考资料:https://www.zennaware.com/cornerstone/helpbook/pages/appendix/launchd.html
                  http://blog.csdn.net/whyliu_/article/details/9045589

你可能感兴趣的:(mac下svn开机自启动配置)