我sudo yum update
在 Amazon Linux 实例上运行,它更新了内核。在我见过的其他发行版中,这会导致登录时出现一条消息,提示System Restart Required
。为什么我在这里看不到它?
Last login: Mon Jun 2 17:06:11 2014 from ...
__| __|_ )
_| ( / Amazon Linux AMI
___|\___|___|
https://aws.amazon.com/amazon-linux-ami/2014.03-release-notes/
[myuser@dev ~]$ uname -a
Linux dev.myhost.com.au 3.4.82-69.112.amzn1.x86_64 #1 SMP Mon Feb 24 16:31:21 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
[myuser@dev ~]$ cd /boot
[myuser@dev boot]$ ls -l
total 45208
-rw-r--r-- 1 root root 80189 May 6 04:31 config-3.10.38-49.136.amzn1.x86_64
-rw-r--r-- 1 root root 80189 May 14 07:38 config-3.10.40-50.136.amzn1.x86_64
-rw-r--r-- 1 root root 70178 Feb 25 03:36 config-3.4.82-69.112.amzn1.x86_64
drwxr-xr-x 2 root root 4096 Jun 2 17:07 grub
-rw------- 1 root root 10203096 May 12 03:58 initramfs-3.10.38-49.136.amzn1.x86_64.img
-rw------- 1 root root 10203665 Jun 2 17:07 initramfs-3.10.40-50.136.amzn1.x86_64.img
-rw------- 1 root root 8777362 Mar 4 23:18 initramfs-3.4.82-69.112.amzn1.x86_64.img
-rw-r--r-- 1 root root 128784 May 6 04:31 symvers-3.10.38-49.136.amzn1.x86_64.gz
-rw-r--r-- 1 root root 128805 May 14 07:38 symvers-3.10.40-50.136.amzn1.x86_64.gz
-rw------- 1 root root 2201080 May 6 04:31 System.map-3.10.38-49.136.amzn1.x86_64
-rw------- 1 root root 2201155 May 14 07:38 System.map-3.10.40-50.136.amzn1.x86_64
-rw------- 1 root root 1727495 Feb 25 03:36 System.map-3.4.82-69.112.amzn1.x86_64
-rwxr-xr-x 1 root root 3657552 May 6 04:31 vmlinuz-3.10.38-49.136.amzn1.x86_64
-rwxr-xr-x 1 root root 3659152 May 14 07:38 vmlinuz-3.10.40-50.136.amzn1.x86_64
-rwxr-xr-x 1 root root 3145488 Feb 25 03:36 vmlinuz-3.4.82-69.112.amzn1.x86_64
[myuser@dev boot]$ cat grub/grub.conf
# created by imagebuilder
default=0
timeout=1
hiddenmenu
title Amazon Linux 2014.03 (3.10.40-50.136.amzn1.x86_64)
root (hd0)
kernel /boot/vmlinuz-3.10.40-50.136.amzn1.x86_64 root=LABEL=/ console=hvc0 LANG=en_US.UTF-8 KEYTABLE=us
initrd /boot/initramfs-3.10.40-50.136.amzn1.x86_64.img
title Amazon Linux 2014.03 (3.10.38-49.136.amzn1.x86_64)
root (hd0)
kernel /boot/vmlinuz-3.10.38-49.136.amzn1.x86_64 root=LABEL=/ console=hvc0 LANG=en_US.UTF-8 KEYTABLE=us
initrd /boot/initramfs-3.10.38-49.136.amzn1.x86_64.img
title Amazon Linux 2013.09 (3.4.82-69.112.amzn1.x86_64)
root (hd0)
kernel /boot/vmlinuz-3.4.82-69.112.amzn1.x86_64 root=LABEL=/ console=hvc0 LANG=en_US.UTF-8 KEYTABLE=us
initrd /boot/initramfs-3.4.82-69.112.amzn1.x86_64.img
重新启动系统并确认新内核正在运行...
Last login: Thu Jun 5 10:55:30 2014 from ...
__| __|_ )
_| ( / Amazon Linux AMI
___|\___|___|
https://aws.amazon.com/amazon-linux-ami/2014.03-release-notes/
[myuser@dev ~]$ uname -a
Linux dev.myhost.com.au 3.10.40-50.136.amzn1.x86_64 #1 SMP Tue May 13 21:35:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
答案1
这主要是 Ubuntu 的事情(我想 Debian 也是)。它是 update-motd 系统的一部分,/etc/update-motd.d 中有一堆脚本,它们偶尔会重写您首次登录时显示的每日消息。 这是 Ubuntu wiki 页面
Amazon Linux 源自 Red Hat Enterprise Linux(即,您使用的是“yum”而不是“apt”),并且显然没有当天的动态消息系统。