Wednesday, September 22, 2010

CVS Setup for in 5 minutes or less

This is express cvs setup for SLES( not much different for Unix/Linux varients ):

A:: As ROOT
1. Install the cvs ( binary / compile from source ).
2. Define CVS environment variables in your  /etc/profile  , if you are root, or edit your  own ~/.bashrc  file, 
    if needed, to include the following two lines:

export CVSROOT=/home/cvs
export EDITOR=/bin/vi

If omited the second line, vi will be the editor used by default.

3. If you wish to have files made read-only after checking them in, define:
bash# export CVSREAD=yes

4. Initialize CVS repository:
bash# cvs -d $CVSROOT init

5. Create a CVS repository on CVS server with appropriate rights:

bash# groupadd cvs

# create cvs group
bash# useradd -g cvs -d $CVSROOT cvs

bash# chgrp -R cvs $CVSROOT

bash# chmod o-rwx  $CVSROOT

bash# chmod ug+rwx $CVSROOT

6. Allow selected users to access repository

bash# usermod -G cvs your_user_name
bash# usermod -G cvs some_other_user

B:: As your_Normal_User
7. If environment variables CVSROOT and EDITOR are not defined, you need to set them up yourself. For Linux, in  ~/.bashrc define :
export CVSROOT=/home/cvsrep
export EDITOR=/bin/vi
8. First, you may want to export files into the repository. Given you have directory, YourAppDir, with files you want under cvs control. 
bash$ newgrp cvs
bash$ cd ~/YourAppDir
bash$ cvs import srcDir vname vrel

This imports all the files in ~/YourAppDir and places them in YourAppDir module under CVS. vname and vrel are vendor name and vendor release ids. They are required, but can be any value, usually related to vendor values (vrel has no relation to the CVS version numbers).

9. You now have your code under CVS. To see that, enter the command:
bash$ ls $CVSROOT/

YourAppDir


Now, you must get your files out: 
bash$ cd ~                            # recall code is in ~/

YourAppDir



bash$ cvs checkout 

YourAppDir


This command checks out all the code in CVS module 

YourAppDir

.
Since you are in the parent directory containing 

YourAppDir

,
the contents of 

YourAppDir

 are overwritten by what is in CVS.

B:: As ROOT

To make the service available to be used:
Under SuSE 9.0 and RedHat 8.0, edit the file /etc/xinitd.d/cvs to contain:
Under SLES 10 edit /etc/xinetd.d/cvs 

======================================

service cvspserver

{
  server      = /usr/bin/cvs
  server_args = -f –allow-root=/home/cvsrep pserver
  port        = 2401
# default
  socket_type = stream
# default
  wait        = no
# default
  user        = root
# default
  passenv     = PATH
# default
}

======================================

Restart xinetd (need to be root) using:

bash# /etc/init.d/xinetd restart

Usually the configuration is finish here ... check this if yours is not working 


Under most Linuxs, insert in /etc/services:

cvspserver 2401/tcp

If not using tcpwrappers, insert in /etc/inetd.conf:

cvspserver stream tcp nowait root /usr/bin/cvs \
-–allow-root=/home/cvsrep pserver

If using tcpwrappers, insert in /etc/inetd.conf:

cvspserver stream tcp nowait root /usr/sbin/tcpd \
/usr/bin/cvs -–allow-root=/home/cvsrep pserver

Restart inetd as root:

bash# /etc/init.d/inetd restart

That all:: this is minimum configuration to make it work. 
Please read the documentations for details.


















Centos 7 reset root/ any user lost password / lockout due to cant remember password

1. Need to be in front of the terminal. (Physically if not vm). 2. Reboot the server 3. Press 'e' in the GRUB2 boot screen. 3. bunch...