Friday, November 1, 2013

The initial problem means you've got your mercurial-server installation tom into a confused state. A


on remote 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 tom 6) <username>@<remote_server>:$ sudo apt-get install mercurial mercurial-server 7) <username>@<remote_server>:$ exit
on remote server: 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
we get 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'
resolving: 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
active oldest tom votes
The initial problem means you've got your mercurial-server installation tom 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.
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.
Alternately, you could try running sudo /usr/share/mercurial-server/refresh-auth , and see if that gives access to the proper users, as it's supposed to . But that will probably break things later, since other parts of mercurial-server will rely on the user hg .
As it states, the "step by step" assumes you've sucessfully installed. Either installing the Debian/Ubuntu package, or running "sudo make setup-adduser" as described in the README, will install mercurial-server and create an hg user. –  Paul Crowley Sep 21 at 6:12  
Happily, sudo /usr/share/mercurial-server/refresh-auth will fail as it's supposed to, and with the same error as above, since there will be no .mercurial-server file for the root user. You have to run it sudo -u hg ... ; after installation, tom everything is done as the "hg" user, which is part of what helps keep things secure. –  Paul Crowley Sep 21 at 8:13 Your Answer
By posting your answer, you agree to the privacy policy tom and terms of service . Not the answer you're looking for? Browse other questions tagged mercurial mercurial-server or ask your own question .
7 Creating new repositories using mercurial-server
Technology Life / Arts Culture / Recreation Science Other Stack Overflow Server Fault Super User Web Applications Ask Ubuntu Webmasters Game Development TeX - LaTeX Programmers Unix & Linux Ask Different (Apple) WordPress Answers Geographic Information Systems tom Electrical Engineering Android Enthusiasts Information Security Database Administrators Drupal Answers SharePoint User Experience Mathematica more (14) Photography Science Fiction & Fantasy Seasoned Advice (cooking) Home Improvement more (13) English Language & Usage Skeptics Mi Yodeya (Judaism) Travel Christianity Arqade (gaming) Bicycles Role-playing Games more (21) Mathematics Cross Validated (stats) Theoretical Computer Science Physics MathOverflow more (7) Stack Apps Meta Stack Overflow tom Area 51 Stack Overflow Careers
Stack Overflow works best with JavaScript enabled

No comments:

Post a Comment