[conspire] ... /etc/debian_version, /etc/issue, /etc/motd, ...

Michael Paoli Michael.Paoli at cal.berkeley.edu
Tue Jul 3 19:57:45 PDT 2018


> Date: Thu, 28 Jun 2018 17:15:22 -0700
> From: Rick Moen <rick at linuxmafia.com>
> To: conspire at linuxmafia.com
> Subject: Re: [conspire] /etc, /etc/debian_version, /etc/motd,
> 	/etc/issue, Debian, ...
> Message-ID: <20180629001522.GP32399 at linuxmafia.com>
>
>     I merely said /etc/issue and /etc/debian_version are
>     system-generated, such that altering them manually is not the
>     way to administer the system.

Well, minor point/quibble ;-) ...
I think we're in full agreement on /etc/debian_version

(and of course if one has dozens/hundreds or more Debian
systems, also *manually* wouldn't be the way to manage those
(individual) files either).

However, /etc/issue - and perhaps likewise /etc/motd ... not quite
100% in agreement.

My take on it, they're *just* configuration files, nothing all that
specifically operating system (OS) / distribution (distro)
maintained.

Sure, if one does absolutely no explicit changes to them, the OS /
distro might put some moderately informative contents
in /etc/motd and/or /etc/issue ... one might take those as "hints",
but I certainly wouldn't want to rely upon their contents for OS / distro
determination.  They're fully customizable and have always been intended to
be so.
Even the man pages on Debian quite hint at that, e.g. in relevant parts:
ISSUE(5)                   Linux Programmer's Manual                  ISSUE(5)
NAME
        issue - prelogin message and identification file
DESCRIPTION
        The  file  /etc/issue is a text file which contains a message or system
        identification to be printed before the login prompt.
MOTD(5)                    Linux Programmer's Manual                   MOTD(5)
NAME
        motd - message of the day
DESCRIPTION
        The contents of /etc/motd are displayed by pam_motd(8) after a success-
        ful login but just before it executes the login shell.

Though those aren't necessarily 100% full and complete reference sources
on the matter.  But they do (also) suggest that those files are
for, or alternatively or also for, displaying those (relatively) arbitrary
pre-login and post-login messages (at least by default for getty-like
programs - may be a wee bit different by default for, e.g. sshd).

And ... as for OS / distro determination?
I'd be inclined to check, on Linux:
$ lsb_release -d
$ uname -a
$ ls -d /etc/*release* /etc/*version*
and have a look at those files (at least those that are files)
And look at the package system and what kernel is installed, "vs."
what's reported in the above.
For Debian, /etc/debian_version will have the version, and is maintained and
managed by package that does so.  There may be similar files for other
distros.

And also as for Debian, /etc/motd and /etc/issue ... they only "hint"
respectively that it (at least for current stable) is a
Debian GNU/Linux system, and that it's a 9(.x) such system.

And for other *nix operating systems,
$ uname -a
And there are other OS specific commands that are or may be present for
various *nix flavors (beyond scope here).
Also, the above is for a "pure" OS/distro.  If one has, e.g. a
FrankenDebian or whatever, that's a rather different matter (as we'd
reasonably covered in earlier postings).

Oh, and of course, another good rule-of-thumb* - if you don't know
what it is/does, don't screw with it.  ;-)
Which, in the case of /etc/issue and /etc/motd on Debian ...
well, they'd have some modest "hints" for one in such a case.
*particularly for systems administrators.





More information about the conspire mailing list