motd

MOTD (Message of the day)

  • static /etc/motd
  • Then, Ubuntu Intrepid Ibex (2008) introduced a package update-motd, which consisted of
    • a script called update-motd.
    • an entry in /etc/cron.d calling update-motd every 10 minutes.
    • a folder /etc/update-motd.d
  • The script runs all the scripts in /etc/update-motd.d using run-parts, then stores all output in /var/run/motd.
    • For this reason, even in Debian if we create the folder /etc/update-motd.d, which does not exist by default, it will be run at every login in the same way as if we had Ubuntu’s update-motd package installed.

files

  • /etc/motd – The classic, static file. Does not exist anymore in Ubuntu 16.04 LTS, not even as a symbolic link to /var/run/motd. If it is created, however its contents will be printed too.
  • /var/run/motd – This was used by Ubuntu’s first implementation. It is not used anymore. It is just ignored by PAM.
  • /var/run/motd.dynamicThis is what is shown on login currently. It is updated by /etc/init.d/motd at every boot. It is also updated by PAM by running the scripts in /etc/update-motd.d/, if they exist.
  • /etc/motd.tail – The Ubuntu package used to populate /etc/update-motd.d. One of them would cat the contents of this file so it was easy to add static content. That script does not exist in the package anymore, so the file does not have the intended effect.

how to do

1
2
mkdir /etc/update-motd.d
rm -f /etc/motd
1
2
3
// in /etc/pam.d/sshd
session optional pam_motd.so motd=/run/motd
session optional pam_motd.so noupdate

landscape-sysinfo

  • /usr/lib/python3/dist-packages/landscape
  • Display a summary of the current system status
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--version
show program's version number and exit

-h, --help
show this help message and exit

-c FILE, --config=FILE
Use config from this file (any command line options override settings from the
file) (default: '/etc/landscape/client.conf').

-d PATH, --data-path=PATH
The directory to store data files in (default: '/var/lib/landscape/client/').

--sysinfo-plugins=PLUGIN_LIST
Comma-delimited list of sysinfo plugins to use. Default is to use all plugins.

--exclude-sysinfo-plugins=PLUGIN_LIST
Comma-delimited list of sysinfo plugins to NOT use. This always take precedence
over plugins to include.

Available plugins: Load, Disk, Memory, Temperature, Processes, LoggedInUsers,
LandscapeLink, Network

Default plugins: Load, Disk, Memory, Temperature, Processes, LoggedInUsers, Network

run-parts

  • 照字母排序執行該資料夾下所有可執行文件

reference