通过在 MacOS 的 /Library/LaunchDaemons 目录下增加 plist 文件实现开机启动SVN服务的方法:
<?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>aven</string> <key>Label</key> <string>org.tigris.subversion.svnserve</string> <key>ProgramArguments</key> <array> <string>/usr/local/bin/svnserve</string> <string>--inetd</string> <string>--root</string> <string>/Users/aven/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所在路径,第三个是你的版本库要目录。
提示:查看svnserve路径方法:
which 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 aven /Users/aven/svn4、重启电脑
重启验证配置是否生效。
Running an SVN Server Automatically in the Background
https://www.zennaware.com/cornerstone/helpbook/pages/appendix/launchd.html
Mac OS启动服务优化高级篇(launchd tuning)
======================文档信息======================
版权声明:非商用自由转载-保持署名-注明出处
署名(BY) :testcs_dn(微wx笑)
文章出处:[无知人生,记录点滴](http://blog.csdn.NET/testcs_dn)
==============欢迎关注我的个人微信订阅号(微wx笑)==========