Add launchctl agent plist for OSX

I found this useful to have, and figured it might save somebody else a
few minutes of re-inventing the wheel.
This commit is contained in:
Stephen Sugden 2015-04-30 16:54:06 +02:00
parent cc5f6bb306
commit 904ce1080e
2 changed files with 31 additions and 0 deletions

9
misc/launchd/README.md Normal file
View File

@ -0,0 +1,9 @@
# ipfs launchd agent
A bare-bones launchd agent file for ipfs. To have launchd automatically run the ipfs daemon for you, do the following:
mkdir -p ~/Library/LaunchAgents
cp misc/launchctl/io.ipfs.ipfs-daemon.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/io.ipfs.ipfs-daemon.plist
Note that the `ipfs` binary must be on the *system* PATH for this to work. Adding a symlink in /usr/bin works well enough for me.

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>io.ipfs.ipfs-daemon</string>
<key>ProgramArguments</key>
<array>
<string>ipfs</string>
<string>daemon</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/usr/local/var/log/ipfs.err</string>
<key>StandardOutPath</key>
<string>/usr/local/var/log/ipfs.log</string>
</dict>
</plist>