Skip to content

Commit

Permalink
LaunchD plist (from issue #2) and docs to support it.
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepeterson committed Mar 27, 2012
1 parent e3473ae commit cf02f4b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,15 @@ This will launch a Flask web server hosting the project. Visit the web page at t

python margarita.py -p 5000 -b 192.168.1.2 -d

Which would listen on port 5000, bind to IP 192.168.1.2, and enable debug mode.
Which would listen on port 5000, bind to IP 192.168.1.2 (by default it listens on all interfaces and IP addresses), and enable debug mode.

Automatic Startup
-----------------

**launchd**

Margarita can be started automatically as part of launchd. Included is a launchd.plist file (originally supllied by stazeii in issue #2 - thanks!). It may need to be modified to fit your environment, installation locations, user specifications, etc.

1. Copy plist file to ```/Library/LaunchDaemons/```
2. Modify the plist to specify installation directory (namely the second item of the ProgramArguments key) and any other locations or modifications.
3. Start up the plist file ```sudo launchctl load -w /Library/LaunchDaemons/com.github.jessepeterson.margarita.plist```
22 changes: 22 additions & 0 deletions com.github.jessepeterson.margarita.plist
Original file line number Diff line number Diff line change
@@ -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>Label</key>
<string>com.github.jessepeterson.margarita</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/python</string>
<string>/usr/local/margarita/margarita.py</string>
</array>
<key>StandardErrorPath</key>
<string>/var/log/margarita.log</string>
<key>StandardOutPath</key>
<string>/var/log/margarita.log</string>
</dict>
</plist>

0 comments on commit cf02f4b

Please sign in to comment.