Setting up Perforce Server (p4d) on Mac OS X
This morning I have been attempting to get p4d running on my intel iMac (running MacOS 10.5.5) so I can do some proper development at home. I easily found the official Perforce guide to launching p4d at start-up with Launchd here, which seemed helpful and simple enough. But it would seem I am now bogged down in file permission hell, which is something I don’t know allot about as I mainly work on Windows systems…
When I login I get the following message in my Console log and no p4d instance started:
“10/11/08 2:56:59 PM com.apple.launchctl.System[2] launchctl: Dubious ownership on file (skipping): /Library/LaunchDaemons/com.perforce.plist”
The permissions for the plist file are:
-rw-r–r–@ 1 Daniel staff 700 10 Nov 11:58 /Library/LaunchDaemons/com.perforce.plist
And the permissions for p4 and p4d are:
-rwxr-xr-x@ 1 Daniel staff 580272 10 Nov 11:25 /Developer/Perforce/p4
-rwxr-xr-x@ 1 Daniel staff 1695008 10 Nov 11:25 /Developer/Perforce/p4d
The rest of the perforce files are set to:
-rw-r–r– 1 Daniel staff * 10 Nov 13:14 *
I used the example plist file from the perforce website and filled in the details specific for my installation:
<?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>Debug</key> <false/> <key>Label</key> <string>com.perforce</string> <key>OnDemand</key> <false/> <key>ProgramArguments</key> <array> <string>/Developer/Perforce/p4d</string> </array> <key>EnvironmentVariables</key> <dict> <key>P4LOG</key> <string>/Developer/Perforce/p4log.log</string> <key>P4PORT</key> <string>1666</string> <key>P4ROOT</key> <string>/Developer/Perforce/p4root</string> </dict> <key>RunAtLoad</key> <true/> <key>ServiceDescription</key> <string>Launches Perforce Server</string> </dict> </plist>
This plist file works if I use the following command:
launchctl unload /Library/LaunchDaemons/com.perforce.plist
Any help on resolving this would be greatly appreciated, I can start the server manaually for now but it would be great to have it running at start-up or login! I’ve tried using the same plist file in the /Library/LaunchedAgents/ folder but I get the same results
Solution!
The following solution is from Perforce technical support, the owner and group of the plist file should be root:wheel which can be achieved by the following command:
sudo chown root:wheel /Library/LaunchDaemons/com.perforce.plist
The file should look like this after the change:
-rw-r–r– 1 root wheel 797 11 Nov 11:01 com.perforce.plist









[...] wrote a post yesterday about setting up the Perforce server P4D on Mac OS X once you’ve done that all that [...]