I am able to test simple dynamic-motd with fortune example on my Debian Jessie 8.2 host as below and found the issue to be related to a buggy behavior.
mkdir /etc/update-motd.d
cd /etc/update-motd.d
Created two test files as below and made them executable
root@debian:/# cd /etc/update-motd.d/
root@debian:/etc/update-motd.d# ls -l
total 8
-rwxr-xr-x 1 root root 58 Dec 1 23:21 00-header
-rwxr-xr-x 1 root root 41 Dec 1 22:52 90-fortune
root@debian:/etc/update-motd.d# cat 00-header
#!/bin/bash
echo
echo 'Welcome !! This is a header'
echo
root@debian:/etc/update-motd.d# cat 90-fortune
#!/bin/bash
echo
/usr/games/fortune
echo
However at this time, there was no change in motd. So i strace'd sshd process.From that trace (interesting parts shown below), you can see that newly created motd.new file is renamed to /var/run/motd. However it's later trying to read from /run/motd.dynamic - which was never created
20318 rename("/var/run/motd.new", "/var/run/motd") = 0
20318 open("/run/motd.dynamic", O_RDONLY) = -1 ENOENT (No such file or directory)
20318 open("/etc/motd", O_RDONLY) = 8
The issue seem to be related to inconsistencies with pam_motd module. See bug report https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=743286;msg=2
Simply changing motd file location from /run/motd.dynamic
to /run/motd
in /etc/pam.d/sshd
- makes it work for me
root@debian:/etc/pam.d# grep pam_motd sshd
#session optional pam_motd.so motd=/run/motd.dynamic
session optional pam_motd.so motd=/run/motd
session optional pam_motd.so noupdate
Here is the sample MOTD seen during ssh login ...
Welcome !! This is a header
* Culus fears perl - the language with optional errors
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
You have new mail.
Last login: Tue Dec 1 23:49:57 2015 from x.x.x.x
pam_motd.so noupdate
be the problem there?