'\" t
.TH "SYSTEMD\-MACHINE\-ID\-SETUP" "1" "" "systemd 231" "systemd-machine-id-setup"
.\" -----------------------------------------------------------------
.\" * 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"
systemd-machine-id-setup \- 初始化 /etc/machine\-id 檔案
.SH "SYNOPSIS"
.HP \w'\fBsystemd\-machine\-id\-setup\fR\ 'u
\fBsystemd\-machine\-id\-setup\fR
.SH "描述"
.PP
\fBsystemd\-machine\-id\-setup\fR
可被作業系統安裝程式用來初始化
/etc/machine\-id
中的"machine ID"值, 可以設為一個指定值,也可以設為一個隨機生成的值。詳見
\fBmachine-id\fR(5)
手冊。
.PP
如果沒有明確使用
\fB\-\-commit\fR
選項並且
/etc/machine\-id
不存在或其中的值不合格, 那麼將初始化一個新的"machined ID"。 此新"machine ID"將依次使用下列方法獲得:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  1." 4.2
.\}
如果已經存在一個有效的 D\-Bus "machine ID", 那麼就使用此 D\-Bus "machine ID" 來初始化
/etc/machine\-id
檔案。
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  2." 4.2
.\}
如果執行在已經配置了UUID(透過
\fB\-uuid\fR
選項)的KVM虛擬機器中, 那麼就使用此UUID來初始化 /etc/machine\-id 檔案。 KVM虛擬機器的建立者 必須確保UUID的唯一性。
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  3." 4.2
.\}
如果執行在已經配置了UUID的Linux容器中, 那麼就使用此UUID來初始化 /etc/machine\-id 檔案。 詳見
\m[blue]\fBContainer Interface\fR\m[]\&\s-2\u[1]\d\s+2
文件。
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 4.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  4." 4.2
.\}
如果上述方法都不可用, 那麼隨機生成一個新的"machine ID"來初始化 /etc/machine\-id 檔案。
.RE
.PP
可以使用
\fB\-\-commit\fR
選項將新生成的臨時"machine ID"寫入到磁碟中永久儲存。 詳見下文。
.PP
可以使用
\fBsystemd-firstboot\fR(1)
初始化已掛載(但未啟動)的系統映象的"machine ID"。
.SH "選項"
.PP
能夠識別的命令列選項如下:
.PP
\fB\-\-root=\fR\fB\fIroot\fR\fR
.RS 4
指定一個"根目錄", 包括配置檔案在內的所有路徑都將加上
\fIroot\fR
字首,包括
/etc/machine\-id
自身。
.RE
.PP
\fB\-\-commit\fR
.RS 4
將生成的臨時"machine ID"寫入到磁碟中永久儲存。 所謂"臨時"的意思是指在 系統啟動的早期繫結掛載的
"tmpfs"
檔案系統中的
/etc/machine\-id
檔案。 這可能是由於在系統啟動的早期,
/etc
依然處於只讀狀態 並且其中並不包含合格的 /etc/machine\-id 檔案。
.sp
如果
/etc/machine\-id
未被繫結掛載到
"tmpfs"
檔案系統, 或者
/etc
處於只讀狀態, 那麼此選項將不執行任何操作。 否則,此命令將會把臨時生成的"machine ID"寫入到磁碟中, 然後解除安裝
/etc/machine\-id
所在的檔案系統, 以確保"machine ID"確實被永久儲存。
.sp
此選項主要被系統啟動早期的
\fBsystemd-machine-id-commit.service\fR(8)
使用。
.RE
.PP
\fB\-\-print\fR
.RS 4
操作完成之後打印出"machine ID"的值
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
顯示簡短的幫助資訊並退出。
.RE
.PP
\fB\-\-version\fR
.RS 4
顯示簡短的版本資訊並退出。
.RE
.SH "退出狀態"
.PP
返回值為 0 表示成功, 非零返回值表示失敗程式碼。
.SH "參見"
.PP
\fBsystemd\fR(1),
\fBmachine-id\fR(5),
\fBsystemd-machine-id-commit.service\fR(8),
\fBdbus-uuidgen\fR(1),
\fBsystemd-firstboot\fR(1)
.SH "NOTES"
.IP " 1." 4
Container Interface
.RS 4
\%http://www.freedesktop.org/wiki/Software/systemd/ContainerInterface
.RE
.SH "跋"
.br
本頁面中文版由中文 man 手冊頁計劃提供。
.PP
翻譯人員:金步國
.br
金步國作品集:http://www.jinbuguo.com
.br
.br
中文 man 手冊頁計劃:\fBhttps://github.com/man-pages-zh/manpages-zh\fR