[systemd-devel] [PATCH 1/4] Add ENVIRONMENT to hostnamectl

Lennart Poettering lennart at poettering.net
Tue Jul 8 04:40:39 PDT 2014


On Tue, 08.07.14 02:55, Kay Sievers (kay at vrfy.org) wrote:

> On Tue, Jul 8, 2014 at 2:38 AM, Jóhann B. Guðmundsson
> <johannbg at gmail.com> wrote:
> > ---
> >  src/hostname/hostnamectl.c | 20 +++++++++++++++++---
> >  1 file changed, 17 insertions(+), 3 deletions(-)
> >
> > diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c
> > index 267cd74..e164086 100644
> > --- a/src/hostname/hostnamectl.c
> > +++ b/src/hostname/hostnamectl.c
> > @@ -67,6 +67,7 @@ typedef struct StatusInfo {
> >          char *pretty_hostname;
> >          char *icon_name;
> >          char *chassis;
> > +        char *environment;
> >          char *kernel_name;
> >          char *kernel_release;
> >          char *os_pretty_name;
> > @@ -92,9 +93,11 @@ static void print_status_info(StatusInfo *i) {
> >                  printf("Transient hostname: %s\n", i->hostname);
> >
> >          printf("         Icon name: %s\n"
> > -               "           Chassis: %s\n",
> > +               "           Chassis: %s\n"
> > +               "           Environment: %s\n",
> 
> Shouldn't we possibly we find a word for "environment" which explains
> itself a bit better? Environment we usually call the numerous
> variables of a process or service.

Yeah, I don't really like "environment" as name for this either. This is
already used quite commonly in the environment variable sense, we
shouldn't redefine this in this comment.

I'd go for something generic like "description" or "comment" or so. Or
maybe "purpose". I think simply "description" appears to be the best
option for me.

BTW, something I also wanted to see for a long time, was a "location"
field, that can be freely configured by the admin, but is initially
filled in from geoip or so. In many setups it's quite relevant to know
where a server is located. Depending on the usecase ot could be as
generic as "Berlin, Germany" or maybe as specific as "3rd shelf, left
cabinet" or so, whatever people need. (Of course, on laptops it makes
little sense...)

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list