/ etc / motd如何更新?

Modified on: Fri, 08 Jun 2018 23:27:53 +0800

我想知道/ etc / motd是如何自动更新的(我在Ubuntu 10.04,服务器版)。我通过网络搜索找到了update-motd联机帮助页,但该程序未安装在我的计算机上。但是,/ etc / motd文件会定期更新。我只是不知道如何以及如何经常。在执行locate motd时,会列出以下文件:

/etc/motd /etc/update-motd.d /etc/update-motd.d/00-header /etc/update-motd.d/10-help-text /etc/update-motd.d/20-cpu-checker /etc/update-motd.d/50-landscape-sysinfo /etc/update-motd.d/90-updates-available /etc/update-motd.d/91-release-upgrade /etc/update-motd.d/98-reboot-required /etc/update-motd.d/99-footer /home/me/.cache/motd.legal-displayed /lib/security/pam_motd.so /usr/bin/motd+shell /usr/lib/update-manager/release-upgrade-motd /usr/lib/update-notifier/update-motd-cpu-checker /usr/lib/update-notifier/update-motd-reboot-required /usr/lib/update-notifier/update-motd-updates-available /usr/share/base-files/motd.md5sums /usr/share/man/man1/motd+shell.1.gz /usr/share/man/man5/motd.5.gz /usr/share/man/man5/motd.tail.5.gz /usr/share/man/man5/update-motd.5.gz /usr/share/man/man8/pam_motd.8.gz /usr/share/ubuntu-serverguide/html/C/pam_motd.html

最佳答案

登录时由pam_motd更新。 update-motd手册页描述了这一点:

   Ubuntu introduced the update-motd framework, by which  the  motd(5)  is
   dynamically assembled from a collection of scripts at login.

   Executable  scripts in /etc/update-motd.d/* are executed by pam_motd(8)
   as the root user at each login, and this information is concatenated in
   /var/run/motd.  The order of script execution is determined by the run-
   parts(8) --lsbsysinit option (basically alphabetical order, with a  few
   caveats).

   On   Ubuntu   systems,  /etc/motd  is  typically  a  symbolic  link  to
   /var/run/motd.

相关问答

添加新评论