diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2015-06-05 22:41:55 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2015-06-05 22:41:55 +0200 |
| commit | 24e02c28fbf2b0efbc2fd6cdcd770037a6cff7e3 (patch) | |
| tree | b4541b9b8e4e28b5fbe6f060895e94f7fbb01be2 /doc | |
| parent | 847658395e399d6d4ef21a247dbad02a9c921400 (diff) | |
system: 'hosts-file' is now a file-like object.
Partly fixes <http://bugs.gnu.org/20720>.
Reported by Alex Kost <alezost@gmail.com>.
* gnu/system.scm (default-/etc/hosts): Change 'text-file' to 'plain-file'.
(maybe-file->monadic): New procedure.
(operating-system-etc-directory): Use it.
* doc/guix.texi (operating-system Reference, Networking Services): Adjust
accordingly.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/guix.texi | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index ecdfa1b1ce9..f8da9c12249 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -4480,9 +4480,9 @@ The host name. | |||
| 4480 | 4480 | ||
| 4481 | @item @code{hosts-file} | 4481 | @item @code{hosts-file} |
| 4482 | @cindex hosts file | 4482 | @cindex hosts file |
| 4483 | A zero-argument monadic procedure that returns a text file for use as | 4483 | A file-like object (@pxref{G-Expressions, file-like objects}) for use as |
| 4484 | @file{/etc/hosts} (@pxref{Host Names,,, libc, The GNU C Library | 4484 | @file{/etc/hosts} (@pxref{Host Names,,, libc, The GNU C Library |
| 4485 | Reference Manual}). The default is to produce a file with entries for | 4485 | Reference Manual}). The default is a file with entries for |
| 4486 | @code{localhost} and @var{host-name}. | 4486 | @code{localhost} and @var{host-name}. |
| 4487 | 4487 | ||
| 4488 | @item @code{mapped-devices} (default: @code{'()}) | 4488 | @item @code{mapped-devices} (default: @code{'()}) |
| @@ -5299,9 +5299,9 @@ This variable is typically used in the @code{hosts-file} field of an | |||
| 5299 | (hosts-file | 5299 | (hosts-file |
| 5300 | ;; Create a /etc/hosts file with aliases for "localhost" | 5300 | ;; Create a /etc/hosts file with aliases for "localhost" |
| 5301 | ;; and "mymachine", as well as for Facebook servers. | 5301 | ;; and "mymachine", as well as for Facebook servers. |
| 5302 | (text-file "hosts" | 5302 | (plain-file "hosts" |
| 5303 | (string-append (local-host-aliases host-name) | 5303 | (string-append (local-host-aliases host-name) |
| 5304 | %facebook-host-aliases)))) | 5304 | %facebook-host-aliases)))) |
| 5305 | @end example | 5305 | @end example |
| 5306 | 5306 | ||
| 5307 | This mechanism can prevent programs running locally, such as Web | 5307 | This mechanism can prevent programs running locally, such as Web |
