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