Search code examples
macoscvs

CVS pserver in OS X Sierra times out intermittently


I recently migrated my cvs server from a very old mac to some new hardware. I found instructions for setting up Launch Services to run cvs pserver, and it works sometimes.

/Library/LaunchDaemons/cvspserver.plist contains this

<?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.apple.cvspserver</string>
 <key>UserName</key>
   <string>root</string>
 <key>Program</key>
   <string>/usr/local/bin/cvs</string>
 <key>ProgramArguments</key>
   <array>
     <string>-f</string>
     <string>--allow-root=/home/cvsroot</string>
     <string>pserver</string>
   </array>
 <key>Sockets</key>
   <dict>
   <key>Listeners</key>
     <dict>
       <key>SockPassive</key>
         <true/>
       <key>SockServiceName</key>
         <string>2401</string>
       <key>SockType</key>
         <string>stream</string>
     </dict>
   </dict>
 <key>inetdCompatibility</key>
   <dict>
     <key>Wait</key>
       <false/>
   </dict>
</dict>
</plist>

CVS will work for a while, but sometimes I'll get:

cvs [update aborted]: connect to cvs(10.10.0.2):2401 failed: Operation timed out

Trying again sometimes works. If I do this:

sudo launchctl unload -w /Library/LaunchDaemons/cvspserver.plist 
sudo launchctl load -w /Library/LaunchDaemons/cvspserver.plist 

It'll work right away, but after a while the timeouts start again.

Any ideas? I don't even know how to debug this...


Solution

  • I now believe that the problem was that the server was going to sleep, and even though it was set to wake on network activity, that doesn't actually work. So I set it to never sleep and it's been reliable since then.