#terminal #shell #ssh #linux-terminal #command-line-interface #system #cli-tool

motd

motd interrogates pam_motd.so in order to determine the current message of the day. It only works on linux and it is a component of the shpool tool, though you can also use the dump-motd wrapper CLI tool directly. Through feature selection, you can also use a pure rust impl with no dlopen shennigans.

4 releases

0.2.2 Jun 17, 2024
0.2.1 Apr 2, 2024
0.2.0 Mar 18, 2024
0.1.0 Mar 4, 2024

#2465 in Command line utilities

Download history 206/week @ 2024-04-01 3/week @ 2024-04-08 17/week @ 2024-05-20 14/week @ 2024-06-03 221/week @ 2024-06-10 229/week @ 2024-06-17 75/week @ 2024-06-24 73/week @ 2024-07-01 65/week @ 2024-07-08 34/week @ 2024-07-15

262 downloads per month
Used in 3 crates (2 directly)

Apache-2.0

39KB
684 lines

motd

motd is a crate for printing the current MOTD (message of the day) on linux. Most of the logic lives in the motd crate, and the dump-motd tool is a thin wrapper which provides a command line interface for the crate.

Dependencies

If using the socall feature (which is on by default), you must install libpam headers to build this crate. On debian based systems you can do so with

sudo apt-get install libpam0g-dev

Features

There are two modes of operation for the motd crate. By default, it will load and call into the pam_motd.so file used by the pam stack, but you can instead use a pure rust reimplementation of the logic found in pam_motd.so if you want. The downside of the pure rust implementation is that it no longer uses the same source-of-truth logic to resolve the motd, though this is likely not a huge deal because pam_motd is fairly stable. The pure rust implementation has the advantages that it uses zero unsafe code, does not require a (sometimes slow) directory walk to locate pam_motd.so the first time it is run, and requires many fewer dependencies.

The feature for calling pam_motd.so directly is socall, and it is enabled by default. To use the pure rust implementation, disable default features. This will change the signature of a few functions.

Dependencies

~2–11MB
~132K SLoC