PAM-modules Manual (split by chapter):   Section:   Chapter:FastBack: ldaphome   Up: Top   FastForward: groupmember   Contents: Table of ContentsIndex: Concept Index

8 pam_umotd

The pam_umotd module displays a user-specific message of the day (MOTD). The text can be taken either from a disk file, or read from the standard output of a program launched for that purpose.

This module is Linux-specific.

The module is normally started as a part of the session stack, e.g.:

session optional pam_umotd.so file=/etc/motd

The file option specifies the file to read the MOTD from. By default the output size is limited to 2000 bytes (a usual 80x25 screen-worth of characters). If the input file is bigger than that, it will be truncated. The size limit can be controlled using the max-size parameter:

session optional pam_umotd.so max-size=1024 file=/etc/motd

Another safety-related parameter is max-la, which controls the maximum 5-minute load average, under which the message will be displayed. If the current LA is greater than this value, the module will return immediately without displaying anything1.

The MOTD can be generated on the fly, by launching an external program and displaying its output. This allows you to create dynamic, user-specific MOTDs. To select this mode, use the exec parameter. The rest of arguments after this parameter are taken to be the name of the program to be run and its command line arguments. Before starting the program, the arguments undergo item expansion (see item expansion). For example:

session optional pam_umotd.so max-size=1024 max-la=5.0 timeout=5 \
           exec /usr/bin/genmotd ${user} ${tty}

This example runs the program /usr/bin/genmotd passing it the user login name and the tty name as its argument. Notice the timeout parameter, which controls the maximum time (in seconds) the program will be allowed to run. If it runs longer than that, it will be killed. The default timeout is 10 seconds.

8.1 Summary of pam_umotd options

This section summarizes the options understood by pam_umotd.

file=filename

Read and display text from file filename.

exec

Execute a program and display its output. The rest of arguments after this parameter are taken to be the program name and its command line arguments. The arguments are subject to item expansion (see item expansion). The program inherits the current environment.

timeout=n

Limit the execution time of the program started via the exec option to n seconds. The default value is 10.

max-size=n

Limit the output size to n bytes. Default is 2000.

max-la=d

Exit immediately if the 5-minute load average is greater than or equal to d (a floating-point number).

Footnotes

(1)

As of version 2.4.1 this functionality relies on the file /proc/loadavg.

PAM-modules Manual (split by chapter):   Section:   Chapter:FastBack: umotd   Up: umotd   FastForward: groupmember   Contents: Table of ContentsIndex: Concept Index