You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Jim Anderson <ja...@gmail.com> on 2008/07/20 14:58:11 UTC

problem creating Mac OS X launchd plist for svnserve

I've created the following plist, installed it as
com.subversion.svnserve.plist in /Library/LaunchDaemons as user root:wheel
<?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.subversion.svnserve</string>
     <key><Program></key>
          <string>/usr/bin/svnserve</string>
     <key>ProgramArguments</key>
     <array>
          <string>-i</string>
          <string>-r /Users/subversion/repos</string>
     </array>
     <key><UserName></key>
          <string>subversion</string>
     <key>inetdCompatibility</key>
     <dict>
          <key>Wait</key>
          <false/>
     </dict>
</dict>
</plist>

But when I try to install it using launchctl I get the following:

bash-3.2# launchctl load
/Library/LaunchDaemons/com.subversion.svnserve.plist
launchctl: propertyList is NULL
launchctl: no plist was returned for:
/Library/LaunchDaemons/com.subversion.svnserve.plist
launchctl: no plist was returned for:
/Library/LaunchDaemons/com.subversion.svnserve.plist
nothing found to load
bash-3.2#

Can anyone spot what I'm doing wrong?

Thanks,
Jim

Re: problem creating Mac OS X launchd plist for svnserve

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jul 20, 2008, at 09:58, Jim Anderson wrote:

> I've created the following plist, installed it as  
> com.subversion.svnserve.plist in /Library/LaunchDaemons as user  
> root:wheel
>
> <?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.subversion.svnserve</string>
>      <key><Program></key>

Use "Program", not "<Program>"

>           <string>/usr/bin/svnserve</string>
>      <key>ProgramArguments</key>
>      <array>
>           <string>-i</string>
>           <string>-r /Users/subversion/repos</string>
>      </array>
>      <key><UserName></key>

Use "UserName", not "<UserName>"

>           <string>subversion</string>
>      <key>inetdCompatibility</key>
>      <dict>
>           <key>Wait</key>
>           <false/>
>      </dict>
> </dict>
> </plist>
>
> But when I try to install it using launchctl I get the following:
>
> bash-3.2# launchctl load /Library/LaunchDaemons/ 
> com.subversion.svnserve.plist
> launchctl: propertyList is NULL
> launchctl: no plist was returned for: /Library/LaunchDaemons/ 
> com.subversion.svnserve.plist
> launchctl: no plist was returned for: /Library/LaunchDaemons/ 
> com.subversion.svnserve.plist
> nothing found to load
> bash-3.2#
>
> Can anyone spot what I'm doing wrong?

It's more a question of how to write launchd plists, of course, which  
the members of this list probably aren't experts on. I can't get  
svnserve to start, even making the above changes. But I'm not a  
launchd plist expert either. :) Consult "man launchd.plist" or a Mac  
OS X mailing list.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: problem creating Mac OS X launchd plist for svnserve

Posted by Quinn Taylor <qu...@mac.com>.
> I've created the following plist, installed it as  
> com.subversion.svnserve.plist in /Library/LaunchDaemons as user  
> root:wheel
>
> ...
>
> But when I try to install it using launchctl I get the following:
>
> bash-3.2# launchctl load /Library/LaunchDaemons/ 
> com.subversion.svnserve.plist
> launchctl: propertyList is NULL
> launchctl: no plist was returned for: /Library/LaunchDaemons/ 
> com.subversion.svnserve.plist
> launchctl: no plist was returned for: /Library/LaunchDaemons/ 
> com.subversion.svnserve.plist
> nothing found to load
> bash-3.2#
>
> Can anyone spot what I'm doing wrong?
>
> Thanks,
> Jim



Jim —

I fought with launchd and Subversion last summer while interning at  
Apple, so I had the resources to fix it a little closer at hand....  ;-)

IIRC, the Program and ProgramArgument keys are mutually exclusive—if  
you use the latter, the first array element must be the executable name.

Also, in the name of correct style, I would suggest naming the plist  
file org.tigris.subversion.svnserve.plist instead, using proper  
reverse-DNS naming.

Here is my launchd file, also installed in /Library/LaunchDaemons/,  
belongs to root:wheel, and is loaded using `launchctl load  
org.tigris.subversion.svnserve.plist`.

<?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>org.tigris.subversion.svnserve</string>
	<key>ServiceDescription</key>
	<string>Publish SVN repositories using svn:// schema.</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/bin/svnserve</string>
		<string>--inetd</string>
		<string>--root=/svn</string>
	</array>
	<key>GroupName</key>
	<string>admin</string>
	<key>UserName</key>
	<string>quinn</string>
	<key>OnDemand</key>
	<true/>
	<key>Disabled</key>
	<false/>
	<key>inetdCompatibility</key>
	<dict>
		<key>Wait</key>
		<false/>
	</dict>
	<key>Sockets</key>
	<dict>
		<key>Listeners</key>
		<dict>
			<key>Bonjour</key>
			<true/>
			<key>SockServiceName</key>
			<string>svn</string>
		</dict>
	</dict>
</dict>
</plist>

Note the section under the Sockets key, which I think was necessary to  
get it to work correctly. Also, I used the OnDemand key so launchctl  
only runs svnserve when someone actually performs a Subversion action.  
(This is one really nice thing about launchd, in that you can save CPU  
cycles and memory that an unused executable might otherwise consume.)  
You'll find you don't even need a subversion user—my user is a machine  
administrator, and it works just fine.

HTH,
  - Quinn Taylor