PageRenderTime 50ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/App/adminguide/cvs.pod

https://github.com/gitpan/App-Context
Perl | 238 lines | 174 code | 61 blank | 3 comment | 7 complexity | 15776635b10bb1ae0fb6a0e01baac570 MD5 | raw file
  1. #!perl -w
  2. # run this document through perl to check its syntax
  3. use Pod::Checker;
  4. podchecker(\*DATA);
  5. __END__
  6. =head1 NAME
  7. App::adminguide::cvs - Administration Guide for CVS
  8. =head1 DESCRIPTION
  9. The following is a list of installation stories for installing CVS correctly.
  10. =head1 REFERENCES
  11. CVS Home Page
  12. - https://www.cvshome.org/
  13. Configuration of xinetd
  14. - http://www.sugoi.org/bits/index.php?bit_id=32
  15. =head1 CVS INSTALLATION : 2004-08-06 : REDHAT LINUX
  16. I wanted to move a CVS installation from a server we were
  17. decommissioning to a new server, and I wanted to get two
  18. things right this time (which I had neglected the first
  19. time around).
  20. * cvspserver not running as root
  21. * cvs using a CVS passwd file, not /etc/passwd
  22. Furthermore, the old installation was on Solaris 2.7 which
  23. used an inetd configuration. My new installation would
  24. by on RedHat Linux 9 (2.4.21 kernel).
  25. =head2 CVS software installation
  26. I checked the version of CVS installed on the system.
  27. cvs --version
  28. rpm -q cvs
  29. and found I had version 1.11.2 installed.
  30. I checked the CVS home page, and it alerted me to a
  31. vulnerability in CVS if this were exposed to the
  32. internet (which I had some sense I might do).
  33. http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0396
  34. So I had to install 1.11.16 or greater (1.11 series) or 1.12.8
  35. or greater (1.12 series). The latest releases are 1.12.9 and
  36. 1.11.17. I decided to go with an rpm installation rather than
  37. a source-based installation. I decided to go with the 1.11
  38. series, which cvshome.org says is the "stable" version rather
  39. than the 1.12 version which cvshome.org says is an incremental
  40. feature version.
  41. su -
  42. cd /root
  43. mkdir rpm
  44. cd rpm
  45. wget ftp://rpmfind.net/linux/fedora/core/updates/2/i386/cvs-1.11.17-2.i386.rpm
  46. rpm --upgrade cvs-1.11.17-2.i386.rpm
  47. But then "cvs --version" caused the following error.
  48. cvs: relocation error: cvs: undefined symbol: GSS_C_NT_HOSTBASED_SERVICE
  49. So I decided to go with the RPM from cvshome.org rather than from Fedora.
  50. wget https://ccvs.cvshome.org/files/documents/19/360/cvs-1.11.17-1.i386.rpm
  51. rpm --upgrade cvs-1.11.17-1.i386.rpm
  52. This gave me the following error.
  53. package cvs-1.11.17-2 (which is newer than cvs-1.11.17-1) is already installed
  54. So I did
  55. rpm --upgrade --force cvs-1.11.17-1.i386.rpm
  56. and that did the trick, as verified by
  57. rpm -q cvs
  58. cvs --version
  59. If that had not worked, I would have compiled my own version from
  60. sources, but I would have to be sure to use ./configure --prefix=/usr
  61. so that the binaries would overwrite the installed binaries rather
  62. than creating another version in /usr/local.
  63. Somewhere else I read that I need to set the setgid bit on the
  64. cvs binary.
  65. chmod 2755 /usr/bin/cvs
  66. =head2 Users and Groups
  67. We use NIS, so I verified that we have both the cvs user and group
  68. defined.
  69. ypcat passwd | grep cvs
  70. ypcat group | grep cvs
  71. Otherwise, I would have verified that in the /etc/passwd and
  72. /etc/group files and created them if necessary.
  73. =head2 CVSROOT
  74. I chose /usr/mycompany/cvs (where "mycompany" is replaced with a
  75. name for our company) for all CVS files (i.e. CVSROOT).
  76. cd /usr/mycompany
  77. mkdir cvs
  78. chown cvs cvs
  79. chgrp cvs cvs
  80. chmod 775 cvs
  81. chmod g+s cvs
  82. We use Bash and Korn shell, so I added the following lines to
  83. "/etc/profile" so that the CVSROOT variable is available to all
  84. users.
  85. CVSROOT=/usr/mycompany/cvs
  86. export CVSROOT
  87. Then I ran the same commands in my current shell to set CVSROOT for
  88. the current session.
  89. =head2 Initializing the CVS Repository
  90. I initialized the CVS Repository (/usr/mycompany/cvs).
  91. su - cvs
  92. cvs init
  93. Then I created the CVS password file.
  94. cd ~
  95. mkdir src
  96. cd src
  97. cvs co CVSROOT
  98. cd CVSROOT
  99. touch passwd
  100. cvs add passwd
  101. cvs update
  102. cvs commit -m "new" passwd
  103. vi checkoutlist
  104. # add "passwd" as the last line
  105. cvs commit -m "added passwd to list of CVSROOT files" checkoutlist
  106. Then exit as the "cvs" user.
  107. exit
  108. =head2 Installing cvspasswd and adding users
  109. I got it from here.
  110. http://www.sugoi.org/bits/download/cvspasswd
  111. But I put it in a distribution on CPAN called App-admin.
  112. So you can install it this way.
  113. perl -MCPAN -e "install App-admin"
  114. In any case, make sure it is in your path (i.e. /usr/local/bin).
  115. Then add users.
  116. cvspasswd joe joespw7
  117. cvspasswd mike m1k31sgr3a7
  118. cvspasswd nellie whoa_
  119. =head2 Configure xinetd
  120. On Solaris, I just needed to add a line to /etc/inetd.conf which
  121. looked like this. (This configures "inetd", the internetworking daemon.)
  122. cvspserver stream tcp nowait root /usr/bin/cvs cvs --allow-root=/usr/mycompany/cvs pserver
  123. However, on Linux I have to configure xinetd (an enhanced version of
  124. "inetd").
  125. cd /etc/xinetd.d
  126. vi cvs
  127. I put the following in the file, with my server's actual
  128. IP address instead of "10.10.10.10".
  129. service cvspserver
  130. {
  131. disable = no
  132. socket_type = stream
  133. wait = no
  134. user = cvs
  135. group = cvs
  136. log_type = FILE /var/log/cvspserver
  137. protocol = tcp
  138. env = '$HOME=/usr/mycompany/cvs'
  139. bind = 10.10.10.10
  140. log_on_failure += USERID
  141. port = 2401
  142. server = /usr/bin/cvs
  143. server_args = -f --allow-root=/usr/mycompany/cvs pserver
  144. }
  145. Then I restart xinetd.
  146. pkill -HUP xinetd
  147. =head2 Verification
  148. Then I went to another server on the network.
  149. cd ~
  150. mkdir src
  151. cd src
  152. cvs -d :pserver:mike@cvshost:/usr/mycompany/cvs login
  153. cvs -d :pserver:mike@cvshost:/usr/mycompany/cvs co CVSROOT
  154. # it worked great, so I can remove it ...
  155. rm -rf CVSROOT
  156. =head2 Moving the CVS data
  157. I now had to move the data from my old CVS server.
  158. ssh oldcvshost
  159. su -
  160. cd /usr/mycompany/cvs
  161. find project1 project2 project3 -print | cpio -ocv | gzip > cvs.cpio.gz
  162. scp cvs.cpio.gz mike@cvshost:.
  163. ssh mike@cvshost
  164. su -
  165. cd /usr/mycompany/cvs
  166. mv ~mike/cvs.cpio.gz .
  167. gunzip < cvs.cpio.gz | cpio -idcuvm