– General Linux 2 – Notify Users on System Related Issues [1] (Linux Professional Institute Certification) a \$Id: gl2.108.5.slides.tex,v 1.1 2003/09/10 03:50:07 geoffr Exp $%$ c 2002 Geoffrey Robertson. Permission is granted to make and distribute verbatim copies or modified versions of this document provided that this copyright notice and this permission notice are preserved on all copies under the terms of the GNU General Public License as published by the Free Software Foundation—either version 2 of the License or (at your option) any later version. a Copyright 1 Documentation 2.108.1 Use and Manage Local System Documentation 2.108.2 Find Linux Documentation on the Internet 2.108.5 Notify Users on System Related Issues [] 2 Notify Users on System Related Issues Objective Candidates should be able to notify the users about current issues related to the system. This objective includes automating the communication process, e.g. through logon messages. 3 Notify Users on System Related Issues Key files, terms, and utilities /etc/issue /etc/issue.net /etc/motd 4 Notify Users on System Related Issues Resources TBA 5 Customize the Local Login screen with /etc/issue • The login screen for RH73 looks like this: Red Hat Linux release 7.3 (Valhalla) Kernel 2.4.18-3 on an i686 login: 6 Customize the Local Login screen with /etc/issue • The login screen for RH73 looks like this: Red Hat Linux release 7.3 (Valhalla) Kernel 2.4.18-3 on an i686 login: • The getty process spawned by init presents the contents of the file /etc/issue and provides a login: prompt for the user. 6-a Customize the Local Login screen with /etc/issue • The login screen for RH73 looks like this: Red Hat Linux release 7.3 (Valhalla) Kernel 2.4.18-3 on an i686 login: • The getty process spawned by init presents the contents of the file /etc/issue and provides a login: prompt for the user. • The file /etc/issue $ cat /etc/issue ← Red Hat Linux release 7.3 (Valhalla) Kernel \r on an \m 6-b man issue ISSUE(5) NAME issue - pre-login 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. It may contain various @char and \char sequences, if supported by getty(1). FILES /etc/issue SEE ALSO getty(1), motd(5) Linux 1993-07-24 Linux Programmer’s Manual ISSUE(5) ISSUE(5) 7 man getty—embedded in the /etc/issue \d \l \m \n \o \r \t \s \u insert current day (localtime), insert line on which mingetty is running, inserts machine architecture (uname -m), inserts machine’s network node hostname (uname -n), inserts domain name, inserts operating system release (uname -r), insert current time (localtime), inserts operating system name, resp. \U the current number of users which are currently logged in. \U inserts "n users", where as \u only inserts "n". inserts operating system version (uname -v). \v 8 Telnet uses /etc/issue.net The following sequences are supported by telnetd: %l %h, %n %D, %o %d, %t %s %m %r %v %% show the current tty show the system node name (FQDN) show the name of the NIS domain show the current time and date show the name of the operating system show the machine (hardware) type show the operating system release show the operating system version display a single ’%’ character 9 Message of the Day—motd Login Sequence • Contents of /etc/issue is displayed. 10 Message of the Day—motd Login Sequence • Contents of /etc/issue is displayed. • getty displays the login prompt. 10-a Message of the Day—motd Login Sequence • Contents of /etc/issue is displayed. • getty displays the login prompt. • /bin/login handles the login process. 10-b Message of the Day—motd Login Sequence • Contents of /etc/issue is displayed. • getty displays the login prompt. • /bin/login handles the login process. – User is authorized. 10-c Message of the Day—motd Login Sequence • Contents of /etc/issue is displayed. • getty displays the login prompt. • /bin/login handles the login process. – User is authorized. – Contents of /etc/motd is displayed. 10-d Message of the Day—motd Login Sequence • Contents of /etc/issue is displayed. • getty displays the login prompt. • /bin/login handles the login process. – User is authorized. – Contents of /etc/motd is displayed. – The login shell is executed. 10-e Manpage for motd MOTD(5) NAME motd - message of the day DESCRIPTION The contents of /etc/motd are displayed by login(1) after a suc cessful login but just before it executes the login shell. The abbreviation "motd" stands for "message of the day", and this file has been traditionally used for exactly that (it requires much less disk space than mail to all users). FILES /etc/motd SEE ALSO login(1), issue(5) Linux 1992-12-29 MOTD(5) Linux Programmer’s Manual MOTD(5) 11 motd 12 motd $ cat /etc/motd ← Have a nice day :-) $ˆD 12-a motd $ cat /etc/motd ← Have a nice day :-) $ˆD Red Hat Linux release 9 (Shrike) Kernel 2.4.20-8 on an i686 marsbar login: geoffrey Password: Last login: Wed Sep 10 22:23:15 on tty2 Have a nice day :-) You have new mail. $ 12-b Notify Users of System Related Issues Login Screen /etc/issue 13 Notify Users of System Related Issues Login Screen /etc/issue Telnet Login Screen /etc/issue.net 13-a Notify Users of System Related Issues Login Screen /etc/issue Telnet Login Screen /etc/issue.net Login message /etc/motd 13-b Notify Users of System Related Issues Login Screen /etc/issue Telnet Login Screen /etc/issue.net Login message /etc/motd wall Message to all terminals 13-c Notify Users of System Related Issues Login Screen /etc/issue Telnet Login Screen /etc/issue.net Login message /etc/motd wall Message to all terminals talk Split screen message 13-d Notify Users of System Related Issues Login Screen /etc/issue Telnet Login Screen /etc/issue.net Login message /etc/motd wall Message to all terminals talk Split screen message Email Users list 13-e Notify Users of System Related Issues Login Screen /etc/issue Telnet Login Screen /etc/issue.net Login message /etc/motd wall Message to all terminals talk Split screen message Email Users list Phone They have a phone 13-f Notify Users of System Related Issues Login Screen /etc/issue Telnet Login Screen /etc/issue.net Login message /etc/motd wall Message to all terminals talk Split screen message Email Users list Phone They have a phone Visit They have an office 13-g The End 14