launchd 是 MacOS X 最好的部分之一,在其他系统上找不到它让我非常痛苦。
编辑并将其放置/Library/LaunchDaemons
为com.you.wiki.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>Label</key>
<string>com.you.wiki</string>
<key>LowPriorityIO</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
<key>Nice</key>
<integer>1</integer>
<key>WorkingDirectory</key>
<string>/Users/stuartcw/Documents/Wiki/moin-1.7.2</string>
<key>UserName</key>
<string>user to run this as</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python</string>
<string>wikiserver.py</string>
</array>
</dict>
</plist>