# 從 Sunfreeware 或 Blastwave 下載對應 Solaris 10 架構套件
pkgadd -d CVSpkg
Solaris 10 使用 SMF 管理 inetd 服務,需建立 Manifest 並匯入。
vi /etc/services
cvspserver 2401/tcp # CVS pserver 模式
vi /etc/inetd.conf
cvspserver stream tcp nowait root /usr/local/cvs/bin/cvs cvs --allow-root=/export/home/cvs pserver
nowait:inetd 等待服務結束再處理下一個連線 (適用 CVS)。--allow-root:指定 CVS 儲存庫根目錄。# 轉換 inetd.conf 產生 manifest
inetconv -i /etc/inetd.conf
# 輸出: cvspserver -> /var/svc/manifest/network/cvspserver-tcp.xml
# 若已存在舊 manifest 需先移除
rm /var/svc/manifest/network/cvspserver-tcp.xml
inetconv -i /etc/inetd.conf
# 重新整理 inetd 服務
svcadm restart svc:/network/inetd:default
svcs -l cvspserver
# 或
inetadm | grep cvs
# 建立儲存庫目錄
mkdir -p /export/home/cvs
chown -R cvsuser:cvs /export/home/cvs
# 初始化
cvs -d /export/home/cvs init
# 建立 CVS 專用用戶 (安全性)
groupadd cvs
useradd -g cvs -d /export/home/cvs -s /bin/false cvsuser
# 客戶端設定環境變數
export CVSROOT=:pserver:user@cvs_server:/export/home/cvs
export CVS_RSH=ssh # 建議使用 SSH 隧道加密
# 登入
cvs login
# Logging in to :pserver:user@cvs_server:2401/export/home/cvs
# CVS password: ********
# 檢出模組
cvs checkout myproject
CVS_RSH=ssh,避免明文傳輸密碼與代碼。--allow-root 僅指向特定儲存庫路徑。/etc/hosts.allow/deny 限制來源 IP。/export/home/cvs (含 CVSROOT 管理目錄)。