问题描述
我尝试通过以下(官方)教程调整汞: http://dev.lshift.net/paul/mercurial-server/docbook.html
I try to tune hg through this (official) tutorial: http://dev.lshift.net/paul/mercurial-server/docbook.html
当我尝试:
sudo -u hg /usr/share/mercurial-server/refresh-auth
它说:
No section: 'paths'
Must be run as the 'hg' user
所以这是一个问题
UPD:
解决方法,以及用于安装mercurial-server的真实教程:
way to resolve, and true tutorial for install mercurial-server:
在远程服务器上:
0) save your repos to homedir
1) <username>@<remote_server>:$ sudo apt-get purge mercurial mercurial-server
2) <username>@<remote_server>:$ sudo userdel -r hg
3) <username>@<remote_server>:$ sudo rm -r /var/lib/mercurial-server
4) <username>@<remote_server>:$ sudo rm -r /etc/mercurial-server
5) <username>@<remote_server>:$ sudo rm -r /usr/share/mercurial-server
6) <username>@<remote_server>:$ sudo apt-get install mercurial mercurial-server
7) <username>@<remote_server>:$ exit
在本地主机上:
8) ssh -A <remote_hg_server_domain>
在远程服务器上:
9) <username>@<remote_server>:$ ssh-add -L > id_rsa.pub
10) <username>@<remote_server>:$ sudo mkdir -p /etc/mercurial-server/keys/root/<username>
11) <username>@<remote_server>:$ sudo cp my-key /etc/mercurial-server/keys/root/<username>/localhost (if you work from local terminal)
12) <username>@<remote_server>:$ sudo -u hg /usr/share/mercurial-server/refresh-auth - OOPS
我们得到
Traceback (most recent call last):
File "/usr/share/mercurial-server/refresh-auth", line 22, in <module>
refreshauth.refreshAuth()
File "/usr/share/mercurial-server/mercurialserver/refreshauth.py", line 49, in refreshAuth
kf = open(ffn)
IOError: [Errno 13] Permission denied: '/etc/mercurial-server/keys/root/<username>/localhost'
解决:
13) <username>@<remote_server>:$ sudo chmod 644 /etc/mercurial-server/keys/root/<username>/localhost
14) <username>@<remote_server>:$ sudo -u hg /usr/share/mercurial-server/refresh-auth
15) <username>@<remote_server>:$ sudo chmod 600 /etc/mercurial-server/keys/root/<username>/localhost
效果很好
推荐答案
最初的问题意味着您已将mercurial-server安装置于混乱状态.创建"hg"用户后,安装脚本会将名为".mercurial-server"的配置文件放置在其主目录中.该文件以某种方式在您的系统上被删除了-也许您是手动创建"hg"用户的?这就是为什么删除并重新安装所有固定的内容的原因,因为它运行了安装脚本并创建了此文件.
The initial problem means you've got your mercurial-server installation into a confused state. After creating the "hg" user, the install scripts place a configuration file called ".mercurial-server" in its home directory. This file somehow got removed on your system - perhaps you created the "hg" user by hand? That's why deleting and reinstalling all fixed everything, because it ran the install scripts and created this file.
第二个问题仅仅是"hg"用户无法读取您创建的"localhost"文件. 777授予所有人写入权限-绝对不要这样做!文件644和目录755就足够了.看来您已将"umask"设置为非常规限制性面具.
The second problem was simply that the "hg" user was unable to read the "localhost" file you created. 777 gives write permission to all - never do that! 644 for files and 755 for directories will suffice. It looks like you have your "umask" set to an unusually restrictive mask.
这篇关于mercurial-server说:没有部分:'paths'必须以'hg'用户身份运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!