Running Gentoo 3.4.0Having recently heard about the /etc/motd file, i tried to have it display random cowsay fortunes.I wrote some random bash script to act as a daemon, feeding the /etc/motd as a named pipe, as seen on some forums.I don't think there's any problem with the script because cat'ing the pipe works just fine, but the MOTD won't display on login (using a regular file works) !fira@nyan ~ % cat /etc/motd _______________________________________ / We didn't put in ^^ because then we'd \| have to keep telling people what it   || means, and then we'd have to keep     || telling them why it doesn't short     || circuit. :-/                          ||                                       || -- Larry Wall in                      |\ <199707300650.XAA05515@wall.org>      / ---------------------------------------    \    \        .--.       |o_o |       |:_/ |      //   \ \     (|     | )    /'\_   _/`\    \___)=(___/Am i missing something obvious ? Not using anything like a .hushlogin or whatnot, tried using several shells, pipe is readable a+r. 
/etc/motd is not displayed when a named pipe?
linux;login;gentoo;motd
You're not missing anything obvious.  I dug into the source of the pam_motd module to figure this one out.The trick is that pam_motd does the following with /etc/motd:Check the size of the file.Allocate a buffer of that size.Read the entire file into the buffer.Output the buffer through whatever output method is in use.  (PAM is modular, after all; can't assume it's a terminal.)Since a pipe doesn't have a file size, this fails at step 1.EDIT: Why is PAM concerned about the size in the first place?  I imagine it's to prevent denials of service, either intentional or unintentional.  When PAM checks the file size, it also refuses to output the motd if the file is larger than 64 kbytes.  I imagine whoever tried to log into the system would be very sad if someone managed to pipe a DVD movie file into /etc/motd, for example -- not to mention how much memory that might take.