From: Alex Kost <alezost@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 20720@debbugs.gnu.org
Subject: bug#20720: Inconsistency in text fields for 'operating-system'
Date: Fri, 05 Jun 2015 16:27:39 +0300 [thread overview]
Message-ID: <87oaku8eus.fsf@gmail.com> (raw)
In-Reply-To: <874mmmjq1g.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 05 Jun 2015 14:30:35 +0200")
Ludovic Courtès (2015-06-05 15:30 +0300) wrote:
> Alex Kost <alezost@gmail.com> skribis:
>
>> Ludovic Courtès (2015-06-03 12:52 +0300) wrote:
>
> [...]
>
>>> An important criterion is whether the file needs to contain references
>>> to store items or not. For ‘sudoers’ and ‘issue’, that’s normally not
>>> the case, and these are usually small files or computable files, so I
>>> think it’s fine to use strings here (more convenient than files.)
>>
>> Well, I don't agree about ‘sudoers’. It may be a really big file. Mine
>> is not so big, but it is 40 lines long (including some useful comments),
>> so I have to use some additional guile code to convert the contents of
>> the file into string.
>
> Ah, good point. So let’s turn ‘sudoers’ into a file-like object.
Thanks!
>>> Using monadic values as for ‘hosts-file’ and #:motd is not nice. These
>>> should be changed to use either a string or a file.
>>>
>>> The best would be to always use a file-like object. I’ve just added
>>> ‘plain-file’ for that reason. Now I would change #:motd and
>>> ‘hosts-file’ to take a file-like object rather than a monadic value.
>>>
>>> WDYT?
>>
>> I beg a pardon, but if I inderstand it correctly (probably not), I don't
>> see a difference from the user point of view. Previously it was:
>>
>> (hosts-file (text-file "hosts" "..."))
>>
>> and now it would be:
>>
>> (hosts-file (plain-file "hosts" "..."))
>
> Right. But it could also be:
>
> (hosts-file (local-file "/home/foo/my-hosts-file.txt"))
>
> This form is pleasant when the file can be long or when it has special
> syntax and you’d rather use the editor’s syntax highlighting.
Ah, This is great! Thank you.
>> I think I'm not competent as I have a vague understanding of all this
>> stuff and of user's needs (except mine ☺). What I would like to have,
>> is a possibility to specify my configuration files for various services
>> and operating-system fields. I don't want to write text configs in my
>> os-config.scm file (as it happens now with ‘hosts-file’).
>
> OK. So that’s definitely in favor of using file-like objects pretty
> much everywhere.
Yes :-)
>> I'm very happy with the current behaviour of ‘syslog-service’,
>> ‘lirc-service’ and ‘console-keymap-service’ where I just specify file
>> names, e.g.:
>>
>> (syslog-service #:config-file "/home/me/my-favourite-syslog.conf")
>>
>> and I like this ↑ way of specifying configurations very much! That's
>> what I would like to see in ‘sudoers’ and ‘hosts-file’ fields.
>
> OK. Note that this form (directly using a local file name) works
> somewhat by chance and should not be used because it defeats
> reproducibility. That is, your OS configuration actually depends on
> that file in /home, which may be modified or deleted anytime, thereby
> changing the syslogd behavior in unpredicable ways.
Yes, that's exactly what I want! I realize the benefits of the
reproducibility but often I just want my system to depend on
/home/... files that can be modified anytime.
> The right thing to do is:
>
> (syslog-service #:config-file
> (local-file "/home/me/my-favourite-syslog.conf"))
>
> This means that the config file is automatically added to the store and
> made part of the closure of the OS config. Now if
> "/home/me/my-favourite-syslog.conf" is removed/modified, the OS behavior
> remains unchanged.
And that's exactly what I don't want! I don't want my config files to
be put into the store. Because I have to reconfigure the system to see
the changes. With my current unpredicable way, I can change my
syslog.conf and the next time I boot into the same system, I will face
the changes I made.
I realize that it sounds like a strange whim and is not what is supposed
to be done, but, well, I just like it :-)
> I’ll prepare a patch for that and report back.
Thank you, in spite of all I said earlier, I really like ‘local-file’!
--
Alex
next prev parent reply other threads:[~2015-06-05 13:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-02 14:58 bug#20720: Inconsistency in text fields for 'operating-system' Alex Kost
2015-06-03 9:52 ` Ludovic Courtès
2015-06-04 14:43 ` Alex Kost
2015-06-05 12:30 ` Ludovic Courtès
2015-06-05 13:27 ` Alex Kost [this message]
2015-06-05 20:47 ` Ludovic Courtès
2015-06-06 17:38 ` Alex Kost
2015-06-07 15:16 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87oaku8eus.fsf@gmail.com \
--to=alezost@gmail.com \
--cc=20720@debbugs.gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).