Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#26974 closed defect (worksforme)

subversion: svnserve doesn't work with launchd

Reported by: reg@… Owned by: danielluke (Daniel J. Luke)
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: svnserve launchd Cc:
Port: subversion

Description (last modified by ryandesign (Ryan Schmidt))

The version of svnserve that was build with MacPorts doesn't function correctly with Apple's launchd. Other builds of svnserve of the same version 1.6.13 obtained from for example CollabNet http://www.open.collab.net/downloads/community/ in binary form do work with launchd. As these binaries are build from the same 1.6.13 Subversion source I think the problem lies in the building and not in Subversion itself. Hence I report it here.

Problem:

After adding svnserve to lauchd, clients get the following message on for example an svn list command: "svn: Malformed network data". Svnserve is started by launchd but the request is not handled correctly.

Steps to reproduce:

  • Modify repository path in attached plist to your liking
  • Store attached launchd plist in /Libray/LaunchDaemons
  • Load with sudo launchctl load org.tigris.Subversion.plist
  • Start with sudo launchctl start org.tigris.subversion.svnserve
  • Execute svn list svn://127.0.0.1/..your.repo.path../trunk

Replacing only the location of svnserve in the plist to the version downloaded and installed from either CollabNet (same version 1.6.13) or the older version Apple ships will solve the problem. Only the MacPorts version doesn't work.

If svnserve is started manually it is working fine.

Attachments (2)

org.tigris.Subversion.plist (764 bytes) - added by reg@… 10 years ago.
Launchd plist for svnserve
org.tigris.subversion.svnserve.plist-non-inetd.plist (634 bytes) - added by reg@… 10 years ago.
Launchd plist for svnserve without inetdCompatibility

Download all attachments as: .zip

Change History (15)

Changed 10 years ago by reg@…

Attachment: org.tigris.Subversion.plist added

Launchd plist for svnserve

comment:1 Changed 10 years ago by reg@…

Cc: reg@… removed

Cc Me!

comment:2 Changed 10 years ago by reg@…

You may also need to change the 'UserName' and 'GroupName' keys in the plist to match the security settings on your repository folder.

comment:3 Changed 10 years ago by reg@…

I've tested this on 2 machines with the following specs:

  • iMac 2.4GHz Intel Core 2 Duo, OS/X 10.6.4, XCode 3.2.2
  • Mac mini Server 2.66GHz Intel Core 2 Duo, OS/X Server 10.6.4, XCode 3.2.4

comment:4 Changed 10 years ago by ryandesign (Ryan Schmidt)

Description: modified (diff)

comment:5 Changed 10 years ago by ryandesign (Ryan Schmidt)

Cc: dluke@… removed
Owner: changed from macports-tickets@… to dluke@…
Port: subversion added; Subversion removed
Summary: Macports version of svnserve doesn't work with launchdsubversion: svnserve doesn't work with launchd

comment:6 Changed 10 years ago by danielluke (Daniel J. Luke)

I just tried it on 10.5/ppc and 10.6/x86_64

Your plist, and it worked fine (svn list svn://127.0.0.1/)

... so there's something else going on here.

comment:7 Changed 10 years ago by reg@…

Thanks for testing, I'm note sure what that could be. I've looked for all the differences between the Collabnet version and the MacPort version and the differences are:

1) The location of the svnserve program. ( /opt/subversion/bin versus /opt/local/bin ) 2) The permissions on svnserve ( -rwxrwxr-x versus -rwxr-xr-x ) 3) The file size ( 274776(Fat binary) versus 77352 )

So I've tried: 1) swap locations of svnserve. No difference, now the Macport version doesn't work in the other location. 2) Changed permissions. No difference. 3) Build the 'universa'l variant of the Macport version. After that the filesize was still a lot less (158000) and it made no difference.

I've also tried the 'disable_keychain' variant but makes no difference.

Manually executing ./svnserve -d -r /my/path/to/repos always works.

Just starting with Launchd never works. I do see the following log line when executing svn list svn://127.0.0.1 :

11/10/10 7:42:47 PM org.tigris.subversion.svnserve[93334] launchproxy[93334]: /opt/local/bin/svnserve: Connection from: 127.0.0.1 on port: 51285 Which indicates that it al seems fine. Removing svnserve does cause launchd to log that it can't find svnserve so I know it is executing the right svnserve (as specified in the plist).

I have this problem on both my Mac's which are totally different (one is a server and the other a desktop ).

Do you have any suggestions as to which variant I might need to try?

Do you know of a way to let svnserve log something?

comment:8 Changed 10 years ago by reg@…

I'm sorry about the formatting of my post. I don't know how to fix that after I've submitted

comment:9 Changed 10 years ago by danielluke (Daniel J. Luke)

as of 1.6 svnserve should support --log-file - so you should be able to see if that gives you any additional information.

Just to get it working, you may want to try not using inetdCompatibility (svnserve -d −−foreground should work with launchd).

comment:10 Changed 10 years ago by reg@…

I've tried both your suggestions.

1) Adding --log-file did indeed cause a log file to be created but unfortunately empty, so not much info what the problem is but it does show that svnserve is indeed launched by launchd.

2) I've adapted my plist (I'll attach it as well) to start svnserve without inetdCompatibility and that does actually work. Svnserve gets lauched (not per request but once and stays running as expected in this mode) and does respond properly to the svn list command.

So it is still a mystery why only the Macport version of svnserve will not work with inetdCompatibility.

I now have 2 workarounds (use CollabNet prebuild binaries or use the Macport version without inetdCompatibility). You may close this ticket unless you are intrigued (as I am) by the fact that it doesn't work. If you want me to try something else just let me know.

Changed 10 years ago by reg@…

Launchd plist for svnserve without inetdCompatibility

comment:11 Changed 10 years ago by danielluke (Daniel J. Luke)

I'm not sure what else you could try that would be useful (as again, the macports version works fine for me in either inetd or 'regular' daemon mode).

If you're really curious, you could try building your own copy of svnserve from source and seeing if it behaves any differently.

You might also want to run 'otool -L' on the different svnserve binaries as they probably link to different libraries and that might point to where the problem is coming from.

comment:12 Changed 10 years ago by danielluke (Daniel J. Luke)

Resolution: worksforme
Status: newclosed

comment:13 Changed 9 years ago by macports@…

Just add the following key to your plist file

<key>SessionCreate</key> <true/>

Thanks should go to http://codesnippets.joyent.com/posts/show/303 http://www.devdaily.com/mac-os-x/launchd-examples-launchd-plist-file-examples-mac

Note: See TracTickets for help on using tickets.