Debian Codegraph @

po/ru/man2/pivot_root.2.po

raw
1 # Russian translation of manpages
2 # This file is distributed under the same license as the manpages-l10n package.
3 # Copyright © of this file:
4 # Alexey, 2016.
5 # Azamat Hackimov <[email protected]>, 2014-2017.
6 # kogamatranslator49 <[email protected]>, 2015.
7 # Darima Kogan <[email protected]>, 2014.
8 # Max Is <[email protected]>, 2016.
9 # Yuri Kozlov <[email protected]>, 2011-2019.
10 # Иван Павлов <[email protected]>, 2017.
11 msgid ""
12 msgstr ""
13 "Project-Id-Version: manpages-l10n\n"
14 "POT-Creation-Date: 2026-06-05 06:35+0200\n"
15 "PO-Revision-Date: 2024-12-21 19:49+0300\n"
16 "Last-Translator: Yuri Kozlov <[email protected]>\n"
17 "Language-Team: Russian <[email protected]>\n"
18 "Language: ru\n"
19 "MIME-Version: 1.0\n"
20 "Content-Type: text/plain; charset=UTF-8\n"
21 "Content-Transfer-Encoding: 8bit\n"
22 "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
23 "n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || "
24 "(n%100>=11 && n%100<=14)? 2 : 3);\n"
25 "X-Generator: Lokalize 2.0\n"
26
27 #. type: TH
28 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
29 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
30 #, no-wrap
31 msgid "pivot_root"
32 msgstr "pivot_root"
33
34 #. type: TH
35 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
36 #: opensuse-tumbleweed
37 #, no-wrap
38 msgid "2026-02-08"
39 msgstr "8 февраля 2026 г."
40
41 #. type: TH
42 #: archlinux debian-unstable
43 #, fuzzy, no-wrap
44 #| msgid "Linux man-pages 6.17"
45 msgid "Linux man-pages 6.18"
46 msgstr "Справочные страницы Linux 6.17"
47
48 #. type: SH
49 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
50 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
51 #, no-wrap
52 msgid "NAME"
53 msgstr "НАИМЕНОВАНИЕ"
54
55 #. type: Plain text
56 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
57 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
58 #, fuzzy
59 #| msgid "pivot_root - change the root filesystem"
60 msgid "pivot_root - change the root mount"
61 msgstr "pivot_root - изменяет корневую файловую систему"
62
63 #. type: SH
64 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
65 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
66 #, no-wrap
67 msgid "LIBRARY"
68 msgstr "БИБЛИОТЕКА"
69
70 #. type: Plain text
71 #: archlinux debian-unstable fedora-44 fedora-rawhide mageia-cauldron
72 #: opensuse-leap-16-1 opensuse-tumbleweed
73 msgid "Standard C library (I<libc>,\\ I<-lc>)"
74 msgstr "Стандартная библиотека языка C (I<libc>,\\ I<-lc>)"
75
76 #. type: SH
77 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
78 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
79 #, no-wrap
80 msgid "SYNOPSIS"
81 msgstr "СИНТАКСИС"
82
83 #. type: Plain text
84 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
85 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
86 #, no-wrap
87 msgid ""
88 "B<#include E<lt>sys/syscall.hE<gt>> /* Definition of B<SYS_*> constants */\n"
89 "B<#include E<lt>unistd.hE<gt>>\n"
90 msgstr ""
91 "B<#include E<lt>sys/syscall.hE<gt>> /* определения констант B<SYS_*> */\n"
92 "B<#include E<lt>unistd.hE<gt>>\n"
93
94 #. type: Plain text
95 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
96 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
97 #, no-wrap
98 msgid "B<int syscall(SYS_pivot_root, const char *>I<new_root>B<, const char *>I<put_old>B<);>\n"
99 msgstr "B<int syscall(SYS_pivot_root, const char *>I<new_root>B<, const char *>I<put_old>B<);>\n"
100
101 #. type: Plain text
102 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
103 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
104 msgid ""
105 "I<Note>: glibc provides no wrapper for B<pivot_root>(), necessitating the "
106 "use of B<syscall>(2)."
107 msgstr ""
108
109 #. type: SH
110 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
111 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
112 #, no-wrap
113 msgid "DESCRIPTION"
114 msgstr "ОПИСАНИЕ"
115
116 #. type: Plain text
117 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
118 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
119 #, fuzzy
120 #| msgid ""
121 #| "B<pivot_root>() changes the root filesystem in the mount namespace of "
122 #| "the calling process. More precisely, it moves the root filesystem to the "
123 #| "directory I<put_old> and makes I<new_root> the new root filesystem. The "
124 #| "calling process must have the B<CAP_SYS_ADMIN> capability in the user "
125 #| "namespace that owns the caller's mount namespace."
126 msgid ""
127 "B<pivot_root>() changes the root mount in the mount namespace of the "
128 "calling process. More precisely, it moves the root mount to the directory "
129 "I<put_old> and makes I<new_root> the new root mount. The calling process "
130 "must have the B<CAP_SYS_ADMIN> capability in the user namespace that owns "
131 "the caller's mount namespace."
132 msgstr ""
133 "Системный вызов B<pivot_root>() изменяет корневую файловую систему в "
134 "пространстве имён монтирования вызывающего процесса. Точнее говоря, он "
135 "перемещает корневую файловую систему в каталог I<put_old> и делает "
136 "I<new_root> новой корневой файловой системой. Вызывающий процесс должен "
137 "иметь мандат B<CAP_SYS_ADMIN> в пользовательском пространстве имён, которому "
138 "принадлежит пространство имён монтирования вызывающего."
139
140 #. type: Plain text
141 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
142 #: opensuse-tumbleweed
143 #, fuzzy
144 #| msgid ""
145 #| "The paragraph above is intentionally vague because at the time when "
146 #| "B<pivot_root>() was first implemented, it was unclear whether its affect "
147 #| "on other process's root and current working directories\\(emand the "
148 #| "caller's current working directory\\(emmight change in the future. "
149 #| "However, the behavior has remained consistent since this system call was "
150 #| "first implemented: B<pivot_root>() changes the root directory and the "
151 #| "current working directory of each process or thread in the same mount "
152 #| "namespace to I<new_root> if they point to the old root directory. (See "
153 #| "also NOTES.) On the other hand, B<pivot_root>() does not change the "
154 #| "caller's current working directory (unless it is on the old root "
155 #| "directory), and thus it should be followed by a B<chdir(\"/\")> call."
156 msgid ""
157 "B<pivot_root>() changes the root directory and the current working "
158 "directory of each process or thread in the same mount namespace to "
159 "I<new_root> if they point to the old root directory. (See also NOTES.) On "
160 "the other hand, B<pivot_root>() does not change the caller's current "
161 "working directory (unless it is on the old root directory), and thus it "
162 "should be followed by a I<chdir(\"/\")> call."
163 msgstr ""
164 "Параграф выше намеренно написан абстрактно, так как на момент первой "
165 "реализации B<pivot_root>() было неясно, изменится ли его влияние на другие "
166 "процессы корня и текущие рабочие каталоги — как и на текущий рабочий каталог "
167 "вызывающего — в будущем. Однако поведение не изменилось с момента первой "
168 "реализации системного вызова: B<pivot_root>() изменяет корневой каталог и "
169 "текущий рабочий каталог каждого процесс или нити в одном пространстве имён "
170 "монтирования на I<new_root>, если они указывают на старый корневой каталог "
171 "(смотрите ЗАМЕЧАНИЯ). С другой стороны, B<pivot_root>() не изменяет текущий "
172 "рабочий каталог вызывающего (если это старый корневой каталог), и поэтому он "
173 "должен запускаться после вызова B<chdir(\"/\")>."
174
175 #. type: Plain text
176 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
177 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
178 msgid "The following restrictions apply:"
179 msgstr "Накладываются следующие ограничения:"
180
181 #. type: IP
182 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
183 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
184 #, no-wrap
185 msgid "\\[bu]"
186 msgstr "\\[bu]"
187
188 #. type: Plain text
189 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
190 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
191 msgid "I<new_root> and I<put_old> must be directories."
192 msgstr "Аргументы I<new_root> и I<put_old> должны быть каталогами."
193
194 #. type: Plain text
195 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
196 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
197 #, fuzzy
198 #| msgid "I<new_root> and I<put_old> must be directories."
199 msgid ""
200 "I<new_root> and I<put_old> must not be on the same mount as the current root."
201 msgstr "Аргументы I<new_root> и I<put_old> должны быть каталогами."
202
203 #. type: Plain text
204 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
205 #: opensuse-tumbleweed
206 #, fuzzy
207 #| msgid ""
208 #| "I<put_old> must be at or underneath I<new_root>; that is, adding a "
209 #| "nonnegative number of I</..> to the string pointed to by I<put_old> must "
210 #| "yield the same directory as I<new_root>."
211 msgid ""
212 "I<put_old> must be at or underneath I<new_root>; that is, adding some "
213 "nonnegative number of \\[dq]I</..\\&>\\[dq] suffixes to the pathname pointed "
214 "to by I<put_old> must yield the same directory as I<new_root>."
215 msgstr ""
216 "Аргумент I<put_old> должен быть равен или ниже I<new_root>, т. е., при "
217 "добавлении неотрицательного количества I</..> в строку, на которую указывает "
218 "I<put_old>, должен получаться каталог, равный I<new_root>."
219
220 #. type: Plain text
221 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
222 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
223 #, fuzzy
224 #| msgid ""
225 #| "I<new_root> must be a mount point. (If it is not otherwise a mount "
226 #| "point, it suffices to bind mount I<new_root> on top of itself.)"
227 msgid ""
228 "I<new_root> must be a path to a mount point, but can't be I<\\[dq]/\\[dq]>. "
229 "A path that is not already a mount point can be converted into one by bind "
230 "mounting the path onto itself."
231 msgstr ""
232 "Значение I<new_root> должно быть точкой монтирования (если это не точка "
233 "монтирования, то достаточно привязать монтирование I<new_root> поверх самой "
234 "себя)."
235
236 #. type: Plain text
237 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
238 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
239 msgid ""
240 "The propagation type of the parent mount of I<new_root> and the parent mount "
241 "of the current root directory must not be B<MS_SHARED>; similarly, if "
242 "I<put_old> is an existing mount point, its propagation type must not be "
243 "B<MS_SHARED>. These restrictions ensure that B<pivot_root>() never "
244 "propagates any changes to another mount namespace."
245 msgstr ""
246 "Тип распространения родительского монтирования I<new_root> и родительского "
247 "монтирования текущего корневого каталога не должно быть равно B<MS_SHARED>; "
248 "схожим образом, если I<put_old> — существующая точка монтирования, то её тип "
249 "распространения не должен быть B<MS_SHARED>. Эти ограничения гарантируют, "
250 "что B<pivot_root>() никогда не распространит изменения в другие пространства "
251 "имён монтирования."
252
253 #. type: Plain text
254 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
255 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
256 msgid "The current root directory must be a mount point."
257 msgstr "Текущий корневой каталог должен быть точкой монтирования."
258
259 #. type: SH
260 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
261 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
262 #, no-wrap
263 msgid "RETURN VALUE"
264 msgstr "ВОЗВРАЩАЕМОЕ ЗНАЧЕНИЕ"
265
266 #. type: Plain text
267 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
268 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
269 msgid ""
270 "On success, zero is returned. On error, -1 is returned, and I<errno> is set "
271 "to indicate the error."
272 msgstr ""
273 "При успешном выполнении возвращается 0. При ошибке возвращается -1, а в "
274 "I<errno> содержится код ошибки."
275
276 #. type: SH
277 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
278 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
279 #, no-wrap
280 msgid "ERRORS"
281 msgstr "ОШИБКИ"
282
283 #. type: Plain text
284 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
285 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
286 msgid ""
287 "B<pivot_root>() may fail with any of the same errors as B<stat>(2). "
288 "Additionally, it may fail with the following errors:"
289 msgstr ""
290 "Вызов B<pivot_root>() может завершиться любой из ошибок что и B<stat>(2). "
291 "Кроме это, могут возвращаться следующие ошибки:"
292
293 #. type: TP
294 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
295 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
296 #, no-wrap
297 msgid "B<EBUSY>"
298 msgstr "B<EBUSY>"
299
300 #. #-#-#-#-# archlinux: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-#
301 #. Reconfirmed that the following error occurs on Linux 5.0 by
302 #. specifying 'new_root' as "/rootfs" and 'put_old' as
303 #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of
304 #. itself. Of course, this is an odd situation, since a later check
305 #. in the kernel code will in any case yield EINVAL if 'new_root' is
306 #. not a mount point. However, when the system call was first added,
307 #. 'new_root' was not required to be a mount point. So, this
308 #. error is nowadays probably just the result of crufty accumulation.
309 #. This error can also occur if we bind mount "/" on top of itself
310 #. and try to specify "/" as the 'new' (again, an odd situation). So,
311 #. the EBUSY check in the kernel does still seem necessary to prevent
312 #. that case. Furthermore, the "or put_old" piece is probably
313 #. redundant text (although the check is in the kernel), since,
314 #. in another check, 'put_old' is required to be under 'new_root'.
315 #. type: Plain text
316 #. #-#-#-#-# debian-trixie: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-#
317 #. Reconfirmed that the following error occurs on Linux 5.0 by
318 #. specifying 'new_root' as "/rootfs" and 'put_old' as
319 #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of
320 #. itself. Of course, this is an odd situation, since a later check
321 #. in the kernel code will in any case yield EINVAL if 'new_root' is
322 #. not a mount point. However, when the system call was first added,
323 #. 'new_root' was not required to be a mount point. So, this
324 #. error is nowadays probably just the result of crufty accumulation.
325 #. This error can also occur if we bind mount "/" on top of itself
326 #. and try to specify "/" as the 'new' (again, an odd situation). So,
327 #. the EBUSY check in the kernel does still seem necessary to prevent
328 #. that case. Furthermore, the "or put_old" piece is probably
329 #. redundant text (although the check is in the kernel), since,
330 #. in another check, 'put_old' is required to be under 'new_root'.
331 #. type: Plain text
332 #. #-#-#-#-# debian-unstable: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-#
333 #. Reconfirmed that the following error occurs on Linux 5.0 by
334 #. specifying 'new_root' as "/rootfs" and 'put_old' as
335 #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of
336 #. itself. Of course, this is an odd situation, since a later check
337 #. in the kernel code will in any case yield EINVAL if 'new_root' is
338 #. not a mount point. However, when the system call was first added,
339 #. 'new_root' was not required to be a mount point. So, this
340 #. error is nowadays probably just the result of crufty accumulation.
341 #. This error can also occur if we bind mount "/" on top of itself
342 #. and try to specify "/" as the 'new' (again, an odd situation). So,
343 #. the EBUSY check in the kernel does still seem necessary to prevent
344 #. that case. Furthermore, the "or put_old" piece is probably
345 #. redundant text (although the check is in the kernel), since,
346 #. in another check, 'put_old' is required to be under 'new_root'.
347 #. type: Plain text
348 #. #-#-#-#-# fedora-44: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-#
349 #. Reconfirmed that the following error occurs on Linux 5.0 by
350 #. specifying 'new_root' as "/rootfs" and 'put_old' as
351 #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of
352 #. itself. Of course, this is an odd situation, since a later check
353 #. in the kernel code will in any case yield EINVAL if 'new_root' is
354 #. not a mount point. However, when the system call was first added,
355 #. 'new_root' was not required to be a mount point. So, this
356 #. error is nowadays probably just the result of crufty accumulation.
357 #. This error can also occur if we bind mount "/" on top of itself
358 #. and try to specify "/" as the 'new' (again, an odd situation). So,
359 #. the EBUSY check in the kernel does still seem necessary to prevent
360 #. that case. Furthermore, the "or put_old" piece is probably
361 #. redundant text (although the check is in the kernel), since,
362 #. in another check, 'put_old' is required to be under 'new_root'.
363 #. type: Plain text
364 #. #-#-#-#-# fedora-rawhide: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-#
365 #. Reconfirmed that the following error occurs on Linux 5.0 by
366 #. specifying 'new_root' as "/rootfs" and 'put_old' as
367 #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of
368 #. itself. Of course, this is an odd situation, since a later check
369 #. in the kernel code will in any case yield EINVAL if 'new_root' is
370 #. not a mount point. However, when the system call was first added,
371 #. 'new_root' was not required to be a mount point. So, this
372 #. error is nowadays probably just the result of crufty accumulation.
373 #. This error can also occur if we bind mount "/" on top of itself
374 #. and try to specify "/" as the 'new' (again, an odd situation). So,
375 #. the EBUSY check in the kernel does still seem necessary to prevent
376 #. that case. Furthermore, the "or put_old" piece is probably
377 #. redundant text (although the check is in the kernel), since,
378 #. in another check, 'put_old' is required to be under 'new_root'.
379 #. type: Plain text
380 #. #-#-#-#-# mageia-cauldron: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-#
381 #. Reconfirmed that the following error occurs on Linux 5.0 by
382 #. specifying 'new_root' as "/rootfs" and 'put_old' as
383 #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of
384 #. itself. Of course, this is an odd situation, since a later check
385 #. in the kernel code will in any case yield EINVAL if 'new_root' is
386 #. not a mount point. However, when the system call was first added,
387 #. 'new_root' was not required to be a mount point. So, this
388 #. error is nowadays probably just the result of crufty accumulation.
389 #. This error can also occur if we bind mount "/" on top of itself
390 #. and try to specify "/" as the 'new' (again, an odd situation). So,
391 #. the EBUSY check in the kernel does still seem necessary to prevent
392 #. that case. Furthermore, the "or put_old" piece is probably
393 #. redundant text (although the check is in the kernel), since,
394 #. in another check, 'put_old' is required to be under 'new_root'.
395 #. type: Plain text
396 #. #-#-#-#-# opensuse-leap-16-1: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-#
397 #. Reconfirmed that the following error occurs on Linux 5.0 by
398 #. specifying 'new_root' as "/rootfs" and 'put_old' as
399 #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of
400 #. itself. Of course, this is an odd situation, since a later check
401 #. in the kernel code will in any case yield EINVAL if 'new_root' is
402 #. not a mount point. However, when the system call was first added,
403 #. 'new_root' was not required to be a mount point. So, this
404 #. error is nowadays probably just the result of crufty accumulation.
405 #. This error can also occur if we bind mount "/" on top of itself
406 #. and try to specify "/" as the 'new' (again, an odd situation). So,
407 #. the EBUSY check in the kernel does still seem necessary to prevent
408 #. that case. Furthermore, the "or put_old" piece is probably
409 #. redundant text (although the check is in the kernel), since,
410 #. in another check, 'put_old' is required to be under 'new_root'.
411 #. type: Plain text
412 #. #-#-#-#-# opensuse-tumbleweed: pivot_root.2.pot (PACKAGE VERSION) #-#-#-#-#
413 #. Reconfirmed that the following error occurs on Linux 5.0 by
414 #. specifying 'new_root' as "/rootfs" and 'put_old' as
415 #. "/rootfs/oldrootfs", and *not* bind mounting "/rootfs" on top of
416 #. itself. Of course, this is an odd situation, since a later check
417 #. in the kernel code will in any case yield EINVAL if 'new_root' is
418 #. not a mount point. However, when the system call was first added,
419 #. 'new_root' was not required to be a mount point. So, this
420 #. error is nowadays probably just the result of crufty accumulation.
421 #. This error can also occur if we bind mount "/" on top of itself
422 #. and try to specify "/" as the 'new' (again, an odd situation). So,
423 #. the EBUSY check in the kernel does still seem necessary to prevent
424 #. that case. Furthermore, the "or put_old" piece is probably
425 #. redundant text (although the check is in the kernel), since,
426 #. in another check, 'put_old' is required to be under 'new_root'.
427 #. type: Plain text
428 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
429 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
430 #, fuzzy
431 #| msgid ""
432 #| "I<new_root> or I<put_old> is on the current root filesystem. (This error "
433 #| "covers the pathological case where I<new_root> is I<\"/\">.)"
434 msgid ""
435 "I<new_root> or I<put_old> is on the current root mount. (This error covers "
436 "the pathological case where I<new_root> is I<\\[dq]/\\[dq]>.)"
437 msgstr ""
438 "Аргумент I<new_root> или I<put_old> находится в текущей корневой файловой "
439 "системе (эта ошибка возникает при патологическом случае когда значение "
440 "I<new_root> равно I<\"/\">)."
441
442 #. type: TP
443 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
444 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
445 #, no-wrap
446 msgid "B<EINVAL>"
447 msgstr "B<EINVAL>"
448
449 #. type: Plain text
450 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
451 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
452 msgid "I<new_root> is not a mount point."
453 msgstr "Значение I<new_root> не является точкой монтирования."
454
455 #. type: Plain text
456 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
457 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
458 #, fuzzy
459 #| msgid "I<put_old> is not underneath I<new_root>."
460 msgid "I<put_old> is not at or underneath I<new_root>."
461 msgstr "Аргумент I<put_old> не находится в дереве каталогов I<new_root>."
462
463 #. type: Plain text
464 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
465 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
466 msgid ""
467 "The current root directory is not a mount point (because of an earlier "
468 "B<chroot>(2))."
469 msgstr ""
470 "Текущий корневой каталог не является точкой монтирования (из-за "
471 "предшествующего B<chroot>(2))."
472
473 #. type: Plain text
474 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
475 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
476 #, fuzzy
477 #| msgid ""
478 #| "The current root is on the rootfs (initial ramfs) filesystem; see NOTES."
479 msgid "The current root is on the rootfs (initial ramfs) mount; see NOTES."
480 msgstr ""
481 "Текущий корень расположен на файловой системе rootfs (начальная ramfs); "
482 "смотрите ЗАМЕЧАНИЯ."
483
484 #. type: Plain text
485 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
486 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
487 msgid ""
488 "Either the mount point at I<new_root>, or the parent mount of that mount "
489 "point, has propagation type B<MS_SHARED>."
490 msgstr ""
491 "Точка монтирования I<new_root> и её родительское монтирование имеет тип "
492 "распространения B<MS_SHARED>."
493
494 #. type: Plain text
495 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
496 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
497 msgid "I<put_old> is a mount point and has the propagation type B<MS_SHARED>."
498 msgstr ""
499 "Значение I<put_old> является точкой монтирования и имеет тип распространения "
500 "B<MS_SHARED>."
501
502 #. type: TP
503 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
504 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
505 #, no-wrap
506 msgid "B<ENOTDIR>"
507 msgstr "B<ENOTDIR>"
508
509 #. type: Plain text
510 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
511 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
512 msgid "I<new_root> or I<put_old> is not a directory."
513 msgstr "Аргумент I<new_root> или I<put_old> не является каталогом."
514
515 #. type: TP
516 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
517 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
518 #, no-wrap
519 msgid "B<EPERM>"
520 msgstr "B<EPERM>"
521
522 #. type: Plain text
523 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
524 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
525 msgid "The calling process does not have the B<CAP_SYS_ADMIN> capability."
526 msgstr "Вызывающий процесс не имеет мандата B<CAP_SYS_ADMIN>."
527
528 #. type: SH
529 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
530 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
531 #, no-wrap
532 msgid "STANDARDS"
533 msgstr "СТАНДАРТЫ"
534
535 #. type: Plain text
536 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
537 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
538 msgid "Linux."
539 msgstr "Linux."
540
541 #. type: SH
542 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
543 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
544 #, no-wrap
545 msgid "HISTORY"
546 msgstr "ИСТОРИЯ"
547
548 #. type: Plain text
549 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
550 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
551 #, fuzzy
552 #| msgid "util-linux 2.37.4"
553 msgid "Linux 2.3.41."
554 msgstr "util-linux 2.37.4"
555
556 #. type: SH
557 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
558 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
559 #, no-wrap
560 msgid "NOTES"
561 msgstr "ПРИМЕЧАНИЯ"
562
563 #. type: Plain text
564 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
565 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
566 msgid ""
567 "A command-line interface for this system call is provided by "
568 "B<pivot_root>(8)."
569 msgstr ""
570 "Интерфейсом командной строки для этого системного вызова является программа "
571 "B<pivot_root>(8)."
572
573 #. type: Plain text
574 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
575 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
576 #, fuzzy
577 #| msgid ""
578 #| "B<pivot_root>() allows the caller to switch to a new root filesystem "
579 #| "while at the same time placing the old root mount at a location under "
580 #| "I<new_root> from where it can subsequently be unmounted. (The fact that "
581 #| "it moves all processes that have a root directory or current working "
582 #| "directory on the old root filesystem to the new root filesystem frees the "
583 #| "old root filesystem of users, allowing it to be unmounted more easily.)"
584 msgid ""
585 "B<pivot_root>() allows the caller to switch to a new root filesystem while "
586 "at the same time placing the old root mount at a location under I<new_root> "
587 "from where it can subsequently be unmounted. (The fact that it moves all "
588 "processes that have a root directory or current working directory on the old "
589 "root directory to the new root frees the old root directory of users, "
590 "allowing the old root mount to be unmounted more easily.)"
591 msgstr ""
592 "Программа B<pivot_root>() позволяет вызывающему переключиться в новую "
593 "корневую файловую систему и одновременно помещает монтирование старого корня "
594 "ниже I<new_root>, откуда он может быть в последствии отмонтирован "
595 "(фактически, она перемещает все процессы, у которых корневой каталог или "
596 "текущий рабочий каталог расположен в старой корневой файловой системе, в "
597 "новую корневую файловую систему, и освобождает старую корневую файловую "
598 "систему от пользователей, облегчая её размонтирование)."
599
600 #. type: Plain text
601 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
602 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
603 #, fuzzy
604 #| msgid ""
605 #| "A typical use of B<pivot_root>() is during system startup, when the "
606 #| "system mounts a temporary root filesystem (e.g., an B<initrd>), then "
607 #| "mounts the real root filesystem, and eventually turns the latter into the "
608 #| "current root of all relevant processes or threads. A modern use is to "
609 #| "set up a root filesystem during the creation of a container."
610 msgid ""
611 "One use of B<pivot_root>() is during system startup, when the system mounts "
612 "a temporary root filesystem (e.g., an B<initrd>(4)), then mounts the real "
613 "root filesystem, and eventually turns the latter into the root directory of "
614 "all relevant processes and threads. A modern use is to set up a root "
615 "filesystem during the creation of a container."
616 msgstr ""
617 "Обычно, B<pivot_root>() используется при загрузке, когда система монтирует "
618 "временную корневую файловую систему (например, B<initrd>), а затем монтирует "
619 "настоящую корневую файловую систему, делая, тем самым, её корневой для всех "
620 "последующих процессов или нитей. Теперь она ещё используется для настройки "
621 "корневой файловой системы при создании контейнера."
622
623 #. type: Plain text
624 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
625 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
626 #, fuzzy
627 #| msgid ""
628 #| "The fact that B<pivot_root>() modifies process root and current working "
629 #| "directories in the manner noted in DESCRIPTION is necessary in order to "
630 #| "prevent kernel threads from keeping the old root directory busy with "
631 #| "their root and current working directory, even if they never access the "
632 #| "filesystem in any way."
633 msgid ""
634 "The fact that B<pivot_root>() modifies process root and current working "
635 "directories in the manner noted in DESCRIPTION is necessary in order to "
636 "prevent kernel threads from keeping the old root mount busy with their root "
637 "and current working directories, even if they never access the filesystem in "
638 "any way."
639 msgstr ""
640 "Действие B<pivot_root>() по изменению текущего рабочего каталога и корня "
641 "процесса, раскрытое в ОПИСАНИИ, необходимо для того, чтобы не дать нитям "
642 "ядра оставить занятым старый корневой каталог в качестве своего корня и "
643 "текущего рабочего каталога даже, если они никогда не обращаются к файловой "
644 "системе."
645
646 #. type: Plain text
647 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
648 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
649 msgid ""
650 "The rootfs (initial ramfs) cannot be B<pivot_root>()ed. The recommended "
651 "method of changing the root filesystem in this case is to delete everything "
652 "in rootfs, overmount rootfs with the new root, attach I<stdin>/I<stdout>/"
653 "I<stderr> to the new I</dev/console>, and exec the new B<init>(1). Helper "
654 "programs for this process exist; see B<switch_root>(8)."
655 msgstr ""
656 "Для rootfs (начальная ramfs) нельзя вызвать B<pivot_root>(). Рекомендуемым "
657 "методом изменения корневой файловой системы в этом случае является удаление "
658 "всего в rootfs, перемонтирование в rootfs нового корня, присоединение "
659 "I<stdin>/I<stdout>/I<stderr> к новой I</dev/console> и запуск нового "
660 "B<init>(1). Для этого существуют вспомогательные программы; смотрите "
661 "B<switch_root>(8)."
662
663 #. type: SS
664 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
665 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
666 #, no-wrap
667 msgid "pivot_root(\\[dq].\\[dq], \\[dq].\\[dq])"
668 msgstr ""
669
670 #. type: Plain text
671 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
672 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
673 msgid ""
674 "I<new_root> and I<put_old> may be the same directory. In particular, the "
675 "following sequence allows a pivot-root operation without needing to create "
676 "and remove a temporary directory:"
677 msgstr ""
678 "Значения I<new_root> и I<put_old> могут быть одним каталогом. В частности, "
679 "разрешена следующая последовательность операции pivot-root без необходимости "
680 "создания и удаления временного каталога:"
681
682 #. type: Plain text
683 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
684 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
685 #, no-wrap
686 msgid ""
687 "chdir(new_root);\n"
688 "pivot_root(\".\", \".\");\n"
689 "umount2(\".\", MNT_DETACH);\n"
690 msgstr ""
691 "chdir(new_root);\n"
692 "pivot_root(\".\", \".\");\n"
693 "umount2(\".\", MNT_DETACH);\n"
694
695 #. type: Plain text
696 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
697 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
698 #, fuzzy
699 #| msgid ""
700 #| "This sequence succeeds because the B<pivot_root>() call stacks the old "
701 #| "root mount point (I<old_root>) on top of the new root mount point at I</"
702 #| ">. At that point, the calling process's root directory and current "
703 #| "working directory refer to the new root mount point (I<new_root>). "
704 #| "During the subsequent B<umount>() call, resolution of I<\".\"> starts "
705 #| "with I<new_root> and then moves up the list of mounts stacked at I</>, "
706 #| "with the result that I<old_root> is unmounted."
707 msgid ""
708 "This sequence succeeds because the B<pivot_root>() call stacks the old root "
709 "mount point on top of the new root mount point at I</>. At that point, the "
710 "calling process's root directory and current working directory refer to the "
711 "new root mount point (I<new_root>). During the subsequent B<umount>() "
712 "call, resolution of I<\\[dq].\\[dq]> starts with I<new_root> and then moves "
713 "up the list of mounts stacked at I</>, with the result that old root mount "
714 "point is unmounted."
715 msgstr ""
716 "Эта последовательность выполняется успешно, так как вызов B<pivot_root>() "
717 "укладывает точку монтирования старого корня (I<old_root>) сверху точки "
718 "монтирования нового корня в I</>. В этот момент корневой каталог и текущий "
719 "рабочий каталог вызывающего процесса указывают на точку монтирования нового "
720 "корня (I<new_root>). При последующем вызове B<umount>() определение I<\".\"> "
721 "начинается с I<new_root> и затем перемещается вверх по списку уложенных "
722 "монтирований в I</>, что в конце заканчивается размонтированием I<old_root>."
723
724 #. type: SS
725 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
726 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
727 #, no-wrap
728 msgid "Historical notes"
729 msgstr "Исторические замечания"
730
731 #. type: Plain text
732 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
733 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
734 msgid "For many years, this manual page carried the following text:"
735 msgstr ""
736
737 #. type: Plain text
738 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
739 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
740 #, fuzzy
741 #| msgid ""
742 #| "B<pivot_root>() may or may not change the current root and the current "
743 #| "working directory of any processes or threads that use the old root "
744 #| "directory and which are in the same mount namespace as the caller of "
745 #| "B<pivot_root>(). The caller of B<pivot_root>() should ensure that "
746 #| "processes with root or current working directory at the old root operate "
747 #| "correctly in either case. An easy way to ensure this is to change their "
748 #| "root and current working directory to I<new_root> before invoking "
749 #| "B<pivot_root>(). Note also that B<pivot_root>() may or may not affect "
750 #| "the calling process's current working directory. It is therefore "
751 #| "recommended to call B<chdir(\"/\")> immediately after B<pivot_root>()."
752 msgid ""
753 "B<pivot_root>() may or may not change the current root and the current "
754 "working directory of any processes or threads which use the old root "
755 "directory. The caller of B<pivot_root>() must ensure that processes with "
756 "root or current working directory at the old root operate correctly in "
757 "either case. An easy way to ensure this is to change their root and current "
758 "working directory to I<new_root> before invoking B<pivot_root>()."
759 msgstr ""
760 "Системный вызов B<pivot_root>() может изменить или может не изменить текущий "
761 "корень и текущий рабочий каталог всех процессов или нитей, которые "
762 "используют старый корневой каталог и которые находятся в том же пространстве "
763 "имён монтирования что и вызывающий B<pivot_root>(). В любом случае, "
764 "вызывающий B<pivot_root>() должен проверить, что процессы с корневым или "
765 "текущим рабочим каталогом старого корня работают правильно. Простым способом "
766 "проверки является смена их корня и текущего рабочего каталога на "
767 "I<new_root> до вызова B<pivot_root>(). Заметим, что B<pivot_root>() может "
768 "повлиять или может не повлиять на текущий рабочий каталог вызывающего "
769 "процесса. Поэтому рекомендуется вызвать B<chdir(\"/\")> сразу после "
770 "B<pivot_root>()."
771
772 #. type: Plain text
773 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
774 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
775 msgid ""
776 "This text, written before the system call implementation was even finalized "
777 "in the kernel, was probably intended to warn users at that time that the "
778 "implementation might change before final release. However, the behavior "
779 "stated in DESCRIPTION has remained consistent since this system call was "
780 "first implemented and will not change now."
781 msgstr ""
782
783 #. type: SH
784 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
785 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
786 #, no-wrap
787 msgid "EXAMPLES"
788 msgstr "ПРИМЕРЫ"
789
790 #. FIXME
791 #. Would it be better, because simpler, to use unshare(2)
792 #. rather than clone(2) in the example below?
793 #. type: Plain text
794 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
795 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
796 msgid ""
797 "The program below demonstrates the use of B<pivot_root>() inside a mount "
798 "namespace that is created using B<clone>(2). After pivoting to the root "
799 "directory named in the program's first command-line argument, the child "
800 "created by B<clone>(2) then executes the program named in the remaining "
801 "command-line arguments."
802 msgstr ""
803 "Представленная ниже программа демонстрирует использование B<pivot_root>() "
804 "внутри пространства монтирования, которое создаётся с помощью B<clone>(2). "
805 "После перехода (pivoting) в корневой каталог с именем из первого параметра "
806 "командной строки, потомок, созданный B<clone>(2), выполняет программу с "
807 "именем из оставшихся параметров командной строки."
808
809 #. type: Plain text
810 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
811 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
812 msgid ""
813 "We demonstrate the program by creating a directory that will serve as the "
814 "new root filesystem and placing a copy of the (statically linked) "
815 "B<busybox>(1) executable in that directory."
816 msgstr ""
817 "Для работы программы создадим каталог, который будет служить новой корневой "
818 "файловой системой, и поместим копию исполняемого файла B<busybox>(1) "
819 "(скомпонованного статически) в этот каталог."
820
821 #. type: Plain text
822 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
823 #: opensuse-tumbleweed
824 #, fuzzy, no-wrap
825 #| msgid ""
826 #| "$ B<mkdir /tmp/rootfs>\n"
827 #| "$ B<ls -id /tmp/rootfs> # Show inode number of new root directory\n"
828 #| "319459 /tmp/rootfs\n"
829 #| "$ B<cp $(which busybox) /tmp/rootfs>\n"
830 #| "$ B<PS1=\\(aqbbsh$ \\(aq sudo ./pivot_root_demo /tmp/rootfs /busybox sh>\n"
831 #| "bbsh$ B<PATH=/>\n"
832 #| "bbsh$ B<busybox ln busybox ln>\n"
833 #| "bbsh$ B<ln busybox echo>\n"
834 #| "bbsh$ B<ln busybox ls>\n"
835 #| "bbsh$ B<ls>\n"
836 #| "busybox echo ln ls\n"
837 #| "bbsh$ B<ls -id /> # Compare with inode number above\n"
838 #| "319459 /\n"
839 #| "bbsh$ B<echo \\(aqhello world\\(aq>\n"
840 #| "hello world\n"
841 msgid ""
842 "$B< mkdir /tmp/rootfs>;\n"
843 "$B< ls -id /tmp/rootfs>; # Show inode number of new root directory\n"
844 "319459 /tmp/rootfs\n"
845 "$B< cp $(which busybox) /tmp/rootfs>;\n"
846 "$B< PS1=\\[aq]bbsh$ \\[aq] sudo ./pivot_root_demo /tmp/rootfs /busybox sh>;\n"
847 "bbsh$B< PATH=/>;\n"
848 "bbsh$B< busybox ln busybox ln>;\n"
849 "bbsh$B< ln busybox echo>;\n"
850 "bbsh$B< ln busybox ls>;\n"
851 "bbsh$B< ls>;\n"
852 "busybox echo ln ls\n"
853 "bbsh$B< ls -id />; # Compare with inode number above\n"
854 "319459 /\n"
855 "bbsh$B< echo \\[aq]hello world\\[aq]>;\n"
856 "hello world\n"
857 msgstr ""
858 "$ B<mkdir /tmp/rootfs>\n"
859 "$ B<ls -id /tmp/rootfs> # выведем номер иноды нового корневого каталога\n"
860 "319459 /tmp/rootfs\n"
861 "$ B<cp $(which busybox) /tmp/rootfs>\n"
862 "$ B<PS1=\\(aqbbsh$ \\(aq sudo ./pivot_root_demo /tmp/rootfs /busybox sh>\n"
863 "bbsh$ B<PATH=/>\n"
864 "bbsh$ B<busybox ln busybox ln>\n"
865 "bbsh$ B<ln busybox echo>\n"
866 "bbsh$ B<ln busybox ls>\n"
867 "bbsh$ B<ls>\n"
868 "busybox echo ln ls\n"
869 "bbsh$ B<ls -id /> # сравните с номером иноды выше\n"
870 "319459 /\n"
871 "bbsh$ B<echo \\(aqhello world\\(aq>\n"
872 "hello world\n"
873
874 #. type: SS
875 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
876 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
877 #, no-wrap
878 msgid "Program source"
879 msgstr "Исходный код программы"
880
881 #. type: Plain text
882 #: archlinux debian-unstable mageia-cauldron opensuse-leap-16-1
883 #: opensuse-tumbleweed
884 #, no-wrap
885 msgid ""
886 "/* pivot_root_demo.c */\n"
887 "\\&\n"
888 "#define _GNU_SOURCE\n"
889 "#include E<lt>err.hE<gt>\n"
890 "#include E<lt>limits.hE<gt>\n"
891 "#include E<lt>sched.hE<gt>\n"
892 "#include E<lt>signal.hE<gt>\n"
893 "#include E<lt>stdio.hE<gt>\n"
894 "#include E<lt>stdlib.hE<gt>\n"
895 "#include E<lt>sys/mman.hE<gt>\n"
896 "#include E<lt>sys/mount.hE<gt>\n"
897 "#include E<lt>sys/stat.hE<gt>\n"
898 "#include E<lt>sys/syscall.hE<gt>\n"
899 "#include E<lt>sys/wait.hE<gt>\n"
900 "#include E<lt>unistd.hE<gt>\n"
901 "\\&\n"
902 "static int\n"
903 "pivot_root(const char *new_root, const char *put_old)\n"
904 "{\n"
905 " return syscall(SYS_pivot_root, new_root, put_old);\n"
906 "}\n"
907 "\\&\n"
908 "#define STACK_SIZE (1024 * 1024)\n"
909 "\\&\n"
910 "static int /* Startup function for cloned child */\n"
911 "child(void *arg)\n"
912 "{\n"
913 " char path[PATH_MAX];\n"
914 " char **args = arg;\n"
915 " char *new_root = args[0];\n"
916 " const char *put_old = \"/oldrootfs\";\n"
917 "\\&\n"
918 " /* Ensure that \\[aq]new_root\\[aq] and its parent mount don\\[aq]t have\n"
919 " shared propagation (which would cause pivot_root() to\n"
920 " return an error), and prevent propagation of mount\n"
921 " events to the initial mount namespace. */\n"
922 "\\&\n"
923 " if (mount(NULL, \"/\", NULL, MS_REC | MS_PRIVATE, NULL) == -1)\n"
924 " err(EXIT_FAILURE, \"mount-MS_PRIVATE\");\n"
925 "\\&\n"
926 " /* Ensure that \\[aq]new_root\\[aq] is a mount point. */\n"
927 "\\&\n"
928 " if (mount(new_root, new_root, NULL, MS_BIND, NULL) == -1)\n"
929 " err(EXIT_FAILURE, \"mount-MS_BIND\");\n"
930 "\\&\n"
931 " /* Create directory to which old root will be pivoted. */\n"
932 "\\&\n"
933 " snprintf(path, sizeof(path), \"%s/%s\", new_root, put_old);\n"
934 " if (mkdir(path, 0777) == -1)\n"
935 " err(EXIT_FAILURE, \"mkdir\");\n"
936 "\\&\n"
937 " /* And pivot the root filesystem. */\n"
938 "\\&\n"
939 " if (pivot_root(new_root, path) == -1)\n"
940 " err(EXIT_FAILURE, \"pivot_root\");\n"
941 "\\&\n"
942 " /* Switch the current working directory to \"/\". */\n"
943 "\\&\n"
944 " if (chdir(\"/\") == -1)\n"
945 " err(EXIT_FAILURE, \"chdir\");\n"
946 "\\&\n"
947 " /* Unmount old root and remove mount point. */\n"
948 "\\&\n"
949 " if (umount2(put_old, MNT_DETACH) == -1)\n"
950 " perror(\"umount2\");\n"
951 " if (rmdir(put_old) == -1)\n"
952 " perror(\"rmdir\");\n"
953 "\\&\n"
954 " /* Execute the command specified in argv[1]... */\n"
955 "\\&\n"
956 " execv(args[1], &args[1]);\n"
957 " err(EXIT_FAILURE, \"execv\");\n"
958 "}\n"
959 "\\&\n"
960 "int\n"
961 "main(int argc, char *argv[])\n"
962 "{\n"
963 " char *stack;\n"
964 "\\&\n"
965 " /* Create a child process in a new mount namespace. */\n"
966 "\\&\n"
967 " stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE,\n"
968 " MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);\n"
969 " if (stack == MAP_FAILED)\n"
970 " err(EXIT_FAILURE, \"mmap\");\n"
971 "\\&\n"
972 " if (clone(child, stack + STACK_SIZE,\n"
973 " CLONE_NEWNS | SIGCHLD, &argv[1]) == -1)\n"
974 " err(EXIT_FAILURE, \"clone\");\n"
975 "\\&\n"
976 " /* Parent falls through to here; wait for child. */\n"
977 "\\&\n"
978 " if (wait(NULL) == -1)\n"
979 " err(EXIT_FAILURE, \"wait\");\n"
980 "\\&\n"
981 " exit(EXIT_SUCCESS);\n"
982 "}\n"
983 msgstr ""
984
985 #. SRC END
986 #. type: SH
987 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
988 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
989 #, no-wrap
990 msgid "SEE ALSO"
991 msgstr "СМОТРИТЕ ТАКЖЕ"
992
993 #. type: Plain text
994 #: archlinux debian-trixie debian-unstable fedora-44 fedora-rawhide
995 #: mageia-cauldron opensuse-leap-16-1 opensuse-tumbleweed
996 msgid ""
997 "B<chdir>(2), B<chroot>(2), B<mount>(2), B<stat>(2), B<initrd>(4), "
998 "B<mount_namespaces>(7), B<pivot_root>(8), B<switch_root>(8)"
999 msgstr ""
1000 "B<chdir>(2), B<chroot>(2), B<mount>(2), B<stat>(2), B<initrd>(4), "
1001 "B<mount_namespaces>(7), B<pivot_root>(8), B<switch_root>(8)"
1002
1003 #. type: TH
1004 #: debian-trixie
1005 #, no-wrap
1006 msgid "2024-05-02"
1007 msgstr "2 мая 2024 г."
1008
1009 #. type: TH
1010 #: debian-trixie
1011 #, no-wrap
1012 msgid "Linux man-pages 6.9.1"
1013 msgstr "Страницы руководства Linux 6.9.1"
1014
1015 #. type: Plain text
1016 #: debian-trixie
1017 msgid "Standard C library (I<libc>, I<-lc>)"
1018 msgstr "Стандартная библиотека языка C (I<libc>, I<-lc>)"
1019
1020 #. type: Plain text
1021 #: debian-trixie fedora-44 fedora-rawhide
1022 #, fuzzy
1023 #| msgid ""
1024 #| "The paragraph above is intentionally vague because at the time when "
1025 #| "B<pivot_root>() was first implemented, it was unclear whether its affect "
1026 #| "on other process's root and current working directories\\(emand the "
1027 #| "caller's current working directory\\(emmight change in the future. "
1028 #| "However, the behavior has remained consistent since this system call was "
1029 #| "first implemented: B<pivot_root>() changes the root directory and the "
1030 #| "current working directory of each process or thread in the same mount "
1031 #| "namespace to I<new_root> if they point to the old root directory. (See "
1032 #| "also NOTES.) On the other hand, B<pivot_root>() does not change the "
1033 #| "caller's current working directory (unless it is on the old root "
1034 #| "directory), and thus it should be followed by a B<chdir(\"/\")> call."
1035 msgid ""
1036 "B<pivot_root>() changes the root directory and the current working "
1037 "directory of each process or thread in the same mount namespace to "
1038 "I<new_root> if they point to the old root directory. (See also NOTES.) On "
1039 "the other hand, B<pivot_root>() does not change the caller's current "
1040 "working directory (unless it is on the old root directory), and thus it "
1041 "should be followed by a B<chdir(\"/\")> call."
1042 msgstr ""
1043 "Параграф выше намеренно написан абстрактно, так как на момент первой "
1044 "реализации B<pivot_root>() было неясно, изменится ли его влияние на другие "
1045 "процессы корня и текущие рабочие каталоги — как и на текущий рабочий каталог "
1046 "вызывающего — в будущем. Однако поведение не изменилось с момента первой "
1047 "реализации системного вызова: B<pivot_root>() изменяет корневой каталог и "
1048 "текущий рабочий каталог каждого процесс или нити в одном пространстве имён "
1049 "монтирования на I<new_root>, если они указывают на старый корневой каталог "
1050 "(смотрите ЗАМЕЧАНИЯ). С другой стороны, B<pivot_root>() не изменяет текущий "
1051 "рабочий каталог вызывающего (если это старый корневой каталог), и поэтому он "
1052 "должен запускаться после вызова B<chdir(\"/\")>."
1053
1054 #. type: Plain text
1055 #: debian-trixie fedora-44 fedora-rawhide
1056 #, fuzzy
1057 #| msgid ""
1058 #| "I<put_old> must be at or underneath I<new_root>; that is, adding a "
1059 #| "nonnegative number of I</..> to the string pointed to by I<put_old> must "
1060 #| "yield the same directory as I<new_root>."
1061 msgid ""
1062 "I<put_old> must be at or underneath I<new_root>; that is, adding some "
1063 "nonnegative number of \"I</..>\" suffixes to the pathname pointed to by "
1064 "I<put_old> must yield the same directory as I<new_root>."
1065 msgstr ""
1066 "Аргумент I<put_old> должен быть равен или ниже I<new_root>, т. е., при "
1067 "добавлении неотрицательного количества I</..> в строку, на которую указывает "
1068 "I<put_old>, должен получаться каталог, равный I<new_root>."
1069
1070 #. type: Plain text
1071 #: debian-trixie fedora-44 fedora-rawhide
1072 #, fuzzy, no-wrap
1073 #| msgid ""
1074 #| "$ B<mkdir /tmp/rootfs>\n"
1075 #| "$ B<ls -id /tmp/rootfs> # Show inode number of new root directory\n"
1076 #| "319459 /tmp/rootfs\n"
1077 #| "$ B<cp $(which busybox) /tmp/rootfs>\n"
1078 #| "$ B<PS1=\\(aqbbsh$ \\(aq sudo ./pivot_root_demo /tmp/rootfs /busybox sh>\n"
1079 #| "bbsh$ B<PATH=/>\n"
1080 #| "bbsh$ B<busybox ln busybox ln>\n"
1081 #| "bbsh$ B<ln busybox echo>\n"
1082 #| "bbsh$ B<ln busybox ls>\n"
1083 #| "bbsh$ B<ls>\n"
1084 #| "busybox echo ln ls\n"
1085 #| "bbsh$ B<ls -id /> # Compare with inode number above\n"
1086 #| "319459 /\n"
1087 #| "bbsh$ B<echo \\(aqhello world\\(aq>\n"
1088 #| "hello world\n"
1089 msgid ""
1090 "$ B<mkdir /tmp/rootfs>\n"
1091 "$ B<ls -id /tmp/rootfs> # Show inode number of new root directory\n"
1092 "319459 /tmp/rootfs\n"
1093 "$ B<cp $(which busybox) /tmp/rootfs>\n"
1094 "$ B<PS1=\\[aq]bbsh$ \\[aq] sudo ./pivot_root_demo /tmp/rootfs /busybox sh>\n"
1095 "bbsh$ B<PATH=/>\n"
1096 "bbsh$ B<busybox ln busybox ln>\n"
1097 "bbsh$ B<ln busybox echo>\n"
1098 "bbsh$ B<ln busybox ls>\n"
1099 "bbsh$ B<ls>\n"
1100 "busybox echo ln ls\n"
1101 "bbsh$ B<ls -id /> # Compare with inode number above\n"
1102 "319459 /\n"
1103 "bbsh$ B<echo \\[aq]hello world\\[aq]>\n"
1104 "hello world\n"
1105 msgstr ""
1106 "$ B<mkdir /tmp/rootfs>\n"
1107 "$ B<ls -id /tmp/rootfs> # выведем номер иноды нового корневого каталога\n"
1108 "319459 /tmp/rootfs\n"
1109 "$ B<cp $(which busybox) /tmp/rootfs>\n"
1110 "$ B<PS1=\\(aqbbsh$ \\(aq sudo ./pivot_root_demo /tmp/rootfs /busybox sh>\n"
1111 "bbsh$ B<PATH=/>\n"
1112 "bbsh$ B<busybox ln busybox ln>\n"
1113 "bbsh$ B<ln busybox echo>\n"
1114 "bbsh$ B<ln busybox ls>\n"
1115 "bbsh$ B<ls>\n"
1116 "busybox echo ln ls\n"
1117 "bbsh$ B<ls -id /> # сравните с номером иноды выше\n"
1118 "319459 /\n"
1119 "bbsh$ B<echo \\(aqhello world\\(aq>\n"
1120 "hello world\n"
1121
1122 #. type: Plain text
1123 #: debian-trixie fedora-44 fedora-rawhide
1124 #, no-wrap
1125 msgid ""
1126 "/* pivot_root_demo.c */\n"
1127 "\\&\n"
1128 "#define _GNU_SOURCE\n"
1129 "#include E<lt>err.hE<gt>\n"
1130 "#include E<lt>limits.hE<gt>\n"
1131 "#include E<lt>sched.hE<gt>\n"
1132 "#include E<lt>signal.hE<gt>\n"
1133 "#include E<lt>stdio.hE<gt>\n"
1134 "#include E<lt>stdlib.hE<gt>\n"
1135 "#include E<lt>sys/mman.hE<gt>\n"
1136 "#include E<lt>sys/mount.hE<gt>\n"
1137 "#include E<lt>sys/stat.hE<gt>\n"
1138 "#include E<lt>sys/syscall.hE<gt>\n"
1139 "#include E<lt>sys/wait.hE<gt>\n"
1140 "#include E<lt>unistd.hE<gt>\n"
1141 "\\&\n"
1142 "static int\n"
1143 "pivot_root(const char *new_root, const char *put_old)\n"
1144 "{\n"
1145 " return syscall(SYS_pivot_root, new_root, put_old);\n"
1146 "}\n"
1147 "\\&\n"
1148 "#define STACK_SIZE (1024 * 1024)\n"
1149 "\\&\n"
1150 "static int /* Startup function for cloned child */\n"
1151 "child(void *arg)\n"
1152 "{\n"
1153 " char path[PATH_MAX];\n"
1154 " char **args = arg;\n"
1155 " char *new_root = args[0];\n"
1156 " const char *put_old = \"/oldrootfs\";\n"
1157 "\\&\n"
1158 " /* Ensure that \\[aq]new_root\\[aq] and its parent mount don\\[aq]t have\n"
1159 " shared propagation (which would cause pivot_root() to\n"
1160 " return an error), and prevent propagation of mount\n"
1161 " events to the initial mount namespace. */\n"
1162 "\\&\n"
1163 " if (mount(NULL, \"/\", NULL, MS_REC | MS_PRIVATE, NULL) == -1)\n"
1164 " err(EXIT_FAILURE, \"mount-MS_PRIVATE\");\n"
1165 "\\&\n"
1166 " /* Ensure that \\[aq]new_root\\[aq] is a mount point. */\n"
1167 "\\&\n"
1168 " if (mount(new_root, new_root, NULL, MS_BIND, NULL) == -1)\n"
1169 " err(EXIT_FAILURE, \"mount-MS_BIND\");\n"
1170 "\\&\n"
1171 " /* Create directory to which old root will be pivoted. */\n"
1172 "\\&\n"
1173 " snprintf(path, sizeof(path), \"%s/%s\", new_root, put_old);\n"
1174 " if (mkdir(path, 0777) == -1)\n"
1175 " err(EXIT_FAILURE, \"mkdir\");\n"
1176 "\\&\n"
1177 " /* And pivot the root filesystem. */\n"
1178 "\\&\n"
1179 " if (pivot_root(new_root, path) == -1)\n"
1180 " err(EXIT_FAILURE, \"pivot_root\");\n"
1181 "\\&\n"
1182 " /* Switch the current working directory to \"/\". */\n"
1183 "\\&\n"
1184 " if (chdir(\"/\") == -1)\n"
1185 " err(EXIT_FAILURE, \"chdir\");\n"
1186 "\\&\n"
1187 " /* Unmount old root and remove mount point. */\n"
1188 "\\&\n"
1189 " if (umount2(put_old, MNT_DETACH) == -1)\n"
1190 " perror(\"umount2\");\n"
1191 " if (rmdir(put_old) == -1)\n"
1192 " perror(\"rmdir\");\n"
1193 "\\&\n"
1194 " /* Execute the command specified in argv[1]... */\n"
1195 "\\&\n"
1196 " execv(args[1], &args[1]);\n"
1197 " err(EXIT_FAILURE, \"execv\");\n"
1198 "}\n"
1199 "\\&\n"
1200 "int\n"
1201 "main(int argc, char *argv[])\n"
1202 "{\n"
1203 " char *stack;\n"
1204 "\\&\n"
1205 " /* Create a child process in a new mount namespace. */\n"
1206 "\\&\n"
1207 " stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE,\n"
1208 " MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK, -1, 0);\n"
1209 " if (stack == MAP_FAILED)\n"
1210 " err(EXIT_FAILURE, \"mmap\");\n"
1211 "\\&\n"
1212 " if (clone(child, stack + STACK_SIZE,\n"
1213 " CLONE_NEWNS | SIGCHLD, &argv[1]) == -1)\n"
1214 " err(EXIT_FAILURE, \"clone\");\n"
1215 "\\&\n"
1216 " /* Parent falls through to here; wait for child. */\n"
1217 "\\&\n"
1218 " if (wait(NULL) == -1)\n"
1219 " err(EXIT_FAILURE, \"wait\");\n"
1220 "\\&\n"
1221 " exit(EXIT_SUCCESS);\n"
1222 "}\n"
1223 msgstr ""
1224
1225 #. type: TH
1226 #: fedora-44 fedora-rawhide
1227 #, no-wrap
1228 msgid "2024-07-23"
1229 msgstr "23 июля 2024 г."
1230
1231 #. type: TH
1232 #: fedora-44 fedora-rawhide
1233 #, no-wrap
1234 msgid "Linux man-pages 6.13"
1235 msgstr "Страницы руководства Linux 6.13"
1236
1237 #. type: TH
1238 #: mageia-cauldron
1239 #, no-wrap
1240 msgid "Linux man-pages 6.17"
1241 msgstr "Страницы руководства Linux 6.17"
1242
1243 #. type: TH
1244 #: opensuse-leap-16-1 opensuse-tumbleweed
1245 #, no-wrap
1246 msgid "Linux man-pages (unreleased)"
1247 msgstr "Страницы руководства Linux (не выпущены)"