先下載安裝cvs,baidu一下Solaris 10 cvs。
然后:
#vi /etc/services
cvspserver 2401/tcp #cvs server tcp port
#
#
#vi /etc/inetd.conf
cvspserver stream tcp nowait root /usr/local/cvs/bin/cvs cvs --allow-root=/export/home/cvs pserver
# inetconv -i /etc/inetd.conf
inetconv: 通知: 100235/1 的服務(wù)清單已生成為 /var/svc/manifest/network/rpc/100235_1-rpc_ticotsord.xml,跳過
inetconv: 通知: cvspserver 的服務(wù)清單已生成為 /var/svc/manifest/network/cvspserver-tcp.xml,跳過
# ls -la /var/svc/manifest/network/cvspserver-tcp.xml
-rw-r--r-- 1 root root 2408 6月 9日 11:04 /var/svc/manifest/network/cvspserver-tcp.xml
# rm /var/svc/manifest/network/cvspserver-tcp.xml
# ls -la /var/svc/manifest/network/cvspserver-tcp.xml
/var/svc/manifest/network/cvspserver-tcp.xml: 無此文件或目錄
# inetconv -i /etc/inetd.conf
inetconv: 通知: 100235/1 的服務(wù)清單已生成為 /var/svc/manifest/network/rpc/100235_1-rpc_ticotsord.xml,跳過
cvspserver -> /var/svc/manifest/network/cvspserver-tcp.xml
正在導(dǎo)入 cvspserver-tcp.xml...完成
# ls -la /var/svc/manifest/network/cvspserver-tcp.xml
-rw-r--r-- 1 root root 2351 6月 9日 11:30 /var/svc/manifest/network/cvspserver-tcp.xml
# svcs restart svc:/network/inetd:default
svcs: 模式 'restart' 與所有實例都不匹配
STATE STIME FMRI
online 6月_07 svc:/network/inetd:default
# cd /var/svc
# ls
log manifest profile
# cd manifest/
# ls
application device milestone network platform site system
# cd network/
# ls
apocd.xml http-apache2.xml nfs ssh.xml
cde-spc.xml inetd-upgrade.xml nis ssl
chargen.xml inetd.xml ntp.xml stdiscover.xml
comsat.xml ipfilter.xml pfil.xml stlisten.xml
cvspserver-tcp.xml ipmievd.xml rarp.xml swat.xml
daytime.xml iscsi_initiator.xml rexec.xml talk.xml
dhcp-server.xml ldap routing telnet.xml
discard.xml login.xml rpc time.xml
dns network-initial.xml samba.xml tname.xml
echo.xml network-loopback.xml security uucp.xml
finger.xml network-physical.xml shell.xml winbind.xml
forwarding.xml network-routing-setup.xml slp.xml wins.xml
ftp.xml network-service.xml smtp-sendmail.xml
# vi /var/svc/profile/inetd_services.xml
?xml version='1.0'?>
!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
!--
Copyright 2004 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
ident "@(#)inetd_upgrade.xml 1.1 04/12/06 SMI"
Service profile to enable inetd services following upgrade.
No services are listed because the inetd-upgrade service takes care
of any required enables on upgrade.
NOTE: Service profiles delivered by this package are not editable,
and their contents will be overwritten by package or patch
operations, including operating system upgrade. Make customizations
in a distinct file.
-->
service_bundle type='profile' name='default'>
/service_bundle>
service name='network/cvspserver-tcp' version='1' type='service'>
instance name='default' enabled='true'/>
/service>
# ls -la /export/home/cvs
總數(shù) 14
drwxrwxr-x 2 cvsadmin cvsadmin 512 6月 7日 16:50 .
drwxr-xr-x 6 root root 512 6月 7日 11:54 ..
-rw------- 1 cvsadmin cvsadmin 14 6月 7日 16:50 .bash_history
-rw-r--r-- 1 cvsadmin cvsadmin 144 6月 7日 11:54 .profile
-rw-r--r-- 1 cvsadmin cvsadmin 136 6月 7日 11:54 local.cshrc
-rw-r--r-- 1 cvsadmin cvsadmin 157 6月 7日 11:54 local.login
-rw-r--r-- 1 cvsadmin cvsadmin 174 6月 7日 11:54 local.profile
#
#
#
# svccfg import /var/svc/manifest/network/cvspserver-tcp.xml
# svccfg disable svc:/network/cvspserver/tcp:default
svccfg: 未知命令 "disable"。
# svccfg enable svc:/network/cvspserver/tcp:default
svccfg: 未知命令 "enable"。
# svcadm enable svc:/network/cvspserver/tcp:default
#
#
# netstat -an | grep cvx
# netstat -an | grep cvs
#
#
#
# inetadm | grep cvs
enabled online svc:/network/cvspserver/tcp:default
#
#
# telnet localhost 2401
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
eh;
cvs [pserver aborted]: bad auth protocol start: eh;
Connection to localhost closed by foreign host.
#
# su - cvsadmin
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
-bash-3.00$
-bash-3.00$ cvs inin
-bash: cvs: command not found
-bash-3.00$ cvs init
-bash: cvs: command not found
-bash-3.00$ cd /usr/local/cvs/bin/
-bash-3.00$ ls
cvs cvsbug rcs2log
-bash-3.00$ ./cvs init
cvs init: No CVSROOT specified! Please use the `-d' option
cvs [init aborted]: or set the CVSROOT environment variable.
-bash-3.00$ ./cvs
Usage: cvs [cvs-options] command [command-options-and-arguments]
where cvs-options are -q, -n, etc.
(specify --help-options for a list of options)
where command is add, admin, etc.
(specify --help-commands for a list of commands
or --help-synonyms for a list of command synonyms)
where command-options-and-arguments depend on the specific command
(specify -H followed by a command name for command-specific help)
Specify --help to receive this message
The Concurrent Versions System (CVS) is a tool for version control.
For CVS updates and additional information, see
the CVS home page at http://www.nongnu.org/cvs/ or
the CVSNT home page at http://www.cvsnt.org/
-bash-3.00$ ./cvs -d /export/home/cvs init
-bash-3.00$ ls /export/home/cvs/
CVSROOT local.cshrc local.login local.profile
-bash-3.00$ ls /export/home/cvs/CVSROOT/
Emptydir config loginfo notify,v posttag preproxy,v val-tags
checkoutlist config,v loginfo,v postadmin posttag,v rcsinfo verifymsg
checkoutlist,v cvswrappers modules postadmin,v postwatch rcsinfo,v verifymsg,v
commitinfo cvswrappers,v modules,v postproxy postwatch,v taginfo
commitinfo,v history notify postproxy,v preproxy taginfo,v
-bash-3.00$ ./cvs -d :pserver:cvsadmin@localhost:/export/home/cvs/CVSROOT/ login
Logging in to :pserver:cvsadmin@localhost:2401/export/home/cvs/CVSROOT
CVS password:
cvs [login aborted]: unrecognized auth response from localhost: cvs [pserver aborted]: /export/home/cvs/CVSROOT: no such repository
-bash-3.00$ ./cvs -d :pserver:cvsadmin@localhost:/export/home/cvs/CVSROOT/ login
Logging in to :pserver:cvsadmin@localhost:2401/export/home/cvs/CVSROOT
CVS password:
cvs [login aborted]: unrecognized auth response from localhost: cvs [pserver aborted]: /export/home/cvs/CVSROOT: no such repository
-bash-3.00$ exit
logout
#
#
#
#
# passwd cvsadmin
新口令:
請重新輸入新口令:
passwd:cvsadmin 的口令已成功更改
# su - cvsadmin
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
-bash-3.00$ ./cvs -d :pserver:cvsadmin@localhost:/export/home/cvs/CVSROOT/ login
-bash: ./cvs: 無此文件或目錄
-bash-3.00$ cd /usr/local/cvs/bin/
-bash-3.00$ ls
cvs cvsbug rcs2log
-bash-3.00$ ./cvs -d :pserver:cvsadmin@localhost:/export/home/cvs/CVSROOT/ login
Logging in to :pserver:cvsadmin@localhost:2401/export/home/cvs/CVSROOT
CVS password:
cvs [login aborted]: unrecognized auth response from localhost: cvs [pserver aborted]: /export/home/cvs/CVSROOT: no such repository
-bash-3.00$ clear
-bash-3.00$ more /var/svc/profile/inetd_services.xml
?xml version='1.0'?>
!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
!--
Copyright 2004 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
ident "@(#)inetd_upgrade.xml 1.1 04/12/06 SMI"
Service profile to enable inetd services following upgrade.
No services are listed because the inetd-upgrade service takes care
of any required enables on upgrade.
NOTE: Service profiles delivered by this package are not editable,
and their contents will be overwritten by package or patch
operations, including operating system upgrade. Make customizations
in a distinct file.
-->
service_bundle type='profile' name='default'>
/service_bundle>
service name='network/cvspserver-tcp' version='1' type='service'>
instance name='default' enabled='true'/>
/service>
-bash-3.00$ ./cvs
Usage: cvs [cvs-options] command [command-options-and-arguments]
where cvs-options are -q, -n, etc.
(specify --help-options for a list of options)
where command is add, admin, etc.
(specify --help-commands for a list of commands
or --help-synonyms for a list of command synonyms)
where command-options-and-arguments depend on the specific command
(specify -H followed by a command name for command-specific help)
Specify --help to receive this message
The Concurrent Versions System (CVS) is a tool for version control.
For CVS updates and additional information, see
the CVS home page at http://www.nongnu.org/cvs/ or
the CVSNT home page at http://www.cvsnt.org/
-bash-3.00$
-bash-3.00$
-bash-3.00$
-bash-3.00$ exit
logout
# pwd
/var/svc/manifest/network
# more /etc/shadow
root:Onl9TThtB/duY:13984::::::
daemon:NP:6445::::::
bin:NP:6445::::::
sys:NP:6445::::::
adm:NP:6445::::::
lp:NP:6445::::::
uucp:NP:6445::::::
nuucp:NP:6445::::::
smmsp:NP:6445::::::
listen:*LK*:::::::
gdm:*LK*:::::::
webservd:*LK*:::::::
postgres:NP:::::::
svctag:*LK*:6445::::::
nobody:*LK*:6445::::::
noaccess:*LK*:6445::::::
nobody4:*LK*:6445::::::
mysql:*LK*:::::::
cvsadmin:O0QcwHtwGHAO2:14039::::::
# echo "cvsadmin:O0QcwHtwGHAO2" > /export/home/cvs/CVSROOT/passwd
# cvs -d :pserver:cvsadmin@localhost:2401/export/home/cvs login
bash: cvs: command not found
# cd /usr/local/cvs/bin/
# cvs -d :pserver:cvsadmin@localhost:2401/export/home/cvs login
bash: cvs: command not found
# ./cvs -d :pserver:cvsadmin@localhost:2401/export/home/cvs login
Logging in to :pserver:cvsadmin@localhost:2401/export/home/cvs
CVS password:
cvs login: warning: failed to open /export/home/guo/.cvspass for reading: No such file or directory
# exit
exit
# exit
$ exit
Last login: Mon Jun 9 13:54:00 2008 from 59.67.1.188
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
-bash-3.00$ su root
口令:
# bash
# cd /usr/local/cvs/bin
# ls
cvs cvsbug rcs2log
# ./cvs -d :pserver:cvsadmin@localhost:2401/export/home/cvs login
Logging in to :pserver:cvsadmin@localhost:2401/export/home/cvs
CVS password:
cvs login: warning: failed to open /export/home/cvs/.cvspass for reading: No such file or directory
# ./cvs -d :pserver:cvsadmin@localhost:2401/export/home/cvs/CVSROOT login
Logging in to :pserver:cvsadmin@localhost:2401/export/home/cvs/CVSROOT
CVS password:
cvs [login aborted]: unrecognized auth response from localhost: cvs [pserver aborted]: /export/home/cvs/CVSROOT: no such repository
# exit
exit
# exit
-bash-3.00$
-bash-3.00$
-bash-3.00$ ls
CVSROOT local.cshrc local.login local.profile
-bash-3.00$ pwd
/export/home/cvs
-bash-3.00$ ls -la
總數(shù) 18
drwxrwxr-x 3 cvsadmin cvsadmin 512 6月 9日 13:55 .
drwxr-xr-x 6 root root 512 6月 7日 11:54 ..
-rw------- 1 cvsadmin cvsadmin 688 6月 9日 13:56 .bash_history
-rw------- 1 root root 63 6月 9日 13:55 .cvspass
-rw-r--r-- 1 cvsadmin cvsadmin 144 6月 7日 11:54 .profile
drwxrwxr-x 3 cvsadmin cvsadmin 1024 6月 9日 13:51 CVSROOT
-rw-r--r-- 1 cvsadmin cvsadmin 136 6月 7日 11:54 local.cshrc
-rw-r--r-- 1 cvsadmin cvsadmin 157 6月 7日 11:54 local.login
-rw-r--r-- 1 cvsadmin cvsadmin 174 6月 7日 11:54 local.profile
-bash-3.00$ cd CVSROOT/
-bash-3.00$ ls -la
總數(shù) 182
drwxrwxr-x 3 cvsadmin cvsadmin 1024 6月 9日 13:51 .
-rw-rw-r-- 1 cvsadmin cvsadmin 495 6月 9日 11:52 .#checkoutlist
-rw-rw-r-- 1 cvsadmin cvsadmin 1232 6月 9日 11:52 .#commitinfo
-rw-rw-r-- 1 cvsadmin cvsadmin 4082 6月 9日 11:52 .#config
-rw-rw-r-- 1 cvsadmin cvsadmin 602 6月 9日 11:52 .#cvswrappers
-rw-rw-r-- 1 cvsadmin cvsadmin 1872 6月 9日 11:52 .#loginfo
-rw-rw-r-- 1 cvsadmin cvsadmin 1151 6月 9日 11:52 .#modules
-rw-rw-r-- 1 cvsadmin cvsadmin 876 6月 9日 11:52 .#notify
-rw-rw-r-- 1 cvsadmin cvsadmin 922 6月 9日 11:52 .#postadmin
-rw-rw-r-- 1 cvsadmin cvsadmin 1105 6月 9日 11:52 .#postproxy
-rw-rw-r-- 1 cvsadmin cvsadmin 1898 6月 9日 11:52 .#posttag
-rw-rw-r-- 1 cvsadmin cvsadmin 957 6月 9日 11:52 .#postwatch
-rw-rw-r-- 1 cvsadmin cvsadmin 1203 6月 9日 11:52 .#preproxy
-rw-rw-r-- 1 cvsadmin cvsadmin 649 6月 9日 11:52 .#rcsinfo
-rw-rw-r-- 1 cvsadmin cvsadmin 2255 6月 9日 11:52 .#taginfo
-rw-rw-r-- 1 cvsadmin cvsadmin 1481 6月 9日 11:52 .#verifymsg
drwxrwxr-x 3 cvsadmin cvsadmin 512 6月 9日 13:55 ..
drwxrwxr-x 2 cvsadmin cvsadmin 512 6月 9日 11:52 Emptydir
-r--r--r-- 1 cvsadmin cvsadmin 495 6月 9日 11:52 checkoutlist
-r--r--r-- 1 cvsadmin cvsadmin 733 6月 9日 11:52 checkoutlist,v
-r--r--r-- 1 cvsadmin cvsadmin 1232 6月 9日 11:52 commitinfo
-r--r--r-- 1 cvsadmin cvsadmin 1470 6月 9日 11:52 commitinfo,v
-r--r--r-- 1 cvsadmin cvsadmin 4082 6月 9日 11:52 config
-r--r--r-- 1 cvsadmin cvsadmin 4320 6月 9日 11:52 config,v
-r--r--r-- 1 cvsadmin cvsadmin 602 6月 9日 11:52 cvswrappers
-r--r--r-- 1 cvsadmin cvsadmin 840 6月 9日 11:52 cvswrappers,v
-rw-rw-rw- 1 cvsadmin cvsadmin 0 6月 9日 11:52 history
-r--r--r-- 1 cvsadmin cvsadmin 1872 6月 9日 11:52 loginfo
-r--r--r-- 1 cvsadmin cvsadmin 2110 6月 9日 11:52 loginfo,v
-r--r--r-- 1 cvsadmin cvsadmin 1151 6月 9日 11:52 modules
-r--r--r-- 1 cvsadmin cvsadmin 1389 6月 9日 11:52 modules,v
-r--r--r-- 1 cvsadmin cvsadmin 876 6月 9日 11:52 notify
-r--r--r-- 1 cvsadmin cvsadmin 1114 6月 9日 11:52 notify,v
-rw-r--r-- 1 root root 23 6月 9日 13:51 passwd
-r--r--r-- 1 cvsadmin cvsadmin 922 6月 9日 11:52 postadmin
-r--r--r-- 1 cvsadmin cvsadmin 1160 6月 9日 11:52 postadmin,v
-r--r--r-- 1 cvsadmin cvsadmin 1105 6月 9日 11:52 postproxy
-r--r--r-- 1 cvsadmin cvsadmin 1343 6月 9日 11:52 postproxy,v
-r--r--r-- 1 cvsadmin cvsadmin 1898 6月 9日 11:52 posttag
-r--r--r-- 1 cvsadmin cvsadmin 2136 6月 9日 11:52 posttag,v
-r--r--r-- 1 cvsadmin cvsadmin 957 6月 9日 11:52 postwatch
-r--r--r-- 1 cvsadmin cvsadmin 1195 6月 9日 11:52 postwatch,v
-r--r--r-- 1 cvsadmin cvsadmin 1203 6月 9日 11:52 preproxy
-r--r--r-- 1 cvsadmin cvsadmin 1441 6月 9日 11:52 preproxy,v
-r--r--r-- 1 cvsadmin cvsadmin 649 6月 9日 11:52 rcsinfo
-r--r--r-- 1 cvsadmin cvsadmin 887 6月 9日 11:52 rcsinfo,v
-r--r--r-- 1 cvsadmin cvsadmin 2255 6月 9日 11:52 taginfo
-r--r--r-- 1 cvsadmin cvsadmin 2493 6月 9日 11:52 taginfo,v
-rw-rw-rw- 1 cvsadmin cvsadmin 0 6月 9日 11:52 val-tags
-r--r--r-- 1 cvsadmin cvsadmin 1481 6月 9日 11:52 verifymsg
-r--r--r-- 1 cvsadmin cvsadmin 1719 6月 9日 11:52 verifymsg,v
-bash-3.00$ pwd
/export/home/cvs/CVSROOT
-bash-3.00$ cd ..
-bash-3.00$ ls
CVSROOT local.cshrc local.login local.profile
-bash-3.00$ mkdir project
-bash-3.00$ ls
CVSROOT local.cshrc local.login local.profile project
-bash-3.00$ ls -la
總數(shù) 20
drwxrwxr-x 4 cvsadmin cvsadmin 512 6月 9日 14:01 .
drwxr-xr-x 6 root root 512 6月 7日 11:54 ..
-rw------- 1 cvsadmin cvsadmin 688 6月 9日 13:56 .bash_history
-rw------- 1 root root 63 6月 9日 13:55 .cvspass
-rw-r--r-- 1 cvsadmin cvsadmin 144 6月 7日 11:54 .profile
drwxrwxr-x 3 cvsadmin cvsadmin 1024 6月 9日 13:51 CVSROOT
-rw-r--r-- 1 cvsadmin cvsadmin 136 6月 7日 11:54 local.cshrc
-rw-r--r-- 1 cvsadmin cvsadmin 157 6月 7日 11:54 local.login
-rw-r--r-- 1 cvsadmin cvsadmin 174 6月 7日 11:54 local.profile
drwxr-xr-x 2 cvsadmin cvsadmin 512 6月 9日 14:01 project
-bash-3.00$ /usr/local/cvs/bin/cvs -d
/usr/local/cvs/bin/cvs: option requires an argument -- d
Usage: cvs [cvs-options] command [command-options-and-arguments]
where cvs-options are -q, -n, etc.
(specify --help-options for a list of options)
where command is add, admin, etc.
(specify --help-commands for a list of commands
or --help-synonyms for a list of command synonyms)
where command-options-and-arguments depend on the specific command
(specify -H followed by a command name for command-specific help)
Specify --help to receive this message
The Concurrent Versions System (CVS) is a tool for version control.
For CVS updates and additional information, see
the CVS home page at http://www.nongnu.org/cvs/ or
the CVSNT home page at http://www.cvsnt.org/
-bash-3.00$ /usr/local/cvs/bin/cvs -d /export/home/cvs/ import -m "log msg" project www.guoyiyang.com start
cvs [import aborted]: tag `www.guoyiyang.com' must not contain the characters `$,.:;@'
-bash-3.00$ /usr/local/cvs/bin/cvs -d /export/home/cvs/ import -m "log msg" project test start
cvs [import aborted]: attempt to import the repository
-bash-3.00$ /usr/local/cvs/bin/cvs -d :pserver:cvsadmin@localhost:2401/export/home/cvs login
Logging in to :pserver:cvsadmin@localhost:2401/export/home/cvs
CVS password:
cvs login: warning: failed to open /export/home/cvs/.cvspass for reading: Permission denied
cvs [login aborted]: could not open /export/home/cvs/.cvspass for writing: Permission denied
-bash-3.00$ pwd
/export/home/cvs
-bash-3.00$ ls -la
總數(shù) 20
drwxrwxr-x 4 cvsadmin cvsadmin 512 6月 9日 14:01 .
drwxr-xr-x 6 root root 512 6月 7日 11:54 ..
-rw------- 1 cvsadmin cvsadmin 688 6月 9日 13:56 .bash_history
-rw------- 1 root root 63 6月 9日 13:55 .cvspass
-rw-r--r-- 1 cvsadmin cvsadmin 144 6月 7日 11:54 .profile
drwxrwxr-x 3 cvsadmin cvsadmin 1024 6月 9日 13:51 CVSROOT
-rw-r--r-- 1 cvsadmin cvsadmin 136 6月 7日 11:54 local.cshrc
-rw-r--r-- 1 cvsadmin cvsadmin 157 6月 7日 11:54 local.login
-rw-r--r-- 1 cvsadmin cvsadmin 174 6月 7日 11:54 local.profile
drwxr-xr-x 2 cvsadmin cvsadmin 512 6月 9日 14:01 project
-bash-3.00$ chgrp cvsadmin .cvspass
chgrp: .cvspass: 不是所有者
-bash-3.00$ su root
口令:
# pw
pw: 沒找到
# pwd
/export/home/cvs
# bash
# ls
CVSROOT local.cshrc local.login local.profile project
# ls -la
總數(shù) 20
drwxrwxr-x 4 cvsadmin cvsadmin 512 6月 9日 14:01 .
drwxr-xr-x 6 root root 512 6月 7日 11:54 ..
-rw------- 1 cvsadmin cvsadmin 688 6月 9日 13:56 .bash_history
-rw------- 1 root root 63 6月 9日 13:55 .cvspass
-rw-r--r-- 1 cvsadmin cvsadmin 144 6月 7日 11:54 .profile
drwxrwxr-x 3 cvsadmin cvsadmin 1024 6月 9日 13:51 CVSROOT
-rw-r--r-- 1 cvsadmin cvsadmin 136 6月 7日 11:54 local.cshrc
-rw-r--r-- 1 cvsadmin cvsadmin 157 6月 7日 11:54 local.login
-rw-r--r-- 1 cvsadmin cvsadmin 174 6月 7日 11:54 local.profile
drwxr-xr-x 2 cvsadmin cvsadmin 512 6月 9日 14:01 project
# chgrp cvsadmin .cvspass
# chown cvsadmin .cvspass
# ls -la
總數(shù) 20
drwxrwxr-x 4 cvsadmin cvsadmin 512 6月 9日 14:01 .
drwxr-xr-x 6 root root 512 6月 7日 11:54 ..
-rw------- 1 cvsadmin cvsadmin 688 6月 9日 13:56 .bash_history
-rw------- 1 cvsadmin cvsadmin 63 6月 9日 13:55 .cvspass
-rw-r--r-- 1 cvsadmin cvsadmin 144 6月 7日 11:54 .profile
drwxrwxr-x 3 cvsadmin cvsadmin 1024 6月 9日 13:51 CVSROOT
-rw-r--r-- 1 cvsadmin cvsadmin 136 6月 7日 11:54 local.cshrc
-rw-r--r-- 1 cvsadmin cvsadmin 157 6月 7日 11:54 local.login
-rw-r--r-- 1 cvsadmin cvsadmin 174 6月 7日 11:54 local.profile
drwxr-xr-x 2 cvsadmin cvsadmin 512 6月 9日 14:01 project
# exit
exit
# exit
-bash-3.00$
-bash-3.00$
-bash-3.00$
-bash-3.00$ /usr/local/cvs/bin/cvs -d :pserver:cvsadmin@localhost:2401/export/home/cvs login
Logging in to :pserver:cvsadmin@localhost:2401/export/home/cvs
CVS password:
-bash-3.00$
Solaris 10下安裝CVS Sever
默認(rèn)的所有操作都是已root身份執(zhí)行
1. 確認(rèn)你的計算機(jī)CPU的類別是Sparc還是X86(i386)。
# uname -p
2. 根據(jù)CPU的類別下載相應(yīng)版本的CVS軟件。
http://ftp.gnu.org/non-gnu/cvs/binary/stable/
Sparc的計算機(jī)選擇 sparc-sunos/ 目錄
X86的計算機(jī)選擇 x86-sunos/ 目錄
如果計算機(jī)CPU是X86,下載 x86-sunos/cvs-1.11.21-SunOS-5.8-i386.gz
3. 用gunzip解壓縮,得到文件cvs-1.11.21-SunOS-5.8-i386,移動其到目錄
/usr/sfw/bin下,改名為cvs。用chmod命令賦予其運行權(quán)限。
# gunzip cvs-1.11.21-SunOS-5.8-i386.gz
# mv cvs-1.11.21-SunOS-5.8-i386 /usr/sfw/bin/cvs
# chmod a+x /usr/sfw/bin/cvs
4. 建立源代碼庫
上述cvs程序已經(jīng)可以直接作為客戶端訪問遠(yuǎn)程源代碼庫了。但是,如果想在
自己的機(jī)器上運行cvs服務(wù),還需要建立源代碼庫。
# mkdir -p /usr/local/newrepos
# /usr/sfw/bin/cvs -d /usr/local/newrepos init
在此,/usr/local/newrepos是建立的源代碼庫的路徑
5. 配置訪問CVS源代碼庫的權(quán)限
a. 為系統(tǒng)添加一個UNIX組“cvs”和一個用戶“cvsadmin”,并設(shè)置用戶密碼。
# groupadd cvs
# useradd cvsadmin
# passwd cvsadmin
b. 編輯/etc/group,把cvsadmin加入cvs組.
例如以下是我機(jī)器中/etc/group文件中相關(guān)的一行
cvs::100:cvsadmin
c. 使新組具有此源代碼庫的所有權(quán)
# cd /usr/local/newrepos
# chgrp -R cvs .
# chmod ug+rwx .
6. 開始一個新項目
將一個新項目放入CVS源代碼庫的過程稱為導(dǎo)入。假設(shè)你的項目樹的頂級目錄
為/projects/myproject, 使用如下命令導(dǎo)入:
# cd /projects/myproject
# /usr/sfw/bin/cvs -d /usr/local/newrepos import -m "log msg" myproject mycompany start
# chgrp -R cvs /usr/local/newrepose
現(xiàn)在你就可以在機(jī)使用cvs命令來管理你的代碼了。
7. 配置遠(yuǎn)程訪問CVS服務(wù)器
如果需要從其他機(jī)器訪問此源代碼庫。還需要如下操作:
a. 在/etc/services(確信文件中沒有這一行)中加入如下一行:
cvspserver 2401/tcp
b. 在/etc/inetd.conf加入如下內(nèi)容:
cvspserver stream tcp nowait root /usr/sfw/bin/cvs cvs --allow-root=/usr/local/newrepos pserver
c. 運行如下命令讓inetd管理cvs
# inetconv -i /etc/inetd.conf
d. 設(shè)置CVS的訪問密碼
CVS密碼文件是源代碼庫的CVSROOT/passwd.每行內(nèi)容格式為:
用戶名>:加密的密碼>
加密的密碼可以從/etc/shadow文件中取得
# echo "cvsadm:1l6tgqgDkeoEE" > /usr/local/newrepos/CVSROOT/passwd
8. 從遠(yuǎn)程機(jī)器checkout源代碼
a. 第一次連接前需要使用如下命令登陸cvs服務(wù)器
# cvs -d :pserver:cvsadmin@shaseng.prc.sun.com:2401/usr/local/newrepos login
b. checkout代碼
# cvs -d :pserver:cvsadmin@shaseng.prc.sun.com:2401/usr/local/newrepos co myproject
恭喜完成CVS服務(wù)器的配置,添加新用戶來訪問此CVS服務(wù)器,只需修改/etc/group,
/usr/local/newrepos/CVSROOT/passwd文件即可。