2. Objective Topic 108 Documentation [8] 1.108.5 2 1.108.1 Use and Manage Local System Documentation [4] 1.108.5 Notify users on system-related issues Weight 1 Linux Professional Institute Certification — 102 1.108.2 Find Linux Documentation on the Internet [3] 1.108.5 Notify Users on System Related Issues [1] 2 Objective Geoffrey Robertson ge@ffrey.com Nick Urbanik nicku@nicku.org This document Licensed under GPL—see section 7 Description of 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. Key files, terms, and utilities include: /etc/issue — /etc/issue.net — File containing message displayed when users log in via telnet (which should be never! :-) /etc/motd — Message of the day file: displayed when log in via ssh or the console 2005 July 1 Context Outline Contents 1 2 3 Context Objective /etc/issue 3.1 Manpage for issue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 getty strings you can use in issue . . . . . . . . . . . . . . . . . . . . . . . telnet and issue.net Message of the Day: motd 5.1 Manpage for motd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 motd in action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Ways of notifying users 1 2 2 3 3 3 4 4 5 5 6 3 /etc/issue • The login screen for Fedora Core 4 looks like this: Fedora Core release 4 (Stentz) Kernel 2.6.13-1.1526_FC4smp 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 ← Fedora Core release 4 (Stentz) Kernel \r on an \m Customize the Local Login screen with /etc/issue 4 5 6 7 License Of This Document 3.1 Manpage for issue 1.108.5 3 5. Message of the Day: motd 1.108.5 4 3.1 Manpage for issue man issue The following sequences are supported by telnetd: %l 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 ISSUE(5) NAME Linux Programmer’s Manual ISSUE(5) %h, %n %D, %o %d, %t 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 mingetty(1). FILES /etc/issue SEE ALSO mingetty(1), motd(5) Linux 1993-07-24 ISSUE(5) %s %m %r %v %% 5 Message of the Day: motd • 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. Message of the Day — motd 3.2 getty strings you can use in issue man getty—embedded in the /etc/issue \d \l \m \n \o \r \t \s \u \U \v 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, insert the number of current users logged in inserts “1 user” or “ n users”, where n is the number of users logged in inserts operating system version (uname -v). 5.1 Manpage for motd Manpage for motd MOTD(5) NAME motd - message of the day DESCRIPTION The contents of /etc/motd are displayed by login(1) after a successful 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). Linux Programmer’s Manual MOTD(5) 4 telnet and issue.net Telnet uses /etc/issue.net 5.2 motd in action 1.108.5 5 7. License Of This Document Login message /etc/motd 1.108.5 6 FILES /etc/motd SEE ALSO login(1), issue(5) Linux 1992-12-29 MOTD(5) wall Message to all terminals talk Split screen message Email Users list Phone They have a phone 5.2 motd in action motd $ cat /etc/motd ← G’day! :-) $ exit ← Visit They have an office 7 License Of This Document 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 G’day! :-) You have new mail. $ It also works with ssh $ ssh nicku.org ← Last login: Thu Oct 27 10:51:21 2005 from nicku.org G’day! :-) $ cat /etc/motd ← G’day! :-) $ License Of This Document Copyright c 2005, 2003 Geoffrey Robertson and Nick Urbanik . 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. 6 Ways of notifying users Notify Users of System Related Issues Login Screen /etc/issue Telnet Login Screen /etc/issue.net