Linux内核Live Patching(热补丁)是指在运行的系统上打补丁,好处是不用重启系统既可生效。
live patching是如何实现的?

Canonical提供了Livepatch Service,使用它可以在Ubuntu上为内核打热补丁。它可免费应用在3个64位的Ubuntu 16.04系统上。
首先,确保/etc/apt/sources.list有如下源:
deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
更新系统:
$ sudo apt update
$ sudo apt upgrade
安装snapd:
$ sudo apt install snapd
访问https://ubuntu.com/livepatch,获得livepatch服务密钥(需登陆)


安装canonical-livepatch:
$ sudo snap install canonical-livepatch
$ sudo canonical-livepatch enable {替换为你的密钥}
查看Live Patching状态:
$ canonical-livepatch status
$ canonical-livepatch status --verbose # 详细信息

canonical-livepatchd是后台服务进程,它负责热补丁的安装。