GNU bug report logs - #22962
Something keeps overwriting /etc/hosts

Previous Next

Package: guix;

Reported by: Danny Milosavljevic <dannym <at> scratchpost.org>

Date: Wed, 9 Mar 2016 20:43:02 UTC

Severity: normal

Tags: fixed, notabug

Fixed in version 0.9.1

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 22962 in the body.
You can then email your comments to 22962 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#22962; Package guix. (Wed, 09 Mar 2016 20:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Danny Milosavljevic <dannym <at> scratchpost.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 09 Mar 2016 20:43:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: bug-guix <at> gnu.org
Subject: Something keeps overwriting /etc/hosts
Date: Wed, 9 Mar 2016 21:42:32 +0100



Information forwarded to bug-guix <at> gnu.org:
bug#22962; Package guix. (Wed, 09 Mar 2016 23:29:01 GMT) Full text and rfc822 format available.

Message #8 received at 22962 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: 22962 <at> debbugs.gnu.org
Subject: Re: bug#22962: Something keeps overwriting /etc/hosts
Date: Thu, 10 Mar 2016 00:28:11 +0100
If I make it immutable, I get the following message on guix system reconfigure ... :

  guix system: error: copy-file: Permission denied: "/etc/hosts"

Aha!




Information forwarded to bug-guix <at> gnu.org:
bug#22962; Package guix. (Thu, 10 Mar 2016 01:44:01 GMT) Full text and rfc822 format available.

Message #11 received at 22962 <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 22962 <at> debbugs.gnu.org
Subject: Re: bug#22962: Something keeps overwriting /etc/hosts
Date: Wed, 9 Mar 2016 20:43:23 -0500
On Thu, Mar 10, 2016 at 12:28:11AM +0100, Danny Milosavljevic wrote:
> If I make it immutable, I get the following message on guix system reconfigure ... :
> 
>   guix system: error: copy-file: Permission denied: "/etc/hosts"
> 
> Aha!

I think that on GuixSD, the hosts file is generated from the system
configuration, specifically the 'hosts-file' field, which is mentioned
in section 7.2.2 Operating System Reference [0].

I assume that the resulting file is recreated each time you reconfigure. 

In that case, you'd want to leave the file /etc/hosts alone, and make
your changes in the operating system configuration.

I say "I think" and "I assume" because I haven't actually used
'hosts-file' yet, nor have I looked at that part of the code.

Does that help?

[0]
https://www.gnu.org/software/guix/manual/guix.html#operating_002dsystem-Reference




Information forwarded to bug-guix <at> gnu.org:
bug#22962; Package guix. (Thu, 10 Mar 2016 08:39:02 GMT) Full text and rfc822 format available.

Message #14 received at 22962 <at> debbugs.gnu.org (full text, mbox):

From: Alex Kost <alezost <at> gmail.com>
To: Leo Famulari <leo <at> famulari.name>
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>, 22962 <at> debbugs.gnu.org
Subject: Re: bug#22962: Something keeps overwriting /etc/hosts
Date: Thu, 10 Mar 2016 11:39:00 +0300
Leo Famulari (2016-03-10 04:43 +0300) wrote:

> On Thu, Mar 10, 2016 at 12:28:11AM +0100, Danny Milosavljevic wrote:
>> If I make it immutable, I get the following message on guix system reconfigure ... :
>>
>>   guix system: error: copy-file: Permission denied: "/etc/hosts"
>>
>> Aha!
>
> I think that on GuixSD, the hosts file is generated from the system
> configuration, specifically the 'hosts-file' field, which is mentioned
> in section 7.2.2 Operating System Reference [0].
>
> I assume that the resulting file is recreated each time you reconfigure.
>
> In that case, you'd want to leave the file /etc/hosts alone, and make
> your changes in the operating system configuration.
>
> I say "I think" and "I assume" because I haven't actually used
> 'hosts-file' yet, nor have I looked at that part of the code.

You are absolutely right!  On GuixSD, to modify /etc/hosts a user need
to adjust his/her system config.

Danny, you can keep your hosts file wherever you want, let's say
"~/my-config/hosts"; and you can add this line to your operating-system
declaration:

  (hosts-file (local-file (string-append (getenv "HOME")
                                         "/my-config/hosts")))

After reconfiguring your system, this file will be put into the store,
and /etc/hosts will have the same contents after reboot.

Moreover, every time you change this file and make a new system, a new
version of "hosts" will be put to the store.  So if you boot into some
old system, it will be booted with the hosts file that was used at that
time (as you can see, every system in /var/guix/profiles, has its own
"etc/hosts").

-- 
Alex




Added tag(s) notabug. Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Wed, 23 Mar 2016 18:19:02 GMT) Full text and rfc822 format available.

Added tag(s) fixed. Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Wed, 23 Mar 2016 18:20:01 GMT) Full text and rfc822 format available.

bug marked as fixed in version 0.9.1, send any further explanations to 22962 <at> debbugs.gnu.org and Danny Milosavljevic <dannym <at> scratchpost.org> Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Wed, 23 Mar 2016 18:20:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 21 Apr 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 64 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.