升级到 14.04 服务器后,如何恢复最初的“统计页面”(当天消息)?

Und*_*ndo 6 server

我使用 Ubuntu Server 已经有一段时间了,当我通过 SSH 登录时,我喜欢看到这个:

Welcome to Ubuntu 13.04 (GNU/Linux 3.8.0-35-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Mon Apr 21 02:06:46 UTC 2014

  System load:  0.0               Processes:           88
  Usage of /:   64.8% of 7.75GB   Users logged in:     0
  Memory usage: 64%               IP address for eth0: xx.xx.xxx.xxx
  Swap usage:   0%

  Graph this data and manage this system at:
    https://landscape.canonical.com/

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

  Use Juju to deploy your cloud instances and workloads:
    https://juju.ubuntu.com/#cloud-raring

0 packages can be updated.
0 updates are security updates.

*** /dev/xvda1 will be checked for errors at next reboot ***

Last login: Fri Apr 18 21:29:50 2014 from bla-bla-bla.foo.bar.net
ubuntu@ip-xx-yy-zzz-aaa:~$
Run Code Online (Sandbox Code Playgroud)

但是,在将我的一台服务器升级到 14.04 后,我只看到以下内容:

$ ssh closet
Last login: Sun Apr 20 19:42:57 2014 from 192.168.0.7
me@server1:~$
Run Code Online (Sandbox Code Playgroud)

我不太喜欢这个。如何恢复旧的欢迎屏幕?

小智 9

您所看到的统计数据是由使用的输出脚本提供landscape-sysinfoupdate-motd建设进程。它似乎不再默认安装在 14.04 中。

安装landscape-common以将统计信息重新插入到 motd 中。(安装后,cronjob 可能需要 10 分钟来更新 motd)。


Set*_*eth 2

从评论中收集的信息来看,您没有该/etc/motd文件。由于这只是一个符号链接,/var/run/motd并且您确认您拥有该文件,因此只需使用以下命令重新创建链接:

sudo ln -s /var/run/motd /etc/motd  
Run Code Online (Sandbox Code Playgroud)

重新启动服务器。


琐事:

  • motd 代表“每日消息”。它包含您在启动服务器时看到的信息。

  • /etc/update-motd.d该文件夹中的脚本会在启动时更新 motd