(编辑:jimmy 日期: 2024/11/15 浏览:2)
先下载安装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 的服务清单已生成为 /var/svc/manifest/network/rpc/100235_1-rpc_ticotsord.xml,跳过
inetconv: 通知: cvspserver 的服务清单已生成为 /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 的服务清单已生成为 /var/svc/manifest/network/rpc/100235_1-rpc_ticotsord.xml,跳过
cvspserver -> /var/svc/manifest/network/cvspserver-tcp.xml
正在导入 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
总数 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
总数 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
总数 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
总数 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
总数 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
总数 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
总数 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
默认的所有操作都是已root身份执行
1. 确认你的计算机CPU的类别是Sparc还是X86(i386)。
# uname -p
2. 根据CPU的类别下载相应版本的CVS软件。
http://ftp.gnu.org/non-gnu/cvs/binary/stable/
Sparc的计算机选择 sparc-sunos/ 目录
X86的计算机选择 x86-sunos/ 目录
如果计算机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命令赋予其运行权限。
# 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程序已经可以直接作为客户端访问远程源代码库了。但是,如果想在
自己的机器上运行cvs服务,还需要建立源代码库。
# mkdir -p /usr/local/newrepos
# /usr/sfw/bin/cvs -d /usr/local/newrepos init
在此,/usr/local/newrepos是建立的源代码库的路径
5. 配置访问CVS源代码库的权限
a. 为系统添加一个UNIX组“cvs”和一个用户“cvsadmin”,并设置用户密码。
# groupadd cvs
# useradd cvsadmin
# passwd cvsadmin
b. 编辑/etc/group,把cvsadmin加入cvs组.
例如以下是我机器中/etc/group文件中相关的一行
cvs::100:cvsadmin
c. 使新组具有此源代码库的所有权
# cd /usr/local/newrepos
# chgrp -R cvs .
# chmod ug+rwx .
6. 开始一个新项目
将一个新项目放入CVS源代码库的过程称为导入。假设你的项目树的顶级目录
为/projects/myproject, 使用如下命令导入:
# cd /projects/myproject
# /usr/sfw/bin/cvs -d /usr/local/newrepos import -m "log msg" myproject mycompany start
# chgrp -R cvs /usr/local/newrepose
现在你就可以在机使用cvs命令来管理你的代码了。
7. 配置远程访问CVS服务器
如果需要从其他机器访问此源代码库。还需要如下操作:
a. 在/etc/services(确信文件中没有这一行)中加入如下一行:
cvspserver 2401/tcp
b. 在/etc/inetd.conf加入如下内容:
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. 设置CVS的访问密码
CVS密码文件是源代码库的CVSROOT/passwd.每行内容格式为:
<用户名>:<加密的密码>
加密的密码可以从/etc/shadow文件中取得
# echo "cvsadm:1l6tgqgDkeoEE" > /usr/local/newrepos/CVSROOT/passwd
8. 从远程机器checkout源代码
a. 第一次连接前需要使用如下命令登陆cvs服务器
# 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服务器的配置,添加新用户来访问此CVS服务器,只需修改/etc/group,
/usr/local/newrepos/CVSROOT/passwd文件即可。