'\" t .TH "MACHINE\-ID" "5" "" "systemd 231" "machine-id" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" machine-id \- 本機"machine ID"配置文件 .SH "SYNOPSIS" .PP /etc/machine\-id .SH "描述" .PP /etc/machine\-id 文件包含一個 在安裝操作系統時生成的、專屬於本系統的、獨一無二的"machine ID"。 "machine ID"是一個32字符長度的十六進制小寫字母字符串, 並以換行符結尾, 其本質是一個128位二進制整數的16進製表示。 .PP "machine ID"通常在系統安裝時從一個隨機數源生成, 並且之後無論經過多少次開關機,也一直保持不變。 另一方面,對於無狀態系統,如果此文件爲空, 將在系統啓動的早期自動隨機生成一個。 .PP "machine ID"一旦生成應該永遠保持不變, 即使系統的硬件發生了變化也不應該修改它。 .PP 這裏的"machine ID"與"D\-Bus machine ID" 遵守相同的格式與邏輯。 .PP 無論主機的網絡配置如何變化, 應用程序始終可以使用"machine ID" 在全球範圍內精確的識別一臺主機。基於上述特性, "machine ID" 機制可用於取代 POSIX 的 \fBgethostid\fR(3) 系統調用功能。 .PP 操作系統的安裝程序可以在安裝時使用 \fBsystemd-machine-id-setup\fR(1) 工具來初始化"machine ID"。 可以使用 \fBsystemd-firstboot\fR(1) 初始化已掛載(但未啓動)的系統鏡像的"machine ID"。 .PP 還可以通過 \fIsystemd\&.machine_id=\fR 內核引導選項 或者 systemd 的 \fB\-\-machine\-id=\fR 命令行選項 來設置"machine ID"。這種方式經常用於網絡啓動的場景中。 注意,不可將"machine ID"設爲全零值。 .SH "與 OSF UUID 的關係" .PP "machine ID"符合 \m[blue]\fBRFC 4122\fR\m[]\&\s-2\u[1]\d\s+2 規範(OSF v4 UUID), 同時也符合 Microsoft GUID 規範。 .SH "歷史" .PP /etc/machine\-id 文件的格式源自D\-Bus的 /var/lib/dbus/machine\-id 文件。 實際上,/var/lib/dbus/machine\-id 很可能就是指向 /etc/machine\-id 的一個軟連接。 .SH "參見" .PP \fBsystemd\fR(1), \fBsystemd-machine-id-setup\fR(1), \fBgethostid\fR(3), \fBhostname\fR(5), \fBmachine-info\fR(5), \fBos-release\fR(5), \fBsd-id128\fR(3), \fBsd_id128_get_machine\fR(3), \fBsystemd-firstboot\fR(1) .SH "NOTES" .IP " 1." 4 RFC 4122 .RS 4 \%https://tools.ietf.org/html/rfc4122 .RE .SH "跋" .br 本頁面中文版由中文 man 手冊頁計劃提供。 .PP 翻譯人員:金步國 .br 金步國作品集:http://www.jinbuguo.com .br .br 中文 man 手冊頁計劃:\fBhttps://github.com/man-pages-zh/manpages-zh\fR