Index: share/man/man5/motd.5 =================================================================== --- share/man/man5/motd.5 +++ share/man/man5/motd.5 @@ -11,7 +11,7 @@ .Nd file containing message(s) of the day .Sh DESCRIPTION The file -.Pa /var/run/motd +.Pa /etc/motd is normally displayed by .Xr login 1 after a user has logged in but before the shell is run. @@ -21,7 +21,19 @@ .Pa /etc/motd.template and the contents are written to .Pa /var/run/motd . +.Pa /etc/motd +becomes a symbolic link to +.Pa /var/run/motd . .Pp +To use an immutable +.Pa /etc/motd , +create it as a regular file and set +.Va update_motd +to +.Dq Li NO +in +.Xr rc.conf 5 . +.Pp Individual users may suppress the display of this file by creating a file named .Dq Pa .hushlogin @@ -29,13 +41,20 @@ .Xr login.conf 5 . .Sh FILES .Bl -tag -width $HOME/.hushlogin -compact +.It Pa /etc/motd +Symbolic link to actual +.Pa motd +file or the message of the day if +.Va update_motd +is set to +.Dq Li NO . .It Pa /etc/motd.template The template file that system administrators can edit. .It Pa /var/run/motd -The message of the day. +The generated message of the day. .It Pa $HOME/.hushlogin Suppresses output of -.Pa /var/run/motd . +.Pa /etc/motd . .El .Sh EXAMPLES .Bd -literal @@ -50,5 +69,4 @@ Prior to .Fx 13.0 , .Nm -lived in -.Pa /etc . +was a regular file. Index: usr.bin/login/login.1 =================================================================== --- usr.bin/login/login.1 +++ usr.bin/login/login.1 @@ -131,7 +131,7 @@ changes device protections .It Pa /etc/login.conf login class capabilities database -.It Pa /var/run/motd +.It Pa /etc/motd message-of-the-day .It Pa /var/mail/user system mailboxes Index: usr.bin/login/login.conf =================================================================== --- usr.bin/login/login.conf +++ usr.bin/login/login.conf @@ -25,7 +25,7 @@ default:\ :passwd_format=sha512:\ :copyright=/etc/COPYRIGHT:\ - :welcome=/var/run/motd:\ + :welcome=/etc/motd:\ :setenv=BLOCKSIZE=K:\ :mail=/var/mail/$:\ :path=/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin ~/bin:\ @@ -128,7 +128,7 @@ ## #standard:\ # :copyright=/etc/COPYRIGHT:\ -# :welcome=/var/run/motd:\ +# :welcome=/etc/motd:\ # :setenv=BLOCKSIZE=K:\ # :mail=/var/mail/$:\ # :path=~/bin /bin /usr/bin /usr/local/bin:\ Index: usr.bin/login/pathnames.h =================================================================== --- usr.bin/login/pathnames.h +++ usr.bin/login/pathnames.h @@ -35,6 +35,6 @@ #include #define _PATH_HUSHLOGIN ".hushlogin" -#define _PATH_MOTDFILE "/var/run/motd" +#define _PATH_MOTDFILE "/etc/motd" #define _PATH_FBTAB "/etc/fbtab" #define _PATH_LOGINDEVPERM "/etc/logindevperm"