当我使用Ubuntu服务器时,人们通常会向我打招呼
Welcome to Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-45-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information disabled due to load higher than 1.0
* Canonical Livepatch is available for installation.
- Reduce system reboots and improve kernel security. Activate at:
https://ubuntu.com/livepatch
0 packages can be updated.
0 updates are security updates.这里,
System information disabled due to load higher than 1.0根据加载条件,运行landscape-sysinfo
System information as of Tue Feb 19 04:22:46 UTC 2019
System load: 0.0
Usage of /: 60.2% of 19.78GB
Memory usage: 21%
Swap usage: 0%
Processes: 93
Users logged in: 1
IP address for enp0s3: 192.168.56.200
IP address for enp0s8: 10.0.3.15
IP address for docker_gwbridge: 172.18.0.1
IP address for docker0: 172.17.0.1我想被无条件地展示出来
如何修改它呢?
此外,什么是高于1.0的负载?
如何添加/删除在cli登录时运行的其他命令?
发布于 2019-02-19 13:34:18
Ubuntu中的当天的信息(MOTD)由目录/etc/update-motd.d/ (以及文件/etc/update-motd,如果有的话)控制。特别是,正如在/etc/update-motd.d/50-landscape-sysinfo中提到的那样,景观信息驻留在文件他们的回答中。
在我的Ubuntu16.04中,文件/etc/update-motd.d/50-landscape-sysinfo包含一些条目设置,然后是一个if块。因此,要显示信息而不考虑条件,只需删除除谢邦和if块内容之外的所有内容。我的Ubuntu 16.04的结果:
#!/bin/sh
echo
echo -n " System information as of "
/bin/date
echo
/usr/bin/landscape-sysinfo为此,在终端中使用以下过程:
cd /etc/update-motd.d # go to the right directory
sudo cp -L 50-landscape-sysinfo{,.bak} # keep a backup copy: 50-landscape-sysinfo.bak
sudo nano 50-landscape-sysinfo # edit the file contents using 'nano'
# (or your favorite text editor)
# and paste the above contents to it什么是高于1.0的负载?
加载会告诉您计算机当前需要多少硬件资源。根据经验,如果它高于计算机的处理器(核心)计数,任务就会延迟。在启动后获得高负载的MOTD消息是可以的,但是如果它持续出现几天(MOTD可能每天更新一次),检查您的机器是否足够强大以完成它正在执行的任务。
如何添加/删除在cli登录时运行的其他命令?
有多种方法,正确的方法取决于目的。您可以简单地向目录/etc/update-motd.d/添加一个脚本,但是只有在更新了MOTD之后才会运行它。
发布于 2019-02-19 09:21:30
您在登录时看到的消息由motd生成。这个特定的定义是在/etc/update-motd.d/50-landscape-sysinfo中定义的。要使其运行而不考虑加载(如果负载较高,则可以通过ssh进行连接),只需从文件中删除条件,然后文件如下所示:
#!/bin/sh
echo
echo -n " System information as of "
/bin/date
echo
/usr/bin/landscape-sysinfo至于负载值,它表示负载平均值,可以读取更多的https://en.wikipedia.org/wiki/Load_(计算)。
https://askubuntu.com/questions/1119406
复制相似问题