Personal tools
You are here: Home Users Nguyen Non-Plone How Tos How to start trac or tracd automatically on Mac OS X

How to start trac or tracd automatically on Mac OS X

by T. Kim Nguyen last modified Jun 09, 2010 04:18 PM

using launchd and launchctl; these instructions are specific to OS X 10.5 (Leopard)

Use

sudo -s
to become root, then create a file in
/Library/LaunchDaemons
called
trac.plist
containing the following:
<?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>trac</string>
	<key>EnvironmentVariables</key>
	<dict>
		<key>PYTHONPATH</key>
		<string>/usr/local/lib/svn-python</string>
	</dict>
	<key>ProgramArguments</key>
	<array>
		<string>/Library/Frameworks/Python.framework/Versions/2.6/bin/tracd</string>
		<string>-p 8000</string>
		<string>--basic-auth=trac,/Users/Shared/trac/.htpasswd,/Users/Shared/trac</string>
		<string>/Users/Shared/trac</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
</dict>
</plist>

Start

launchctl
then enter the commands
load /Library/LaunchDaemons/trac.plist
That's it. Trac should start right away, and will start automatically whenever the system reboots.

Notes

In the above, if I didn't include the EnvironmentVariables key, trac would not be able to import the svn Python library.

To view the output of trac or see error messages it or launchd/launchctl generate, open the Console application.

Starting Trac or Tracd Manually

Manually:

sudo -s 
(tracd -p 8000 --basic-auth=trac,/Users/Shared/trac/.htpasswd,/Users/Shared/trac /Users/Shared/trac ) >> /Users/Shared/trac/log/tracshell.log 2>&1 &

or use the ~root/bin/start_tracd.sh script

As of June 2010, from Nathan:

sudo -u _www -s export PYTHON_EGG_CACHE=/opt/egg-cache (/usr/local/bin/tracd -p 8000 --basic-auth=trac,/Users/Shared/trac/.htpasswd,/Users/Shared/trac /Users/Shared/trac ) >> /Users/Shared/trac/log/tracshell.log 2>&1 &
 
Document Actions
  • Print this
  • Bookmarks