Saturday, 25 April 2009

Step-by-step Subversion Server Setup on OpenSolaris

Step 1) Check and amend /etc/services

First things first: once logged in as a root, make a backup copy of your /etc/services file:

# cp /etc/inet/services /etc/inet/services.original

Note that on Open Solaris /etc/services is actually a symbolic link to /etc/inet/services.

Next, we should check whether the Subversion protocol has already been configured on this system:

# cat /etc/inet/services | grep 3690

The IANA has reserved port 3690 for the Subversion protocol, thus go on and add the following lines to /etc/inet/services file - in case they haven't been configured yet:

svn 3690/tcp # Subversion
svn 3690/udp # Subversion


Step 2) Import svnserve configuration into the Service Management Framework repository

OpenSolaris does not use the classic /etc/inetd.conf file anymore. Instead it uses the much enhanced Service Management Framework as the infrastructure to run services. As I did not intend to learn the inners of Services configuration I've opted to follow the traditional svnserve configuration through /etc/inetd.conf and later let smf import it to the repository via inetconv.

Start by making a backup copy of your /etc/inetd.conf file:

# cp /etc/inet/inetd.conf /etc/inet/inetd.conf.original

Note again that on OpenSolaris /etc/inetd.conf is actually a symbolic link to /etc/inet/inetd.conf.

Let's then add the svnserve configuration line to /etc/inetd.conf.

svn stream tcp nowait svnowner /usr/bin/svnserve svnserve -i -r /path/to/svn/repository


Lastly, we need to import the svnserver configuration added to /etc/inetd.conf into the smf repository. To accomplish this we use the inetconv utility:

# inetconv
svn -> /var/svc/manifest/network/svn-tcp.xml
Importing svn-tcp.xml ...Done


Once imported into smf's repository, all configuration changes should be made through the provided tools svccfg, svcadm and inetadm. The entry we've just add to /etc/inetd.conf has since become obsolete and should be removed to avoid confusion. As such we wrap this set up with basic housekeeping:

# mv /etc/inet/inetd.conf /etc/inet/inetd.conf.svnserve
# mv /etc/inet/inetd.conf.original /etc/inet/inetd.conf

That's it! If your repositories have been configured properly, you should have your svn server up'n'running. Enjoy.

References

OpenSolaris smf, svcadm, inetadm, svccfg and service_bundle info pages.

An alternative solution is presented here whereby a shell script mimics the platform's inetd.restarter.

Last but not least, the Subversion manual!

No comments:

Post a Comment