upgrading from lucid to maverik (server edition), for some reason, the package update-notifier-common was removed.
As main effect I have pam_motd to not refresh the /var/run/motd file.
Looking into the code (mainly the Steve's patch revision) I found the problem.
As Steve said: "I've also tweaked the first patch slightly, to avoid clobbering /var/run/motd if [...] the run-parts call fails;"
This is useful, but in my case, I have had a "dirty" update-motd.d directory, with some scripts exiting with error (ie: "run-parts: /etc/update-motd.d/20-cpu-checker exited with return code 2").
The system() call returns the error and the file /var/run/motd.new was never renamed into /var/run/motd.
Consider that even if some scripts of the update-mod.d chain fail, the file /var/run/motd.new is created and written to disk with the only output of the working scripts.
I have attached a patch that should solve this problem (at least I think it is a problem :) ).
The rename() call is not blocked by the system() call and moreover if run-parts exits with error (system()!=0) pam_syslog is used to log it and help sysadmins to find rapidly the problem.
If run-parts fails totally and /var/run/motd.new is not created, the rename() call returns the error (but we are not interested in it).
Hello,
upgrading from lucid to maverik (server edition), for some reason, the package update-notifier-common was removed.
As main effect I have pam_motd to not refresh the /var/run/motd file.
Looking into the code (mainly the Steve's patch revision) I found the problem.motd.d/20-cpu-checker exited with return code 2").
As Steve said: "I've also tweaked the first patch slightly, to avoid clobbering /var/run/motd if [...] the run-parts call fails;"
This is useful, but in my case, I have had a "dirty" update-motd.d directory, with some scripts exiting with error (ie: "run-parts: /etc/update-
The system() call returns the error and the file /var/run/motd.new was never renamed into /var/run/motd.
Consider that even if some scripts of the update-mod.d chain fail, the file /var/run/motd.new is created and written to disk with the only output of the working scripts.
I have attached a patch that should solve this problem (at least I think it is a problem :) ).
The rename() call is not blocked by the system() call and moreover if run-parts exits with error (system()!=0) pam_syslog is used to log it and help sysadmins to find rapidly the problem.
If run-parts fails totally and /var/run/motd.new is not created, the rename() call returns the error (but we are not interested in it).
I hope to be useful.
Yusef