# SOME DESCRIPTIVE TITLE # Copyright (C) YEAR The FreeBSD Project # This file is distributed under the same license as the FreeBSD Documentation package. # Vladlen Popolitov , 2025, 2026. msgid "" msgstr "" "Project-Id-Version: FreeBSD Documentation VERSION\n" "POT-Creation-Date: 2026-08-09 22:52+0300\n" "PO-Revision-Date: 2026-08-09 04:45+0000\n" "Last-Translator: Vladlen Popolitov \n" "Language-Team: Russian \n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" "X-Generator: Weblate 4.17\n" #. type: Yaml Front Matter Hash Value: description #: documentation/content/en/books/handbook/jails/_index.adoc:1 #, no-wrap msgid "Jails improve on the concept of the traditional chroot environment in several ways" msgstr "Клетки (jails) улучшают концепцию традиционного окружения chroot несколькими способами" #. type: Yaml Front Matter Hash Value: part #: documentation/content/en/books/handbook/jails/_index.adoc:1 #, no-wrap msgid "Part III. System Administration" msgstr "Часть III. Администрирование системы" #. type: Yaml Front Matter Hash Value: title #: documentation/content/en/books/handbook/jails/_index.adoc:1 #, no-wrap msgid "Chapter 17. Jails and Containers" msgstr "Глава 17. Клетки и контейнеры" #. type: Title = #: documentation/content/en/books/handbook/jails/_index.adoc:15 #, no-wrap msgid "Jails and Containers" msgstr "Клетки и контейнеры" #. type: Title == #: documentation/content/en/books/handbook/jails/_index.adoc:52 #, no-wrap msgid "Synopsis" msgstr "Обзор" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:58 msgid "" "Since system administration is a difficult task, many tools have been " "developed to make life easier for the administrator. These tools often " "enhance the way systems are installed, configured, and maintained. One of " "the tools which can be used to enhance the security of a FreeBSD system is " "_jails_. Jails have been available since FreeBSD 4.X and continue to be " "enhanced in their usefulness, performance, reliability, and security." msgstr "" "Поскольку администрирование системы — сложная задача, было разработано " "множество инструментов, чтобы облегчить жизнь администратору. Эти " "инструменты часто улучшают способы установки, настройки и обслуживания " "систем. Один из инструментов, который можно использовать для повышения " "безопасности системы FreeBSD, — это _клетки (jails)_. Клетки доступны " "начиная с FreeBSD 4.X и продолжают совершенствоваться в плане полезности, " "производительности, надёжности и безопасности." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:63 msgid "" "Jails build upon the man:chroot[2] concept, which is used to change the root " "directory of a set of processes. This creates a safe environment, separate " "from the rest of the system. Processes created in the chrooted environment " "can not access files or resources outside of it. For that reason, " "compromising a service running in a chrooted environment should not allow " "the attacker to compromise the entire system." msgstr "" "Клетки расширяют концепцию man:chroot[2], которая используется для изменения " "корневого каталога для набора процессов. Это создаёт безопасное окружение, " "изолированное от остальной системы. Процессы, созданные в окружении chroot, " "не могут обращаться к файлам или ресурсам за его пределами. По этой причине " "компрометация службы, работающей в окружении chroot, не должна позволить " "злоумышленнику скомпрометировать всю систему." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:67 msgid "" "However, a chroot has several limitations. It is suited to easy tasks which " "do not require much flexibility or complex, advanced features. Over time, " "many ways have been found to escape from a chrooted environment, making it a " "less than ideal solution for securing services." msgstr "" "Однако `chroot` имеет несколько ограничений. Он подходит для простых задач, " "не требующих большой гибкости или сложных, продвинутых функций. Со временем " "было найдено множество способов выйти из окружения `chroot`, что делает его " "не самым идеальным решением для защиты сервисов." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:69 msgid "" "Jails improve on the concept of the traditional chroot environment in " "several ways." msgstr "" "Клетки улучшают концепцию традиционной изолированной среды chroot " "несколькими способами." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:75 msgid "" "In a traditional chroot environment, processes are only limited in the part " "of the file system they can access. The rest of the system resources, " "system users, running processes, and the networking subsystem are shared by " "the chrooted processes and the processes of the host system. Jails expand " "this model by virtualizing access to the file system, the set of users, and " "the networking subsystem. More fine-grained controls are available for " "tuning the access of a jailed environment. Jails can be considered as a " "type of operating system-level virtualization." msgstr "" "В традиционной среде chroot процессы ограничены только в части файловой " "системы, к которой они могут получить доступ. Остальные системные ресурсы, " "пользователи системы, запущенные процессы и подсистема сети разделяются " "между процессами в chroot и процессами основной системы. Клетки расширяют " "эту модель, виртуализируя доступ к файловой системе, набору пользователей и " "подсистеме сети. Доступны более детальные настройки для регулирования " "доступа в изолированной среде. Клетки можно рассматривать как один из видов " "виртуализации на уровне операционной системы." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:77 msgid "This chapter covers:" msgstr "Эта глава охватывает:" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:79 msgid "What a jail is and what purpose it may serve in FreeBSD installations." msgstr "Что такое клетка и для каких целей он может использоваться в FreeBSD." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:80 msgid "The different types of jail." msgstr "Типы клеток." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:81 msgid "The different ways to configure the network for a jail." msgstr "Различные способы настройки сети для клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:82 msgid "The jail configuration file." msgstr "Файл конфигурации клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:83 msgid "How to create the different types of jail." msgstr "Как создать различные типы клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:84 msgid "How to configure network address translation for jails." msgstr "Как настроить трансляцию сетевых адресов для клеток." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:85 msgid "How to start, stop, and restart a jail." msgstr "Как запустить, остановить и перезапустить клетку." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:86 msgid "" "The basics of jail administration, both from inside and outside the jail." msgstr "Основы администрирования клеток, как изнутри, так и снаружи клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:87 msgid "How to upgrade the different types of jail." msgstr "Как обновить различные типы клеток." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:88 msgid "How to limit the resources a jail can use." msgstr "Как ограничить ресурсы, которые может использовать клетка." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:89 msgid "The additional per-jail security and feature options." msgstr "Дополнительные параметры безопасности и функций на уровне клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:90 msgid "How to delegate ZFS datasets to a jail." msgstr "Как делегировать клетке наборы данных ZFS." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:91 msgid "An incomplete list of the different FreeBSD jail managers." msgstr "Неполный список различных менеджеров клеток FreeBSD." #. type: Title == #: documentation/content/en/books/handbook/jails/_index.adoc:93 #, no-wrap msgid "Jail Types" msgstr "Типы клеток" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:97 msgid "" "Some administrators divide jails into different types, although the " "underlying technology is the same. Each administrator will have to assess " "what type of jail to create in each case depending on the problem they have " "to solve." msgstr "" "Некоторые администраторы разделяют клетки на различные типы, хотя базовые " "технологии остаются одинаковыми. Каждому администратору необходимо " "определить, какой тип клетки создавать в каждом конкретном случае, в " "зависимости от решаемой задачи." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:99 msgid "" "Below can be found a list of the different types, their characteristics, and " "considerations for use." msgstr "" "Ниже приведён список различных типов, их характеристики и рекомендации по " "использованию." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:101 #, no-wrap msgid "Thick Jails" msgstr "Толстые клетки (Thick Jails)" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:108 msgid "" "A thick jail is a traditional form of FreeBSD Jail. In a thick jail, a " "complete copy of the base system is replicated within the jail's " "environment. This means that the jail has its own separate instance of the " "FreeBSD base system, including libraries, executables, and configuration " "files. The jail can be thought of as an almost complete standalone FreeBSD " "installation, but running within the confines of the host system. This " "isolation ensures that the processes within the jail are kept separate from " "those on the host and other jails." msgstr "" "Толстая клетка (thick jail) — это традиционная форма клетки FreeBSD. В " "толстой клетке полная копия базовой системы реплицируется внутри окружения " "клетки. Это означает, что клетка имеет свою собственную отдельную копию " "базовой системы FreeBSD, включая библиотеки, исполняемые файлы и " "конфигурационные файлы. Клетку можно рассматривать как почти полноценную " "автономную установку FreeBSD, но работающую в рамках хост-системы. Такая " "изоляция гарантирует, что процессы внутри клетки остаются отделёнными от " "процессов на хосте и в других клетках." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:110 msgid "Advantages of Thick Jails:" msgstr "Преимущества толстых клеток:" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:112 msgid "" "High degree of isolation: Processes within the jail are isolated from the " "host system and other jails." msgstr "" "Высокая степень изоляции: процессы внутри клеток изолированы от хост-системы " "и других клеток." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:113 msgid "" "Independence: Thick jails can have different versions of libraries, " "configurations, and software than the host system or other jails." msgstr "" "Независимость: толстые клетки могут иметь версии библиотек, настройки и " "программное обеспечение, отличные от хост-системы или других клеток." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:114 msgid "" "Security: Since the jail contains its own base system, vulnerabilities or " "issues affecting the jail environment will not directly impact the host or " "other jails." msgstr "" "Безопасность: поскольку клетка содержит собственную базовую систему, " "уязвимости или проблемы, затрагивающие среду клетки, не оказывают прямого " "влияния на хост-систему или другие клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:116 msgid "Disadvantages of Thick Jails:" msgstr "Недостатки толстых клеток:" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:118 msgid "" "Resource overhead: Because each jail maintains its own separate base system, " "thick jails consume more resources compared to thin jails." msgstr "" "Ресурсные затраты: поскольку каждая клетка поддерживает свою собственную " "отдельную базовую систему, толстые клетки потребляют больше ресурсов по " "сравнению с тонкими клетками." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:119 msgid "" "Maintenance: Each jail requires its own maintenance and updates for its base " "system components." msgstr "" "Обслуживание: каждая клетка требует собственного обслуживания и обновлений " "для своих базовых системных компонентов." #. type: Title == #: documentation/content/en/books/handbook/jails/_index.adoc:121 #: documentation/content/en/books/handbook/jails/_index.adoc:765 #, no-wrap msgid "Thin Jails" msgstr "Тонкие клетки (Thin Jails)" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:130 msgid "" "A thin jail shares the base system from a template, using either OpenZFS " "snapshots or NullFS mounts. Only a minimal subset of the base system is " "duplicated for each thin jail, resulting in less resource consumption " "compared to a thick jail. The two mechanisms behave differently once the " "jails exist. With the OpenZFS method, each thin jail is created as a clone " "of a template snapshot: an independent copy-on-write copy that shares " "unchanged blocks with the template but diverges as it is modified. Later " "changes to the template do not propagate to existing clones, and each clone " "is maintained and updated individually, much like a thick jail. With the " "NullFS method, each thin jail mounts the template read-only at runtime, so " "the base system is shared live and updating the template updates every jail " "that mounts it. This shared, read-only base is also what gives NullFS thin " "jails less isolation and independence than thick jails, since changes in the " "shared components affect every jail using them simultaneously." msgstr "" "Тонкая клетка использует базовую систему из шаблона, используя либо снимки " "OpenZFS, либо монтирования NullFS. Для каждой тонкой клетки дублируется лишь " "минимальный поднабор базовой системы, что приводит к меньшему потреблению " "ресурсов по сравнению с толстой клеткой. Два механизма ведут себя по-разному " "после создания клеток. При методе OpenZFS каждая тонкая клетка создается как " "клон снимка шаблона: независимая копия с записью при копировании, которая " "разделяет неизмененные блоки с шаблоном, но расходится при изменении. Более " "поздние изменения шаблона не распространяются на существующие клоны, и " "каждый клон обслуживается и обновляется индивидуально, во многом как толстая " "клетка. При методе NullFS каждая тонкая клетка монтирует шаблон только для " "чтения во время выполнения, поэтому базовая система используется совместно в " "реальном времени, и обновление шаблона обновляет каждую клетку, которая его " "монтирует. Эта общая база, доступная только для чтения, также обеспечивает " "тонким клеткам NullFS меньшую изоляцию и независимость, чем толстым клеткам, " "поскольку изменения в общих компонентах одновременно затрагивают каждую " "клетку, использующую их." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:132 msgid "" "In summary, a FreeBSD Thin Jail is a type of FreeBSD Jail that replicates a " "substantial portion, but not all, of the base system within the isolated " "environment." msgstr "" "Вкратце, тонкая клетка в FreeBSD — это тип клетки FreeBSD, который " "воспроизводит значительную часть, но не всю базовую систему, в изолированной " "среде." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:134 msgid "Advantages of Thin Jails:" msgstr "Преимущества тонких клеток:" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:138 msgid "" "Resource Efficiency: Thin jails are more resource-efficient compared to " "thick jails. Since they share most of the base system, they consume less " "disk space and memory. This makes it possible to run more jails on the same " "hardware without consuming excessive resources." msgstr "" "Эффективность использования ресурсов: тонкие клетки более эффективны в " "использовании ресурсов по сравнению с толстыми клетками. Поскольку они " "используют общую базовую систему, они занимают меньше места на диске и " "оперативной памяти. Это позволяет запускать больше клеток на том же " "оборудовании без чрезмерного потребления ресурсов." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:140 msgid "" "Faster Deployment: Creating and launching thin jails is generally faster " "compared to thick jails. This can be particularly advantageous when rapidly " "deploying multiple instances." msgstr "" "Быстрое развёртывание: создание и запуск тонких клеток обычно происходит " "быстрее по сравнению с толстыми клетками. Это может быть особенно полезно " "при быстром развертывании множества экземпляров." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:143 msgid "" "Unified Maintenance: With the NullFS method, where the thin jails share a " "single read-only copy of the base system, updates and maintenance of common " "base system components (such as libraries and binaries) only need to be done " "once on the template. This simplifies the maintenance process compared to " "maintaining an individual base system for each thick jail. OpenZFS-clone " "thin jails do not share this benefit: because each clone is independent, " "updates must be applied to each jail individually, as with a thick jail." msgstr "" "Унифицированное обслуживание: используя метод NullFS, когда тонкие клетки " "используют одну копию базовой системы, доступную для чтения, обновления и " "обслуживание общих компонентов базовой системы (таких как библиотеки и " "исполняемые файлы) необходимо выполнять только один раз на шаблоне. Это " "упрощает процесс обслуживания по сравнению с поддержкой отдельной базовой " "системы для каждой толстой клетки. Тонкие клетки в клоне OpenZFS не обладают " "таким преимуществом: так как каждый клон независим, обновление должно быть " "применено к каждой клетке индивидуально, как и в случае с толстыми клетками." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:145 msgid "" "Shared Resources: Thin jails can more easily share common resources such as " "libraries and binaries with the host system. This can potentially lead to " "more efficient disk caching and improved performance for applications within " "the jail." msgstr "" "Общие ресурсы: тонкие клетки могут проще разделять общие ресурсы, такие как " "библиотеки и исполняемые файлы, с хост-системой. Это может привести к более " "эффективному использованию кэширования диска и повышению производительности " "приложений внутри клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:147 msgid "Disadvantages of Thin Jails:" msgstr "Недостатки тонких клеток:" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:150 msgid "" "Reduced Isolation: The primary disadvantage of thin jails is that they offer " "less isolation compared to thick jails. With the NullFS method in " "particular, jails share a live copy of the template's base system, so " "vulnerabilities or issues affecting those shared components could " "potentially impact multiple jails simultaneously." msgstr "" "Уменьшенная изоляция: основной недостаток тонких клеток заключается в том, " "что они обеспечивают меньшую изоляцию по сравнению с толстыми клетками. В " "частности клетки с методом NullFS пользуются копией базовой системы шаблона " "в реальном времени, поэтому уязвимости или проблемы, затрагивающие эти общие " "компоненты, могут потенциально повлиять на несколько клеток одновременно." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:151 msgid "" "Security Concerns: The reduced isolation in thin jails could pose security " "risks, as a compromise in one jail might have a greater potential to affect " "other jails or the host system." msgstr "" "Проблемы безопасности: уменьшенная изоляция в тонких клетках может " "представлять угрозу безопасности, так как компрометация одной клетки может с " "большей вероятностью повлиять на другие клетки или на хост-систему." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:153 msgid "" "Dependency Conflicts: If multiple thin jails require different versions of " "the same libraries or software, managing dependencies can become complex. " "In some cases, this might require additional effort to ensure compatibility." msgstr "" "Конфликты зависимостей: если нескольким тонким клеткам требуются разные " "версии одних и тех же библиотек или программного обеспечения, управление " "зависимостями может усложниться. В некоторых случаях это может потребовать " "дополнительных усилий для обеспечения совместимости." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:154 msgid "" "Compatibility Challenges: Applications within a thin jail might encounter " "compatibility issues if they assume a certain base system environment that " "differs from the shared components provided by the template." msgstr "" "Проблемы совместимости: приложения в тонкой клетке могут столкнуться с " "проблемами совместимости, если они рассчитаны на определённое окружение " "базовой системы, отличающееся от общих компонентов, предоставляемых шаблоном." #. type: Title == #: documentation/content/en/books/handbook/jails/_index.adoc:156 #: documentation/content/en/books/handbook/jails/_index.adoc:1405 #, no-wrap msgid "Service Jails" msgstr "Сервисные клетки (Service Jails)" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:162 msgid "" "A service jail shares the complete filesystem tree directly with the host " "(the jail root path is [.filename]#/#) and as such can access and modify any " "file on the host, and shares the same user accounts with the host. By " "default it has no access to the network or other resources which are " "restricted in jails, but they can be configured to re-use the network of the " "host and to remove some of the jail-restrictions. The use case for service " "jails is automatic confinement of services/daemons inside a jail with " "minimal configuration, and without any knowledge of the files needed by such " "service/daemon. Service jails are available since FreeBSD 15.0." msgstr "" "Сервисная клетка (service jail) напрямую разделяет всё дерево файловой " "системы с хостом (корневой путь клетки — [.filename]#/#) и, таким образом, " "может получать доступ и изменять любые файлы на хосте, а также использует те " "же учётные записи пользователей, что и хост. По умолчанию у неё нет доступа " "к сети или другим ресурсам, ограниченным в клетках, но её можно настроить " "для повторного использования сети хоста и снятия некоторых ограничений " "клетки. Основное применение сервисных клеток — автоматическое ограничение " "служб/демонов внутри клетки с минимальной настройкой и без необходимости " "знания файлов, требуемых такой службой/демоном. Сервисные клетки доступны с " "версии FreeBSD 15.0." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:164 msgid "Advantages of Service Jails:" msgstr "Преимущества сервисных клеток:" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:166 msgid "" "Zero Administration: A service jail ready service needs only one config line " "in [.filename]#/etc/rc.conf#, a service which is not service jails ready " "needs two config lines." msgstr "" "Нулевое администрирование: для службы, готовой к использованию в клетке, " "достаточно одной строки конфигурации в [.filename]#/etc/rc.conf#, для " "службы, не готовой к использованию в клетке, требуется две строки " "конфигурации." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:167 msgid "" "Resource Efficiency: Service jails are more resource efficient than thin " "jails, as they do not need any additional disk space or network resource." msgstr "" "Ресурсоэффективность: сервисные клетки более эффективны в использовании " "ресурсов, чем тонкие клетки, так как они не требуют дополнительного " "дискового пространства или сетевых ресурсов." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:168 msgid "" "Faster Deployment: Creating and launching service jails is generally faster " "compared to thin jails if only distinct services/daemons shall be jailed and " "no parallel instances of the same service/daemon is needed." msgstr "" "Быстрое развёртывание: создание и запуск сервисных клеток обычно выполняется " "быстрее по сравнению с тонкими клетками, если требуется изолировать только " "отдельные сервисы/демоны и не нужны параллельные экземпляры одного и того же " "сервиса/демона." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:170 msgid "" "Shared Resources: Service jails share all resources such as libraries and " "binaries with the host system. This can potentially lead to more efficient " "disk caching and improved performance for applications within the jail." msgstr "" "Общие ресурсы: сервисные клетки разделяют все ресурсы, такие как библиотеки " "и исполняемые файлы, с хост-системой. Это может привести к более " "эффективному использованию кэширования диска и повышению производительности " "приложений внутри клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:171 msgid "" "Process Isolation: Service jails isolate a particular service, it can not " "see processes which are not a child of the service jail, even if they run " "within the same user account." msgstr "" "Изоляция процессов: сервисные клетки изолируют определённую службу, она не " "может видеть процессы, которые не являются дочерними по отношению к этой " "сервисной клетке, даже если они выполняются в рамках той же учётной записи " "пользователя." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:173 msgid "Disadvantages of Service Jails:" msgstr "Недостатки сервисных клеток:" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:175 msgid "" "Reduced Isolation: The primary disadvantage of service jails is that they " "offer no filesystem isolation compared to thick or thin jails." msgstr "" "Уменьшенная изоляция: основной недостаток сервисных клеток заключается в " "отсутствии изоляции файловой системы по сравнению с толстой или тонкой " "клеткой." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:176 msgid "" "Security Concerns: The reduced isolation in service jails could pose " "security risks, as a compromise in one jail might have a greater potential " "to affect everything on the host system." msgstr "" "Проблемы безопасности: уменьшенная изоляция в сервисных клетках может " "создавать угрозы безопасности, поскольку компрометация одной клетки " "потенциально способна сильнее повлиять на всё в хост-системе." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:180 msgid "" "Most of the configuration of jails which is discussed below is not needed " "for service jails. To understand how jails work, it is recommended to " "understand those configuration possibilities. The details about what is " "needed to configure a service jail are in the crossref:jails[service-jails-" "config, Service Jails] section." msgstr "" "Большая часть настройки клеток, обсуждаемая ниже, не требуется для сервисных " "клеток. Чтобы понять, как работают клетки, рекомендуется разобраться в этих " "возможностях конфигурации. Подробности о том, что необходимо для настройки " "сервисной клетки, приведены в разделе crossref:jails[service-jails-config, " "Настройка сервисных клеток]." #. type: Title == #: documentation/content/en/books/handbook/jails/_index.adoc:182 #: documentation/content/en/books/handbook/jails/_index.adoc:1043 #, no-wrap msgid "VNET Jails" msgstr "Клетки VNET" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:187 msgid "" "A FreeBSD VNET jail is a virtualized environment that allows for the " "isolation and control of network resources for processes running within it. " "It provides a high level of network segmentation and security by creating a " "separate network stack for processes within the jail, ensuring that network " "traffic within the jail is isolated from the host system and other jails." msgstr "" "Клетка FreeBSD VNET — это виртуализированная среда, которая обеспечивает " "изоляцию и контроль сетевых ресурсов для процессов, выполняющихся внутри " "неё. Она предоставляет высокий уровень сетевой сегментации и безопасности, " "создавая отдельный сетевой стек для процессов внутри клетки, что гарантирует " "изоляцию сетевого трафика внутри клетки от хост-системы и других клеток." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:190 msgid "" "In essence, FreeBSD VNET jails add a network configuration mechanism. This " "means a VNET jail can be created as a Thick or Thin Jail." msgstr "" "По сути, механизм VNET в FreeBSD добавляет возможность настройки сети. Это " "означает, что клетку VNET можно создать как толстой, так и тонкой." #. type: Title == #: documentation/content/en/books/handbook/jails/_index.adoc:192 #: documentation/content/en/books/handbook/jails/_index.adoc:1208 #, no-wrap msgid "Linux Jails" msgstr "Клетки Linux" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:197 msgid "" "A FreeBSD Linux Jail is a feature in the FreeBSD operating system that " "enables the use of Linux binaries and applications within a FreeBSD jail. " "This functionality is achieved by incorporating a compatibility layer that " "allows certain Linux system calls and libraries to be translated and " "executed on the FreeBSD kernel. The purpose of a Linux Jail is to " "facilitate the execution of Linux software on a FreeBSD system without " "needing a separate Linux virtual machine or environment." msgstr "" "Клетки Linux в FreeBSD — это функция в операционной системе FreeBSD, которая " "позволяет использовать исполняемые файлы Linux и приложения внутри клетки " "FreeBSD. Эта функциональность достигается за счёт совместимости, которая " "позволяет транслировать и выполнять определённые системные вызовы Linux и " "использовать библиотеки Linux с ядром FreeBSD. Цель клеток Linux — облегчить " "выполнение Linux-программ в системе FreeBSD без необходимости в отдельной " "виртуальной машине или среде Linux." #. type: Title == #: documentation/content/en/books/handbook/jails/_index.adoc:199 #, no-wrap msgid "Host Configuration" msgstr "Конфигурация хоста" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:202 msgid "" "Before creating any jail on the host system it is necessary to perform " "certain configuration and obtain some information from the host system." msgstr "" "Прежде чем создавать клетку на хост-системе, необходимо выполнить " "определённые настройки и получить некоторую информацию от хост-системы." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:204 msgid "" "It will be necessary to configure the man:jail[8] utility, create the " "necessary directories to configure and install jails, obtain information " "from the host's network, and check whether the host uses OpenZFS or UFS as " "its file system." msgstr "" "Потребуется настроить утилиту man:jail[8], создать необходимые каталоги для " "настройки и установки клетки, получить информацию о сети хоста и проверить, " "использует ли хост файловую систему OpenZFS или UFS." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:208 msgid "" "The FreeBSD version running in the jail can not be newer than the version " "running in the host." msgstr "" "Версия FreeBSD, работающая в клетке, не может быть новее версии, работающей " "на хосте." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:211 #, no-wrap msgid "Jail Utility" msgstr "Утилита jail" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:214 msgid "The man:jail[8] utility manages jails." msgstr "Утилита man:jail[8] управляет клетками." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:216 msgid "To start jails when the system boots, run the following commands:" msgstr "" "Чтобы запускать клетки при загрузке системы, выполните следующие команды:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:221 #, no-wrap msgid "" "# sysrc jail_enable=\"YES\"\n" "# sysrc jail_parallel_start=\"YES\"\n" msgstr "" "# sysrc jail_enable=\"YES\"\n" "# sysrc jail_parallel_start=\"YES\"\n" #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:226 msgid "" "With `jail_parallel_start`, all configured jails will be started in the " "background." msgstr "" "С `jail_parallel_start` все настроенные клетки будут запущены в фоновом " "режиме." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:230 msgid "" "By default every jail with an entry in the configuration files is started at " "boot. To start only selected jails, list their names in `jail_list`:" msgstr "" "По умолчанию каждая клетка, которая имеет запись в конфигурационных файлах, " "запускается при загрузке. Чтобы запустить только выбранные клетки, " "перечислите их имена в `jail_list`:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:234 #, no-wrap msgid "# sysrc jail_list=\"www db\"\n" msgstr "# sysrc jail_list=\"www db\"\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:239 msgid "" "The names in `jail_list` are separated by spaces and must match the jail " "names defined in [.filename]#/etc/jail.conf# or [.filename]#/etc/jail.conf.d/" "#. Only the listed jails are started at boot, and they are started in the " "order given, so any jail left out of `jail_list` has to be started by hand. " "When `jail_list` is left empty, all jails defined in the configuration files " "are started." msgstr "" "Имена в `jail_list` разделяются пробелами и должны соответствовать именам " "клеток, определённым в [.filename]#/etc/jail.conf# или [.filename]#/etc/" "jail.conf.d/#. При загрузке запускаются только перечисленные клетки, и они " "запускаются в указанном порядке, поэтому любую клетку, пропущенную в " "`jail_list`, необходимо запускать вручную. Когда `jail_list` остаётся " "пустым, запускаются все клетки, определённые в файлах конфигурации." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:241 msgid "" "To stop the jails in the reverse of their `jail_list` order at shutdown, set " "`jail_reverse_stop`:" msgstr "" "Чтобы остановить клетки в обратном порядке их `jail_list` при завершении " "работы, установите `jail_reverse_stop`:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:245 #, no-wrap msgid "# sysrc jail_reverse_stop=\"YES\"\n" msgstr "# sysrc jail_reverse_stop=\"YES\"\n" #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:253 msgid "" "With `jail_parallel_start` enabled, jails start in the background and the " "`jail_list` order is no longer guaranteed. When one jail must be running " "before another starts, express that relationship with the `depend` parameter " "in [.filename]#/etc/jail.conf# instead of relying on list order. A jail's " "dependencies are created automatically before it starts, and stopped in the " "opposite order, regardless of `jail_list`. The `depend` parameter is " "described in crossref:jails[jail-configuration-files,Jail Configuration " "Files]." msgstr "" "С включённым `jail_parallel_start` клетки запускаются в фоновом режиме, и " "порядок `jail_list` больше не гарантируется. Когда одна клетка должна " "работать до запуска другой, выразите эту зависимость с помощью параметра " "`depend` в [.filename]#/etc/jail.conf# вместо того, чтобы полагаться на " "порядок списка. Зависимости клетки создаются автоматически до её запуска и " "останавливаются в обратном порядке, независимо от `jail_list`. Параметр " "`depend` описан в разделе crossref:jails[jail-configuration-files,Файлы " "конфигурации клеток]." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:256 #, no-wrap msgid "Networking" msgstr "Сетевое взаимодействие" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:259 msgid "Networking for FreeBSD jails can be configured several different ways:" msgstr "" "Сеть для клеток FreeBSD может быть настроена несколькими различными " "способами:" #. type: Labeled list #: documentation/content/en/books/handbook/jails/_index.adoc:260 #, no-wrap msgid "Host Networking Mode (IP Sharing)" msgstr "Режим сетевого взаимодействия хоста (разделение IP)" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:264 msgid "" "In host networking mode a jail shares the host's network stack instead of " "receiving its own. Sharing the stack does not mean sharing the address: the " "common setup gives the jail its own dedicated `ip4.addr` (and `ip6.addr`) " "that man:jail[8] adds as an alias on the host interface, so the jail and the " "host answer on different addresses over the same stack. Only a jail " "configured with `ip4 = inherit` shares the host's addresses wholesale and " "answers on the host's own address, gaining unrestricted access to every " "address the host holds." msgstr "" "В режиме сетевого доступа хоста клетка использует сетевой стек хост-системы, " "а не получает собственный. Совместное использование стека не означает " "совместное использование адреса: распространённая настройка предоставляет " "клетке собственный выделенный `ip4.addr` (и `ip6.addr`), который man:jail[8] " "добавляет как псевдоним на интерфейсе хост-системы, поэтому клетка и хост-" "система отвечают на разных адресах через один и тот же стек. Только клетка, " "настроенная с `ip4 = inherit`, полностью видит и может пользоваться адресами " "хост-системы и отвечает на собственном адресе хост-системы, получая " "неограниченный доступ ко всем адресам, которыми владеет хост-система." #. type: Labeled list #: documentation/content/en/books/handbook/jails/_index.adoc:265 #, no-wrap msgid "Virtual Networks (VNET)" msgstr "Виртуальные сети (VNET)" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:269 msgid "" "Virtual Networks are a feature of FreeBSD jails that offer more advanced and " "flexible networking solutions than a basic networking mode like host " "networking. VNET allows the creation of isolated network stacks for each " "jail, providing them with their own separate IP addresses, routing tables, " "and network interfaces. This offers a higher level of network isolation and " "allows jails to function as if they are running on separate virtual machines." msgstr "" "Виртуальные сети (VNET) — это функция клеток FreeBSD, предоставляющая более " "продвинутые и гибкие сетевые решения по сравнению с базовыми режимами, " "такими как режим сетевого взаимодействия хоста (host networking). VNET " "позволяет создавать изолированные сетевые стеки для каждой клетки, " "предоставляя им отдельные IP-адреса, таблицы маршрутизации и сетевые " "интерфейсы. Это обеспечивает более высокий уровень сетевой изоляции и " "позволяет клеткам функционировать так, как если бы они работали на отдельных " "виртуальных машинах." #. type: Labeled list #: documentation/content/en/books/handbook/jails/_index.adoc:270 #, no-wrap msgid "The netgraph system" msgstr "Система netgraph" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:273 msgid "" "man:netgraph[4] is a versatile kernel framework for creating custom network " "configurations. It can be used to define how network traffic flows between " "jails and the host system and between different jails." msgstr "" "man:netgraph[4] — это универсальная инфраструктура ядра для создания " "пользовательских сетевых конфигураций. Она может использоваться для " "определения того, как сетевой трафик передаётся между клеткой и хост-" "системой, а также между различными клетками." #. type: Title ==== #: documentation/content/en/books/handbook/jails/_index.adoc:275 #, no-wrap msgid "Where a Jail's IP Address Comes From" msgstr "Откуда берется IP-адрес клетки" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:280 msgid "" "A shared-stack jail reaches the network through an address on a host " "interface. The `interface` parameter names that interface, and for every " "address in `ip4.addr` and `ip6.addr` man:jail[8] manages the alias itself: " "as jail(8) puts it, \"an alias for each address will be added to the " "interface before the jail is created, and will be removed from the interface " "after the jail is removed\". Nothing on the host has to pre-configure the " "address." msgstr "" "Клетка с общим стеком получает доступ к сети через адрес на интерфейсе " "хоста. В параметре `interface` указывается имя этого интерфейса, и для " "каждого адреса в `ip4.addr` и `ip6.addr` man:jail[8] сам управляет " "псевдонимом: как выражается jail(8), «псевдоним для каждого адреса будет " "добавлен к интерфейсу до создания клетки и будет удалён из интерфейса после " "удаления клетки». Ничто на хост-системе не обязано предварительно " "настраивать адрес." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:282 msgid "" "The interface can also be given per address, so a single line ties an " "address to the interface that should carry it:" msgstr "" "Интерфейс также может быть указан для каждого адреса, так что одна строка " "связывает адрес с интерфейсом, который должен этот адрес использовать:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:286 #, no-wrap msgid "ip4.addr = \"em0|192.168.1.151/24\";\n" msgstr "ip4.addr = \"em0|192.168.1.151/24\";\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:289 msgid "" "When an address must persist independently of the jail — because another " "service on the host relies on it, or because the `interface` parameter is " "not used — assign it on the host as an rc.conf alias and leave it out of " "jail(8)'s management:" msgstr "" "Когда адрес должен сохраняться независимо от клетки — потому что другая " "служба на хост-системе полагается на него, или потому что параметр " "`interface` не используется — назначьте его на хост-системе как псевдоним " "rc.conf и исключите его из управления jail(8):" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:293 #, no-wrap msgid "# sysrc ifconfig_em0_aliases=\"inet 192.168.1.151/32\"\n" msgstr "# sysrc ifconfig_em0_aliases=\"inet 192.168.1.151/32\"\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:296 msgid "" "The older, numbered form `ifconfig_em0_alias0=\"inet 192.168.1.151/32\"` " "still works, but the `_aliases` form is preferred for new configurations " "because it avoids the fragile requirement that the numbered aliases form an " "unbroken `alias0`, `alias1`, `alias2` sequence." msgstr "" "Более старая, нумерованная форма `ifconfig_em0_alias0=\"inet " "192.168.1.151/32\"` по-прежнему работает, но форма `_aliases` " "предпочтительнее для новых конфигураций, поскольку она позволяет избежать " "хрупкого требования, чтобы нумерованные псевдонимы образовывали непрерывную " "последовательность `alias0`, `alias1`, `alias2`." #. type: Title ==== #: documentation/content/en/books/handbook/jails/_index.adoc:298 #, no-wrap msgid "Loopback Addresses in Shared-IP Jails" msgstr "Адреса loopback в клетках с общей IP-адресацией" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:303 msgid "" "A shared-stack jail has no loopback interface of its own. The FreeBSD " "kernel compensates for this: in a non-VNET jail, whenever `127.0.0.1` or " "`::1` is not itself one of the jail's own addresses, the kernel silently " "rewrites both `bind()` and `connect()` on the loopback address to the jail's " "first `ip4.addr` or `ip6.addr`. This behavior is not documented in " "man:jail[8], but it matters, because it carries a security consequence." msgstr "" "Клетка с общим стеком не имеет собственного интерфейса loopback. Ядро " "FreeBSD компенсирует это: в клетке без VNET, когда `127.0.0.1` или `::1` " "сами по себе не являются адресами клетки, ядро молча переписывает как " "`bind()`, так и `connect()` на адрес loopback на первый `ip4.addr` или " "`ip6.addr` клетки. Это поведение не документировано в man:jail[8], но оно " "важно, поскольку несет последствия для безопасности." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:308 msgid "" "Do not assume that binding a service to `localhost` confines it to the " "jail. In a shared-IP jail a daemon told to listen on `127.0.0.1` actually " "binds the jail's first address, which is frequently a LAN-facing one, and so " "becomes reachable from the network." msgstr "" "Не предполагайте, что привязка службы к `localhost` ограничивает её " "клеткой. В клетке с общим IP-адресом демон, которому указано прослушивать " "`127.0.0.1`, на самом деле привязывается к первому адресу клетки, который " "часто обращён к локальной сети, и поэтому становится доступным из сети." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:312 msgid "" "The standard mitigation is to give the jail a private loopback address and " "list it first. Clone a dedicated loopback interface on the host and assign " "it an address in the `127.0.0.0/8` range (or a private RFC 1918 address):" msgstr "" "Стандартным средством смягчения является предоставление клетке частного " "адреса loopback и указание его первым. Клонируйте выделенный интерфейс " "loopback на хосте и назначьте ему адрес из диапазона `127.0.0.0/8` (или " "частный адрес RFC 1918):" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:317 #, no-wrap msgid "" "# sysrc cloned_interfaces=\"lo1\"\n" "# sysrc ifconfig_lo1=\"inet 127.0.1.1/32\"\n" msgstr "" "# sysrc cloned_interfaces=\"lo1\"\n" "# sysrc ifconfig_lo1=\"inet 127.0.1.1/32\"\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:320 msgid "" "Then list that address first in the jail's `ip4.addr`, ahead of any routable " "address, so the loopback remap lands on the private address instead of a LAN-" "facing one." msgstr "" "Затем укажите этот адрес первым в `ip4.addr` клетки, перед любым " "маршрутизируемым адресом, чтобы переопределение loopback попадало на частный " "адрес, а не на адрес, обращённый к локальной сети." #. type: Title ==== #: documentation/content/en/books/handbook/jails/_index.adoc:322 #, no-wrap msgid "Preparing Host Services" msgstr "Подготовка сервисов хост-системы" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:327 msgid "" "Each jail alias address shares the host's ports. A host daemon bound to the " "wildcard address — shown as `*:port` in listener listings — is therefore " "listening on every jail alias too, and it occupies that port before a jail's " "own service can claim it. Before starting any jails, audit what the host " "already listens on:" msgstr "" "Каждый псевдоним адреса клетки разделяет порты хост-системы. Демон хост-" "системы, привязанный к адресу с подстановочным знаком — показанному как " "`*:port` в списках прослушивателей — поэтому также прослушивает каждый " "псевдоним клетки, и он занимает этот порт прежде, чем собственная служба " "клетки сможет его заявить. Перед запуском любых клеток проверьте, что хост-" "система уже прослушивает:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:331 #, no-wrap msgid "# sockstat -4 -6 -l\n" msgstr "# sockstat -4 -6 -l\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:334 msgid "" "Restrict each daemon that binds a wildcard address so it uses only the " "host's own address and leaves the jail addresses free:" msgstr "" "Ограничьте каждый демон, который привязывается к адресу-шаблону, чтобы он " "использовал только собственный адрес хост-системы и оставлял адреса клеток " "свободными:" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:337 msgid "" "man:syslogd[8]: set `syslogd_flags=\"-ss\"` in [.filename]#/etc/rc.conf#. A " "single `-s` already runs syslogd in secure mode so it does not listen for " "remote log messages; per syslogd(8), if `-s` \"is specified twice, no " "network socket will be opened at all\", which also stops syslogd from " "sending to remote hosts." msgstr "" "man:syslogd[8]: задайте `syslogd_flags=\"-ss\"` в [.filename]#/etc/rc.conf#. " "Одинарный `-s` уже запускает syslogd в безопасном режиме, чтобы он не " "прослушивал соединения с удаленных хостов для отправки сообщений журнала; " "согласно syslogd(8), если `-s` \"указан дважды, сетевой сокет вообще не " "будет открыт\", что также предотвращает отправку syslogd на удаленные хосты." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:338 msgid "" "man:sshd[8]: pin `ListenAddress` to the host's address in [.filename]#/etc/" "ssh/sshd_config# instead of leaving it on the default wildcard." msgstr "" "man:sshd[8]: закрепите `ListenAddress` на адресе хост-системы в файле " "[.filename]#/etc/ssh/sshd_config# вместо того, чтобы оставлять его с " "подстановочным знаком(wildcard) по умолчанию." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:339 msgid "" "man:ntpd[8] and man:sendmail[8]: bind them to the host address as well " "through their own configuration." msgstr "" "man:ntpd[8] и man:sendmail[8]: привяжите их к адресу хост-системы также " "через их собственную конфигурацию." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:341 msgid "" "For firewall-level control over which addresses a jail may use, see " "crossref:firewalls[firewalls,Firewalls]." msgstr "" "Для контроля на уровне межсетевого экрана за тем, какие адреса может " "использовать клетка, см. crossref:firewalls[firewalls,Межсетевые экраны]." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:343 #, no-wrap msgid "Setting Up the Jail Directory Tree" msgstr "Настройка дерева каталогов клетки" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:346 msgid "There is no specific place to put the files for the jails." msgstr "Для файлов клеток не назначено какого-то заранее определённого места." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:349 msgid "" "Some administrators use [.filename]#/jail#, others [.filename]#/usr/jail#, " "and still others [.filename]#/usr/local/jails#. In this chapter " "[.filename]#/usr/local/jails# will be used." msgstr "" "Некоторые администраторы используют [.filename]#/jail#, другие — " "[.filename]#/usr/jail#, а третьи — [.filename]#/usr/local/jails#. В этой " "главе будет использоваться [.filename]#/usr/local/jails#." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:351 msgid "" "Apart from [.filename]#/usr/local/jails# other directories will be created:" msgstr "" "Помимо каталога [.filename]#/usr/local/jails# будут созданы другие каталоги:" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:353 msgid "" "[.filename]#media# will contain the compressed files of the downloaded " "userlands." msgstr "" "[.filename]#media# будет содержать сжатые файлы загруженных пользовательских " "окружений." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:354 msgid "" "[.filename]#templates# will contain the templates when using Thin Jails." msgstr "" "[.filename]#templates# будет содержать шаблоны при использовании тонких " "клеток." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:355 msgid "[.filename]#containers# will contain the jails." msgstr "[.filename]#containers# будет содержать клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:357 msgid "" "When using OpenZFS, execute the following commands to create datasets for " "these directories:" msgstr "" "При использовании OpenZFS выполните следующие команды для создания наборов " "данных для этих каталогов:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:364 #, no-wrap msgid "" "# zfs create -o mountpoint=/usr/local/jails zroot/jails\n" "# zfs create zroot/jails/media\n" "# zfs create zroot/jails/templates\n" "# zfs create zroot/jails/containers\n" msgstr "" "# zfs create -o mountpoint=/usr/local/jails zroot/jails\n" "# zfs create zroot/jails/media\n" "# zfs create zroot/jails/templates\n" "# zfs create zroot/jails/containers\n" #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:369 msgid "" "In this case, `zroot` was used for the parent dataset, but other datasets " "could have been used." msgstr "" "В данном случае для родительского набора данных использовался `zroot`, но " "могли быть использованы и другие наборы данных." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:373 msgid "" "Creating a separate child dataset per jail is what later enables per-jail " "snapshots, clones, quotas, and dataset delegation. Because each jail " "directory is then its own dataset, OpenZFS can both cap and guarantee its " "disk use with the `quota` and `reservation` properties; see " "crossref:jails[jail-resource-limits,Jail Resource Limits]." msgstr "" "Создание отдельного дочернего набора данных для каждой клетки в дальнейшем " "позволяет делать снимки, клоны, квоты и делегирование наборов данных для " "каждой клетки. Поскольку каталог каждой клетки затем становится собственным " "набором данных, OpenZFS может как ограничивать, так и гарантировать " "использование ею дискового пространства с помощью свойств `quota` и " "`reservation`; см. crossref:jails[jail-resource-limits,Ограничения ресурсов " "клетки]." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:375 msgid "" "When using UFS, execute the following commands to create the directories:" msgstr "" "При использовании UFS выполните следующие команды для создания каталогов:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:382 #, no-wrap msgid "" "# mkdir /usr/local/jails/\n" "# mkdir /usr/local/jails/media\n" "# mkdir /usr/local/jails/templates\n" "# mkdir /usr/local/jails/containers\n" msgstr "" "# mkdir /usr/local/jails/\n" "# mkdir /usr/local/jails/media\n" "# mkdir /usr/local/jails/templates\n" "# mkdir /usr/local/jails/containers\n" #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:385 #, no-wrap msgid "Jail Configuration Files" msgstr "Файлы конфигурации клетки" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:388 msgid "There are two ways to configure jails." msgstr "Существует два способа настройки клеток." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:391 msgid "" "The first one is to add an entry for each jail to the file [.filename]#/etc/" "jail.conf#. The other option is to create a file for each jail in the " "directory [.filename]#/etc/jail.conf.d/#." msgstr "" "Первый вариант — добавить запись для каждой клетки в файл [.filename]#/etc/" "jail.conf#. Другой вариант — создать отдельный файл для каждой клетки в " "каталоге [.filename]#/etc/jail.conf.d/#." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:394 msgid "" "In case a host system has few jails, an entry for each jail can be added in " "the file [.filename]#/etc/jail.conf#. If the host system has many jails, it " "is a good idea to have one configuration file for each jail in the " "[.filename]#/etc/jail.conf.d/# directory." msgstr "" "В случае, если на хост-системе мало клеток, записи для каждого клетки можно " "добавить в файл [.filename]#/etc/jail.conf#. Если на хост-системе много " "клеток, рекомендуется создать отдельный конфигурационный файл для каждой " "клетки в каталоге [.filename]#/etc/jail.conf.d/#." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:396 msgid "" "The files in [.filename]#/etc/jail.conf.d/# must have `.conf` as their " "extension and have to be included in [.filename]#/etc/jail.conf#:" msgstr "" "Файлы в [.filename]#/etc/jail.conf.d/# должны иметь расширение `.conf`, и их " "необходимо подключить в [.filename]#/etc/jail.conf#:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:400 #, no-wrap msgid ".include \"/etc/jail.conf.d/*.conf\";\n" msgstr ".include \"/etc/jail.conf.d/*.conf\";\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:403 msgid "A typical jail entry would look like this:" msgstr "Типичная запись с настройками клетки выглядит следующим образом:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:411 #, no-wrap msgid "" "jailname { <.>\n" " # STARTUP/LOGGING\n" " exec.start = \"/bin/sh /etc/rc\"; <.>\n" " exec.stop = \"/bin/sh /etc/rc.shutdown\"; <.>\n" " exec.consolelog = \"/var/log/jail_console_${name}.log\"; <.>\n" msgstr "" "jailname { <.>\n" " # STARTUP/LOGGING\n" " exec.start = \"/bin/sh /etc/rc\"; <.>\n" " exec.stop = \"/bin/sh /etc/rc.shutdown\"; <.>\n" " exec.consolelog = \"/var/log/jail_console_${name}.log\"; <.>\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:416 #, no-wrap msgid "" " # PERMISSIONS\n" " allow.raw_sockets; <.>\n" " exec.clean; <.>\n" " mount.devfs; <.>\n" msgstr "" " # PERMISSIONS\n" " allow.raw_sockets; <.>\n" " exec.clean; <.>\n" " mount.devfs; <.>\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:420 #, no-wrap msgid "" " # HOSTNAME/PATH\n" " host.hostname = \"${name}\"; <.>\n" " path = \"/usr/local/jails/containers/${name}\"; <.>\n" msgstr "" " # HOSTNAME/PATH\n" " host.hostname = \"${name}\"; <.>\n" " path = \"/usr/local/jails/containers/${name}\"; <.>\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:426 #, no-wrap msgid "" " # NETWORK\n" " ip4.addr = 192.168.1.151; <.>\n" " ip6.addr = \"2001:db8::151\"; <.>\n" " interface = em0; <.>\n" "}\n" msgstr "" " # NETWORK\n" " ip4.addr = 192.168.1.151; <.>\n" " ip6.addr = \"2001:db8::151\"; <.>\n" " interface = em0; <.>\n" "}\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:429 msgid "`jailname` - Name of the jail." msgstr "`jailname` — имя клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:431 msgid "" "`exec.start` - Command(s) to run in the jail environment when a jail is " "created. A typical command to run is \"/bin/sh /etc/rc\"." msgstr "" "`exec.start` — команда(ы), выполняемые в среде клетки при её создании. " "Типичная команда для выполнения — \"/bin/sh /etc/rc\"." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:433 msgid "" "`exec.stop` - Command(s) to run in the jail environment before a jail is " "removed. A typical command to run is \"/bin/sh /etc/rc.shutdown\"." msgstr "" "`exec.stop` — команда(ы), выполняемые в среде клетки перед её удалением. " "Типичная команда для выполнения — \"/bin/sh /etc/rc.shutdown\"." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:434 msgid "" "`exec.consolelog` - A file to direct command output (stdout and stderr) to." msgstr "" "`exec.consolelog` — файл для вывода результатов выполнения команды (stdout и " "stderr)." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:436 msgid "" "`allow.raw_sockets` - Allow creating raw sockets inside the jail. Setting " "this parameter allows utilities like man:ping[8] and man:traceroute[8] to " "operate inside the jail." msgstr "" "`allow.raw_sockets` — разрешает создание raw-сокетов внутри клетки. " "Установка этого параметра позволяет использовать такие утилиты, как " "man:ping[8] и man:traceroute[8], внутри клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:437 msgid "`exec.clean` - Run commands in a clean environment." msgstr "`exec.clean` — выполнение команд в чистом окружении." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:439 msgid "" "`mount.devfs` - Mount a man:devfs[5] filesystem on the chrooted [.filename]#/" "dev# directory to restrict the devices visible inside the jail. It applies " "the ruleset named by the `devfs_ruleset` parameter, or, when that parameter " "is left at its default of `0`, the `mount.devfs` fallback of ruleset 4, " "`devfsrules_jail`, which hides every host device except a minimal, jail-safe " "set (see crossref:jails[jail-conf-devfs, Devfs Rulesets])." msgstr "" "`mount.devfs` - монтирование файловой системы man:devfs[5] в каталог " "[.filename]#/dev# внутри chroot, чтобы ограничить видимые в клетке " "устройства. Применяется набор правил, заданный параметром `devfs_ruleset`, " "или, когда этот параметр оставлен по умолчанию равным `0`, используется " "запасной вариант `mount.devfs` с набором правил 4, `devfsrules_jail`, " "который скрывает все устройства хоста, кроме минимального набора, " "безопасного для клетки (см. crossref:jails[jail-conf-devfs, Devfs Rulesets])." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:440 msgid "`host.hostname` - The hostname of the jail." msgstr "`host.hostname` — имя хоста для клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:442 msgid "" "`path` - The directory which is to be the root of the jail. Any commands " "that are run inside the jail, either by jail or from man:jexec[8], are run " "from this directory." msgstr "" "`path` — каталог, который будет корневым для клетки. Любые команды, " "выполняемые внутри клетки, либо с помощью `jail`, либо через man:jexec[8], " "запускаются из этого каталога." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:447 msgid "" "`ip4.addr` - One IPv4 address, or a comma-separated list of addresses, " "assigned to the jail. Setting `ip4.addr` implies `ip4 = new`; `ip4` itself " "is not left at a standalone default. The `ip4` parameter accepts three " "values: `new` restricts the jail to the addresses listed in `ip4.addr`, " "`inherit` gives the jail unrestricted access to every IPv4 address of the " "host, and `disable` turns off IPv4 in the jail entirely. A jail with " "neither `ip4` nor `ip4.addr` set behaves like `inherit`, and `interface` and " "`ip4.addr` have no effect under `inherit`. In a jail with several " "addresses, `ip4.saddrsel` lets the kernel choose the source address for " "outgoing connections on unbound sockets, while `ip4.nosaddrsel` forces the " "first address in the list." msgstr "" "`ip4.addr` - Один IPv4-адрес или разделённый запятыми список адресов, " "назначенных клетке. Установка `ip4.addr` подразумевает `ip4 = new`; сам " "параметр `ip4` не имеет значения по умолчанию (если он не указан, то его " "значение зависит от значений других параметров). Параметр `ip4` принимает " "три значения: `new` ограничивает клетку адресами, перечисленными в " "`ip4.addr`, `inherit` предоставляет клетке неограниченный доступ ко всем " "IPv4-адресам хоста, а `disable` полностью отключает IPv4 в клетке. Клетка, в " "которой не заданы ни `ip4`, ни `ip4.addr`, ведёт себя как при `inherit`, и " "параметры `interface` и `ip4.addr` не действуют при `inherit`. В клетке с " "несколькими адресами `ip4.saddrsel` позволяет ядру выбирать исходный адрес " "для исходящих соединений на несвязанных сокетах, тогда как `ip4.nosaddrsel` " "принудительно использует первый адрес из списка." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:450 msgid "" "`ip6.addr` - One IPv6 address, or a comma-separated list of addresses, " "assigned to the jail. The `ip6` parameter takes the same `new`, `inherit`, " "and `disable` values as `ip4`, with `ip6.saddrsel` and `ip6.nosaddrsel` " "controlling source-address selection. Use `ip6 = disable` for an IPv4-only " "jail, or `ip4 = disable` for an IPv6-only one." msgstr "" "`ip6.addr` - Один IPv6-адрес или разделенный запятыми список адресов, " "назначенных клетке. Параметр `ip6` принимает те же значения `new`, `inherit` " "и `disable`, что и `ip4`, при этом `ip6.saddrsel` и `ip6.nosaddrsel` " "управляют выбором адреса источника. Используйте `ip6 = disable` для клетки " "только с IPv4 или `ip4 = disable` для клетки только с IPv6." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:452 msgid "" "`interface` - A network interface to add the jail's IP addresses. Usually " "the host interface." msgstr "" "`interface` — Сетевой интерфейс для добавления IP-адресов клетки. Обычно это " "интерфейс хоста." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:459 msgid "" "A jail has no virtual console: man:init[8] and man:getty[8] do not run " "inside it, so there is nothing to attach to interactively. The " "`exec.consolelog` file captures only the standard output and standard error " "of the `exec.*` commands, that is, the output of the [.filename]#/etc/rc# " "startup and [.filename]#/etc/rc.shutdown# scripts. It is not an interactive " "console; for that, use man:jexec[8] (see crossref:jails[access-jail, Access " "a Jail]) or run man:sshd[8] inside the jail. The jail's own daemons send " "their later output to the jail's syslog." msgstr "" "Клетка не имеет виртуальной консоли: man:init[8] и man:getty[8] не " "запускаются внутри неё, поэтому не к чему подключиться в интерактивном " "режиме. Файл `exec.consolelog` захватывает только стандартный вывод и " "стандартный поток ошибок команд `exec.*`, то есть вывод сценариев " "[.filename]#/etc/rc# запуска и [.filename]#/etc/rc.shutdown# завершения " "работы. Это не интерактивная консоль; для этого используйте man:jexec[8] " "(см. crossref:jails[access-jail, Доступ к клетке]) или запустите man:sshd[8] " "внутри клетки. Собственные демоны клетки отправляют свой последующий вывод в " "syslog клетки." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:465 msgid "" "The `exec.consolelog` files grow without bound. Rotate them with " "man:newsyslog[8] by adding a single glob entry, for example in [.filename]#/" "etc/newsyslog.conf.d/jail#:" msgstr "" "Файлы `exec.consolelog` растут без ограничений. Выполняйте их ротацию с " "помощью man:newsyslog[8], добавив одну запись с подстановочным знаком " "(glob), например, в [.filename]#/etc/newsyslog.conf.d/jail#:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:469 #, no-wrap msgid "/var/log/jail_console_*.log 640 7 100 * J\n" msgstr "/var/log/jail_console_*.log 640 7 100 * J\n" #. type: Title ==== #: documentation/content/en/books/handbook/jails/_index.adoc:473 #, no-wrap msgid "Global Settings, Wildcards and Variables" msgstr "Глобальные параметры, подстановочные знаки и переменные" #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:477 msgid "" "Parameters set outside any jail block are wildcard defaults: " "man:jail.conf[5] applies them to every jail, exactly as if they were written " "in a `*` wildcard section. Setting the shared parameters once keeps each " "jail block short." msgstr "" "Параметры, заданные вне любого блока клетки, являются подстановочными " "значениями по умолчанию: man:jail.conf[5] применяет их к каждой клетке, " "точно так же, как если бы они были записаны в разделе подстановочного знака " "`*`. Установка общих параметров один раз делает каждый блок клетки коротким." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:480 msgid "" "A name preceded by a dollar sign, and optionally enclosed in braces, is " "replaced with the value of that parameter or variable. The built-in `${name}" "` expands to the jail's own name, and a custom variable is defined just like " "a parameter but with a leading dollar sign." msgstr "" "Имя, перед которым стоит знак доллара и которое, при необходимости, " "заключено в фигурные скобки, заменяется значением этого параметра или " "переменной. Встроенное выражение `${name}` разворачивается в собственное " "имя клетки, а пользовательская переменная определяется точно так же, как " "параметр, но с ведущим знаком доллара." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:482 msgid "" "The following [.filename]#/etc/jail.conf# defines a common header once and " "overrides only what differs per jail:" msgstr "" "Следующий [.filename]#/etc/jail.conf# определяет общий заголовок один раз и " "переопределяет только то, что отличается для каждой клетки:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:494 #, no-wrap msgid "" "# Shared defaults applied to every jail\n" "exec.start = \"/bin/sh /etc/rc\";\n" "exec.stop = \"/bin/sh /etc/rc.shutdown\";\n" "exec.consolelog = \"/var/log/jail_console_${name}.log\";\n" "exec.clean;\n" "mount.devfs;\n" "host.hostname = \"${name}\";\n" "path = \"/usr/local/jails/containers/${name}\";\n" "interface = em0;\n" msgstr "" "# Shared defaults applied to every jail\n" "exec.start = \"/bin/sh /etc/rc\";\n" "exec.stop = \"/bin/sh /etc/rc.shutdown\";\n" "exec.consolelog = \"/var/log/jail_console_${name}.log\";\n" "exec.clean;\n" "mount.devfs;\n" "host.hostname = \"${name}\";\n" "path = \"/usr/local/jails/containers/${name}\";\n" "interface = em0;\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:498 #, no-wrap msgid "" "www {\n" " ip4.addr = 192.168.1.151;\n" "}\n" msgstr "" "www {\n" " ip4.addr = 192.168.1.151;\n" "}\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:503 #, no-wrap msgid "" "db {\n" " host.hostname = \"database.example.com\";\n" " ip4.addr = 192.168.1.152;\n" "}\n" msgstr "" "db {\n" " host.hostname = \"database.example.com\";\n" " ip4.addr = 192.168.1.152;\n" "}\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:506 msgid "" "Here `www` inherits everything from the header and sets only its address, " "while `db` also overrides `host.hostname`." msgstr "" "Здесь `www` наследует всё из заголовка и задаёт только свой адрес, тогда как " "`db` также переопределяет `host.hostname`." #. type: Title ==== #: documentation/content/en/books/handbook/jails/_index.adoc:508 #, no-wrap msgid "Command Hooks" msgstr "Командные хуки" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:512 msgid "" "man:jail[8] runs a jail through a sequence of lifecycle hooks, and it " "matters whether each one runs in the host environment or inside the jail. " "In creation order:" msgstr "" "man:jail[8] запускает клетку через последовательность перехватчиков " "жизненного цикла (хуков), и важно, выполняется ли каждый из хуков в среде " "хост-системы или внутри клетки. В порядке создания:" #. type: Labeled list #: documentation/content/en/books/handbook/jails/_index.adoc:513 #, no-wrap msgid "`exec.prestart`" msgstr "`exec.prestart`" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:514 msgid "Runs in the host environment before the jail is created." msgstr "Выполняется в среде хост-системы до создания клетки." #. type: Labeled list #: documentation/content/en/books/handbook/jails/_index.adoc:514 #, no-wrap msgid "`exec.created`" msgstr "`exec.created`" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:515 msgid "" "Runs in the host environment after the jail exists but before any process " "starts inside it." msgstr "" "Выполняется в среде хост-системы после создания клетки, но до запуска любого " "процесса внутри неё." #. type: Labeled list #: documentation/content/en/books/handbook/jails/_index.adoc:515 #, no-wrap msgid "`exec.start`" msgstr "`exec.start`" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:516 msgid "" "Runs inside the jail, typically `/bin/sh /etc/rc` to bring up its services." msgstr "" "Выполняется внутри клетки, обычно `/bin/sh /etc/rc` для запуска её служб." #. type: Labeled list #: documentation/content/en/books/handbook/jails/_index.adoc:516 #, no-wrap msgid "`exec.poststart`" msgstr "`exec.poststart`" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:517 msgid "Runs in the host environment after the jail has started." msgstr "Выполняется в среде хост-системы после запуска клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:519 msgid "Shutdown runs the mirror image:" msgstr "При завершении работы хуки выполняется зеркально в обратном порядке:" #. type: Labeled list #: documentation/content/en/books/handbook/jails/_index.adoc:520 #, no-wrap msgid "`exec.prestop`" msgstr "`exec.prestop`" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:521 msgid "Runs in the host environment before the jail is stopped." msgstr "Выполняется в среде хост-системы до остановки клетки." #. type: Labeled list #: documentation/content/en/books/handbook/jails/_index.adoc:521 #, no-wrap msgid "`exec.stop`" msgstr "`exec.stop`" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:522 msgid "Runs inside the jail, typically `/bin/sh /etc/rc.shutdown`." msgstr "Выполняется внутри клетки, обычно `/bin/sh /etc/rc.shutdown`." #. type: Labeled list #: documentation/content/en/books/handbook/jails/_index.adoc:522 #, no-wrap msgid "`exec.poststop`" msgstr "`exec.poststop`" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:523 msgid "" "Runs in the host environment after the jail has stopped, to tear down " "whatever `exec.prestart` set up." msgstr "" "Выполняется в среде хост-системы после остановки клетки, чтобы разобрать " "всё, что было настроено с помощью `exec.prestart`." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:525 msgid "A hook may be assigned more than one command by appending with `+=`:" msgstr "" "Хуку может быть назначено более одной команды путём добавления с помощью " "`+=`:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:529 #, no-wrap msgid "exec.poststart += \"logger jail ${name} started\";\n" msgstr "exec.poststart += \"logger jail ${name} started\";\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:533 msgid "" "`exec.timeout` caps how long man:jail[8] waits for a command to finish, and " "`exec.consolelog` captures the output of these commands. The VNET section " "(crossref:jails[creating-vnet-jail, VNET Jails]) uses `exec.prestart` and " "`exec.poststop` to build and tear down each jail's network plumbing on the " "host." msgstr "" "`exec.timeout` ограничивает время, в течение которого man:jail[8] ожидает " "завершения команды, а `exec.consolelog` захватывает вывод этих команд. В " "разделе VNET (crossref:jails[creating-vnet-jail, VNET Jails]) используются " "`exec.prestart` и `exec.poststop` для настройки и демонтажа сетевой " "инфраструктуры каждой клетки на хосте." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:536 msgid "" "Where hooks order commands within a single jail, the `depend` parameter " "orders whole jails. Writing `depend = otherjail;` tells man:jail[8] that " "this jail requires `otherjail`: the dependency is created first, up to the " "completion of its last `exec.poststart` command, before this jail is " "created, and the jails are torn down in the reverse order." msgstr "" "Тогда как хуки упорядочивают команды внутри одной клетки, параметр `depend` " "упорядочивает запуск целых клеток. Запись `depend = otherjail;` сообщает " "man:jail[8], что эта клетка требует `otherjail`: зависимость создаётся " "первой, до завершения её последней команды `exec.poststart`, прежде чем " "будет создана эта клетка, и клетки уничтожаются в обратном порядке." #. type: Title ==== #: documentation/content/en/books/handbook/jails/_index.adoc:538 #, no-wrap msgid "Devfs Rulesets" msgstr "Наборы правил Devfs" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:544 msgid "" "Every jail that sets `mount.devfs` gets a devfs ruleset that decides which " "device nodes appear under its [.filename]#/dev#, either the one named by the " "`devfs_ruleset` parameter or, when that parameter is unset, the " "`mount.devfs` default of ruleset 4. man:devfs.rules[5] defines named " "rulesets in [.filename]#/etc/defaults/devfs.rules#. Two of them are meant " "for jails: `devfsrules_jail`, ruleset 4, is the standard minimal device set " "for a jail, and `devfsrules_jail_vnet`, ruleset 5, adds [.filename]#/dev/pf# " "so a VNET jail can run its own firewall. The VNET jail examples set " "`devfs_ruleset = 5` and the Linux jail example sets `devfs_ruleset = 4`; the " "classic and thin-jail examples set only `mount.devfs` and so use its default " "of ruleset 4." msgstr "" "Каждая клетка, которая устанавливает `mount.devfs`, получает набор правил " "devfs, определяющий, какие узлы устройств появляются в её [.filename]#/dev#: " "либо тот, который задан параметром `devfs_ruleset`, либо, когда этот " "параметр не установлен, значение по умолчанию для `mount.devfs` — набор " "правил 4. man:devfs.rules[5] определяет именованные наборы правил в " "[.filename]#/etc/defaults/devfs.rules#. Два из них предназначены для клеток: " "`devfsrules_jail`, набор правил 4, является стандартным минимальным набором " "устройств для клетки, а `devfsrules_jail_vnet`, набор правил 5, добавляет " "[.filename]#/dev/pf#, чтобы клетка VNET могла запускать собственный " "межсетевой экран. Примеры клеток VNET устанавливают `devfs_ruleset = 5`, а " "пример клетки Linux устанавливает `devfs_ruleset = 4`; примеры классической " "и тонкой клеток устанавливают только `mount.devfs` и поэтому используют его " "значение по умолчанию — набор правил 4." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:547 msgid "" "To expose an extra device, write a custom ruleset in [.filename]#/etc/" "devfs.rules# that includes one of the stock rulesets and unhides what it " "needs. The following ruleset starts from `devfsrules_jail` and additionally " "unhides the man:bpf[4] devices:" msgstr "" "Чтобы открыть доступ к дополнительному устройству, напишите пользовательский " "набор правил в [.filename]#/etc/devfs.rules#, который включает один из " "стандартных наборов правил и показывает то, что ему необходимо. Следующий " "набор правил начинается с `devfsrules_jail` и дополнительно показывает " "устройства man:bpf[4]:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:553 #, no-wrap msgid "" "[devfsrules_jail_bpf=100]\n" "add include $devfsrules_jail\n" "add path 'bpf*' unhide\n" msgstr "" "[devfsrules_jail_bpf=100]\n" "add include $devfsrules_jail\n" "add path 'bpf*' unhide\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:556 msgid "" "Reload the rules, then reference the new ruleset by its number in the jail's " "configuration:" msgstr "" "Перезагрузите правила, затем укажите новый набор правил по его номеру в " "конфигурации клетки:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:560 #, no-wrap msgid "# service devfs restart\n" msgstr "# service devfs restart\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:565 #, no-wrap msgid "devfs_ruleset = 100;\n" msgstr "devfs_ruleset = 100;\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:568 msgid "" "Rulesets in [.filename]#/etc/devfs.rules# override same-numbered rulesets in " "[.filename]#/etc/defaults/devfs.rules#; otherwise the two files are " "effectively merged." msgstr "" "Правила в [.filename]#/etc/devfs.rules# переопределяют правила с теми же " "номерами в [.filename]#/etc/defaults/devfs.rules#; в остальных случаях " "эффект двух файлов фактически объединяется." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:570 msgid "" "More information about configuration variables can be found in man:jail[8] " "and man:jail.conf[5]." msgstr "" "Дополнительную информацию о переменных конфигурации можно найти в " "man:jail[8] и man:jail.conf[5]." #. type: Title == #: documentation/content/en/books/handbook/jails/_index.adoc:572 #, no-wrap msgid "Classic Jail (Thick Jail)" msgstr "Классическая клетка (Толстая клетка)" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:576 msgid "" "These jails resemble a real FreeBSD system. They can be managed more or " "less like a normal host system and updated independently." msgstr "" "Эти клетки напоминают настоящую систему FreeBSD. Ими можно управлять почти " "так же, как обычной хост-системой, и обновлять независимо." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:578 #, no-wrap msgid "Creating a Classic Jail" msgstr "Создание классической клетки" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:581 msgid "" "In principle, a jail only needs a hostname, a root directory, an IP address, " "and a userland." msgstr "" "В принципе, для клетки требуется только имя хоста, корневой каталог, IP-" "адрес и пользовательское пространство." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:583 msgid "" "The userland for the jail can be obtained from the official FreeBSD download " "servers." msgstr "" "Пользовательское окружение для клетки можно получить с официальных серверов " "загрузки FreeBSD." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:585 msgid "Execute the following command to download the userland:" msgstr "" "Выполните следующую команду, чтобы загрузить пользовательское окружение:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:589 #: documentation/content/en/books/handbook/jails/_index.adoc:795 #: documentation/content/en/books/handbook/jails/_index.adoc:899 #, no-wrap msgid "# fetch https://download.freebsd.org/releases/amd64/amd64/{rel-latest}-RELEASE/base.txz -o /usr/local/jails/media/{rel-latest}-RELEASE-base.txz\n" msgstr "# fetch https://download.freebsd.org/releases/amd64/amd64/{rel-latest}-RELEASE/base.txz -o /usr/local/jails/media/{rel-latest}-RELEASE-base.txz\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:592 msgid "" "Once the download is complete, it will be necessary to extract the contents " "into the jail directory." msgstr "" "После завершения загрузки необходимо извлечь содержимое в каталог клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:594 msgid "" "Execute the following commands to extract the userland into the jail's " "directory:" msgstr "" "Выполните следующие команды, чтобы извлечь пользовательское окружение в " "каталог клетки:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:599 #, no-wrap msgid "" "# mkdir -p /usr/local/jails/containers/classic\n" "# tar -xf /usr/local/jails/media/{rel-latest}-RELEASE-base.txz -C /usr/local/jails/containers/classic --unlink\n" msgstr "" "# mkdir -p /usr/local/jails/containers/classic\n" "# tar -xf /usr/local/jails/media/{rel-latest}-RELEASE-base.txz -C /usr/local/jails/containers/classic --unlink\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:602 msgid "" "With the userland extracted in the jail directory, it will be necessary to " "copy the timezone and DNS server files:" msgstr "" "С извлечённой пользовательской средой в каталоге клетки потребуется " "скопировать файлы часового пояса и DNS-сервера:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:607 #, no-wrap msgid "" "# cp /etc/resolv.conf /usr/local/jails/containers/classic/etc/resolv.conf\n" "# cp /etc/localtime /usr/local/jails/containers/classic/etc/localtime\n" msgstr "" "# cp /etc/resolv.conf /usr/local/jails/containers/classic/etc/resolv.conf\n" "# cp /etc/localtime /usr/local/jails/containers/classic/etc/localtime\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:610 msgid "" "With the files copied, the next thing to do is update to the latest patch " "level by executing the following command:" msgstr "" "Скопировав файлы, следующим шагом будет обновление до последнего уровня " "исправлений с помощью выполнения следующей команды:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:614 #, no-wrap msgid "# freebsd-update -b /usr/local/jails/containers/classic/ fetch install\n" msgstr "# freebsd-update -b /usr/local/jails/containers/classic/ fetch install\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:618 #: documentation/content/en/books/handbook/jails/_index.adoc:839 msgid "" "The last step is to configure the jail. It will be necessary to add an " "entry to the configuration file [.filename]#/etc/jail.conf# or in " "[.filename]#jail.conf.d# with the parameters of the jail." msgstr "" "Последним шагом является настройка клетки. Необходимо добавить запись в " "конфигурационный файл [.filename]#/etc/jail.conf# или в " "[.filename]#jail.conf.d# с параметрами клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:620 #: documentation/content/en/books/handbook/jails/_index.adoc:841 msgid "An example would be the following:" msgstr "Пример может выглядеть следующим образом:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:628 #, no-wrap msgid "" "classic {\n" " # STARTUP/LOGGING\n" " exec.start = \"/bin/sh /etc/rc\";\n" " exec.stop = \"/bin/sh /etc/rc.shutdown\";\n" " exec.consolelog = \"/var/log/jail_console_${name}.log\";\n" msgstr "" "classic {\n" " # STARTUP/LOGGING\n" " exec.start = \"/bin/sh /etc/rc\";\n" " exec.stop = \"/bin/sh /etc/rc.shutdown\";\n" " exec.consolelog = \"/var/log/jail_console_${name}.log\";\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:633 #: documentation/content/en/books/handbook/jails/_index.adoc:748 #: documentation/content/en/books/handbook/jails/_index.adoc:854 #: documentation/content/en/books/handbook/jails/_index.adoc:1008 #, no-wrap msgid "" " # PERMISSIONS\n" " allow.raw_sockets;\n" " exec.clean;\n" " mount.devfs;\n" msgstr "" " # PERMISSIONS\n" " allow.raw_sockets;\n" " exec.clean;\n" " mount.devfs;\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:637 #: documentation/content/en/books/handbook/jails/_index.adoc:752 #: documentation/content/en/books/handbook/jails/_index.adoc:858 #: documentation/content/en/books/handbook/jails/_index.adoc:1316 #, no-wrap msgid "" " # HOSTNAME/PATH\n" " host.hostname = \"${name}\";\n" " path = \"/usr/local/jails/containers/${name}\";\n" msgstr "" " # HOSTNAME/PATH\n" " host.hostname = \"${name}\";\n" " path = \"/usr/local/jails/containers/${name}\";\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:642 #, no-wrap msgid "" " # NETWORK\n" " ip4.addr = 192.168.1.151;\n" " interface = em0;\n" "}\n" msgstr "" " # NETWORK\n" " ip4.addr = 192.168.1.151;\n" " interface = em0;\n" "}\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:645 #: documentation/content/en/books/handbook/jails/_index.adoc:866 #: documentation/content/en/books/handbook/jails/_index.adoc:1036 msgid "Execute the following command to start the jail:" msgstr "Выполните следующую команду для запуска клетки:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:649 #, no-wrap msgid "# service jail start classic\n" msgstr "# service jail start classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:652 #: documentation/content/en/books/handbook/jails/_index.adoc:874 msgid "" "More information on how to manage jails can be found in the section " "crossref:jails[jail-management, Jail Management]." msgstr "" "Дополнительная информация об управлении клетками приведена в разделе " "crossref:jails[jail-management,Управление клетками]." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:654 #, no-wrap msgid "Obtaining the Jail Userland" msgstr "Получение пользовательского окружения клетки" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:658 msgid "" "The fetch-and-extract procedure shown above is the traditional way to " "populate a jail's root directory, but it is not the only one. The same " "userland can be installed with man:bsdinstall[8], from base-system packages, " "or from a locally built source tree." msgstr "" "Процедура fetch-and-extract, показанная выше, является традиционным способом " "заполнения корневого каталога клетки, но это не единственный способ. Та же " "самая пользовательская среда может быть установлена с помощью " "man:bsdinstall[8], из базовых системных пакетов или из локально собранного " "дерева исходных кодов." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:661 msgid "" "man:bsdinstall[8] provides a dedicated `jail` target that sets up a new " "userland at the given directory for use with man:jail[8]. It fetches and " "extracts the distribution sets without installing a kernel, skipping the " "disk partitioning and network steps of a normal installation, which makes it " "a one-command, scriptable alternative to the manual fetch and man:tar[1] " "sequence:" msgstr "" "man:bsdinstall[8] предоставляет выделенную цель `jail`, которая настраивает " "новое пользовательское окружение в заданном каталоге для использования с " "man:jail[8]. Она загружает и распаковывает наборы дистрибутивов без " "установки ядра, пропуская шаги разбиения диска и настройки сети обычной " "установки, что делает её однокомандным скриптом — альтернативой ручной " "последовательности загрузки и man:tar[1] следующим образом:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:665 #, no-wrap msgid "# bsdinstall jail /usr/local/jails/containers/classic\n" msgstr "# bsdinstall jail /usr/local/jails/containers/classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:669 msgid "" "The `jail` target installs the base distribution ([.filename]#base.txz#) by " "default. On FreeBSD 15.0 and later man:bsdinstall[8] can also populate the " "root from base-system packages with its `pkgbase` target; the pkg-based " "method is described next." msgstr "" "Цель `jail` по умолчанию устанавливает базовый дистрибутив " "([.filename]#base.txz#). Начиная с FreeBSD 15.0 и более поздних версий, " "man:bsdinstall[8] также может заполнять корневой каталог пакетами базовой " "системы с помощью своей цели `pkgbase`; метод на основе пакетов описан далее." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:672 msgid "" "Starting with FreeBSD 15.0 the base system is also published as packages, so " "a jail userland can be installed entirely with man:pkg[8] from the `FreeBSD-" "base` repository. Point man:pkg[8] at the jail's root directory with the " "global `--rootdir` option and install the jail variant of the base set:" msgstr "" "Начиная с FreeBSD 15.0, базовая система также публикуется в виде пакетов, " "поэтому пользовательское окружение клетки можно установить полностью с " "помощью man:pkg[8] из репозитория `FreeBSD-base`. Укажите man:pkg[8] на " "корневой каталог клетки с помощью глобальной опции `--rootdir` и установите " "вариант клетки для базового набора:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:676 #, no-wrap msgid "# pkg --rootdir /usr/local/jails/containers/classic install -r FreeBSD-base FreeBSD-set-base-jail\n" msgstr "# pkg --rootdir /usr/local/jails/containers/classic install -r FreeBSD-base FreeBSD-set-base-jail\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:680 msgid "" "Use `FreeBSD-set-minimal-jail` instead of `FreeBSD-set-base-jail` for a " "minimal userland. A jail installed this way is afterwards patched and " "upgraded with man:pkg[8] rather than man:freebsd-update[8]; see " "crossref:jails[jail-upgrade-pkgbase, Upgrading pkgbase Jails]." msgstr "" "Используйте `FreeBSD-set-minimal-jail` вместо `FreeBSD-set-base-jail` для " "минимального пользовательского окружения. Клетка, установленная таким " "образом, впоследствии обновляется и получает исправления с помощью " "man:pkg[8], а не man:freebsd-update[8]; см. crossref:jails[jail-upgrade-" "pkgbase, Обновление клеток pkgbase]." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:687 msgid "" "Base-system packages are a technology preview in FreeBSD 15.0. The `FreeBSD-" "base` repository is defined in [.filename]#/etc/pkg/FreeBSD.conf# but " "disabled by default, so select it explicitly with `install -r FreeBSD-" "base`. The target root directory and its [.filename]#var/cache/pkg# and " "[.filename]#var/db/pkg# subdirectories may need to be created first. The " "traditional [.filename]#base.txz# distribution is still published for " "FreeBSD 15.0, so the fetch-and-extract method continues to work there as " "well." msgstr "" "Пакеты базовой системы — это технологическая предварительная версия в " "FreeBSD 15.0. Репозиторий `FreeBSD-base` определён в [.filename]#/etc/pkg/" "FreeBSD.conf#, но по умолчанию отключён, поэтому выбирайте его явно с " "помощью `install -r FreeBSD-base`. Целевой корневой каталог и его " "подкаталоги [.filename]#var/cache/pkg# и [.filename]#var/db/pkg# возможно, " "потребуется создать заранее. Традиционное распространение " "[.filename]#base.txz# по-прежнему публикуется для FreeBSD 15.0, поэтому " "метод fetch-and-extract продолжает работать и там." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:691 msgid "" "A userland built from a source tree can be installed into a jail's root " "directory with the `DESTDIR` variable, which is the way to run a `-STABLE` " "or custom-built userland in a jail. After building the world, install it " "and the remaining distribution files into the jail directory:" msgstr "" "Пользовательское окружение, собранное из дерева исходных кодов, может быть " "установлено в корневой каталог клетки с помощью переменной `DESTDIR`, что " "является способом запуска пользовательского окружения `-STABLE` или " "собранного вручную в клетке. После сборки мира установите его и остальные " "дистрибутивные файлы в каталог клетки:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:698 #, no-wrap msgid "" "# cd /usr/src\n" "# make buildworld\n" "# make installworld DESTDIR=/usr/local/jails/containers/classic\n" "# make distribution DESTDIR=/usr/local/jails/containers/classic\n" msgstr "" "# cd /usr/src\n" "# make buildworld\n" "# make installworld DESTDIR=/usr/local/jails/containers/classic\n" "# make distribution DESTDIR=/usr/local/jails/containers/classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:703 msgid "" "`make distribution` installs the default configuration files under the " "jail's [.filename]#/etc# and is run only once, when populating the jail; " "repeating it during an update would overwrite the configuration inside the " "jail. To update such a jail from source, follow the same sequence as for " "the host: run `installworld` with the same `DESTDIR`, merge the " "configuration files with `etcupdate -D` pointed at the jail's root " "directory, and remove obsolete files and libraries with `make delete-old " "delete-old-libs`, again with the same `DESTDIR`, rather than using " "man:freebsd-update[8]. See crossref:cutting-edge[makeworld, Updating " "FreeBSD from Source] for the complete source-update procedure." msgstr "" "`make distribution` устанавливает файлы конфигурации по умолчанию в " "[.filename]#/etc# клетки и выполняется только один раз, при заполнении " "клетки; повторение этого действия во время обновления перезапишет " "конфигурацию внутри клетки. Чтобы обновить такую клетку из исходников, " "следуйте той же последовательности, что и для хост-системы: запустите " "`installworld` с тем же `DESTDIR`, объедините файлы конфигурации с помощью " "`etcupdate -D`, указав корневой каталог клетки, и удалите устаревшие файлы и " "библиотеки с помощью `make delete-old delete-old-libs`, снова с тем же " "`DESTDIR`, вместо использования man:freebsd-update[8]. Полную процедуру " "обновления из исходного кода см. в crossref:cutting-edge[makeworld, " "Обновление FreeBSD из исходного кода]." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:705 #, no-wrap msgid "Cloning a Jail as a Template" msgstr "Клонирование клетки как шаблона" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:708 msgid "" "Once a thick jail is fully configured, with packages installed, services " "enabled, and local configuration in place, it can serve as a template image: " "a template from which many identical jails are deployed almost instantly." msgstr "" "После того как толстая клетка полностью настроена, с установленными " "пакетами, включёнными службами и локальной конфигурацией, она может служить " "шаблонным образом: шаблоном, из которого почти мгновенно развёртываются " "множество идентичных клеток." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:711 msgid "" "On OpenZFS this is done by snapshotting the configured jail's dataset and " "cloning it. This requires the source jail to live on its own dataset, so " "create it with `zfs create` rather than the `mkdir` used in the classic-jail " "procedure above:" msgstr "" "В OpenZFS это делается путем создания снимка настроенного набора данных " "клетки и его клонирования. Это требует, чтобы исходная клетка располагалась " "в собственном наборе данных, поэтому создайте её с помощью `zfs create`, а " "не `mkdir`, как в классической процедуре клетки выше:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:715 #, no-wrap msgid "# zfs create -p zroot/jails/containers/classic\n" msgstr "# zfs create -p zroot/jails/containers/classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:718 msgid "" "Stop the jail before snapshotting so the image is consistent, then snapshot " "and clone the dataset once for each new jail:" msgstr "" "Остановите клетку перед созданием снимка, чтобы образ был консистентным, " "затем создайте снимок и клонируйте набор данных один раз для каждой новой " "клетки:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:724 #, no-wrap msgid "" "# service jail stop classic\n" "# zfs snapshot zroot/jails/containers/classic@template\n" "# zfs clone zroot/jails/containers/classic@template zroot/jails/containers/web1\n" msgstr "" "# service jail stop classic\n" "# zfs snapshot zroot/jails/containers/classic@template\n" "# zfs clone zroot/jails/containers/classic@template zroot/jails/containers/web1\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:727 msgid "On a UFS host, copy the configured jail's directory tree instead:" msgstr "" "На хосте UFS скопируйте дерево каталогов настроенной клетки вместо этого:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:731 #, no-wrap msgid "# cp -a /usr/local/jails/containers/classic /usr/local/jails/containers/web1\n" msgstr "# cp -a /usr/local/jails/containers/classic /usr/local/jails/containers/web1\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:735 msgid "" "Each clone needs its own entry in [.filename]#/etc/jail.conf#, or in " "[.filename]#jail.conf.d#, with a unique name, path, and IP address. Because " "the `path` and `host.hostname` parameters in the example above are derived " "from the block name with `${name}`, only the block name and the address " "differ:" msgstr "" "Каждый клон требует своей собственной записи в [.filename]#/etc/jail.conf#, " "или в [.filename]#jail.conf.d#, с уникальным именем, путем и IP-адресом. " "Поскольку параметры `path` и `host.hostname` в приведенном выше примере " "выводятся из имени блока с помощью `${name}`, отличаются только имя блока и " "адрес:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:743 #, no-wrap msgid "" "web1 {\n" " # STARTUP/LOGGING\n" " exec.start = \"/bin/sh /etc/rc\";\n" " exec.stop = \"/bin/sh /etc/rc.shutdown\";\n" " exec.consolelog = \"/var/log/jail_console_${name}.log\";\n" msgstr "" "web1 {\n" " # STARTUP/LOGGING\n" " exec.start = \"/bin/sh /etc/rc\";\n" " exec.stop = \"/bin/sh /etc/rc.shutdown\";\n" " exec.consolelog = \"/var/log/jail_console_${name}.log\";\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:757 #, no-wrap msgid "" " # NETWORK\n" " ip4.addr = 192.168.1.152;\n" " interface = em0;\n" "}\n" msgstr "" " # NETWORK\n" " ip4.addr = 192.168.1.152;\n" " interface = em0;\n" "}\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:763 msgid "" "A template-image clone differs from a thin jail (crossref:jails[thin-jail, " "Thin Jails]). A thin jail keeps sharing a read-only base and is maintained " "once at the template, whereas each template-image clone is a full, " "independently writable copy that is patched and upgraded on its own as " "described in crossref:jails[jail-upgrading, Jail Upgrading]. An OpenZFS " "clone starts as a space-efficient copy-on-write copy that shares blocks with " "the snapshot, and it keeps a dependency on that origin snapshot until `zfs " "promote` severs it. For a fully independent copy, or to replicate a jail to " "another pool or host, use `zfs send` piped to `zfs receive` instead of `zfs " "clone`." msgstr "" "Клон шаблонного образа отличается от тонкой клетки (crossref:jails[thin-" "jail, Тонкие клетки]). Тонкая клетка продолжает использовать общую базу " "только для чтения и обслуживается один раз в шаблоне, тогда как каждый клон " "шаблонного образа представляет собой полную, независимо записываемую копию, " "которая обновляется и модернизируется отдельно, как описано в " "crossref:jails[jail-upgrading, Обновление клетки]. Клон OpenZFS изначально " "является эффективной по пространству копией при записи (copy-on-write), " "которая разделяет блоки со снимком, и сохраняет зависимость от этого " "исходного снимка, пока `zfs promote` не разорвёт её. Для полностью " "независимой копии или для репликации клетки на другой пул или хост " "используйте `zfs send`, переданный через конвейер в `zfs receive`, вместо " "`zfs clone`." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:771 msgid "" "Although Thin Jails use the same technology as Thick Jails, the creation " "procedure is different. Thin jails can be created using OpenZFS snapshots " "or using templates and NullFS. The use of OpenZFS snapshots and templates " "using NullFS have certain advantages over classic jails, such as being able " "to create them faster from snapshots or being able to update multiple jails " "using NullFS." msgstr "" "Хотя тонкие клетки используют ту же технологию, что и толстые клетки, " "процедура их создания отличается. Тонкие клетки можно создавать с " "использованием снимков OpenZFS или шаблонов и NullFS. Использование снимков " "OpenZFS и шаблонов с NullFS имеет определённые преимущества перед " "классическими клетками, например, возможность быстрого создания из снимков " "или обновления нескольких клеток с помощью NullFS." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:773 #, no-wrap msgid "Creating a Thin Jail Using OpenZFS Snapshots" msgstr "Создание тонкой клетки с использованием снимков OpenZFS" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:776 msgid "" "Due to the good integration between FreeBSD and OpenZFS it is very easy to " "create new Thin Jails using OpenZFS Snapshots." msgstr "" "Благодаря хорошей интеграции между FreeBSD и OpenZFS создание новых тонких " "клеток с использованием снимков OpenZFS очень просто." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:778 msgid "" "To create a Thin Jail using OpenZFS Snapshots the first step is to create " "the jail directory tree by following the instructions in crossref:jails[host-" "configuration-directories, \"Setting Up the Jail Directory Tree\"]." msgstr "" "Для создания тонкой клетки с использованием снимков OpenZFS первым шагом " "является создание дерева каталогов клетки, следуя инструкциям в разделе " "crossref:jails[host-configuration-directories, \"Настройка дерева каталогов " "клетки\"]." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:782 msgid "" "Next, create a template. Templates will only be used to create new jails. " "For this reason they are created in \"read-only\" mode so that jails are " "created with an immutable base." msgstr "" "Далее создайте шаблон. Шаблоны будут использоваться только для создания " "новых клеток. По этой причине они создаются в режиме \"только для чтения\", " "чтобы клетки создавались на неизменяемой основе." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:784 msgid "To create the dataset for the template, execute the following command:" msgstr "Для создания набора данных для шаблона выполните следующую команду:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:788 #, no-wrap msgid "# zfs create -p zroot/jails/templates/{rel-latest}-RELEASE\n" msgstr "# zfs create -p zroot/jails/templates/{rel-latest}-RELEASE\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:791 #: documentation/content/en/books/handbook/jails/_index.adoc:895 msgid "Then execute the following command to download the userland:" msgstr "Затем выполните следующую команду для загрузки пользовательской среды:" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:798 #: documentation/content/en/books/handbook/jails/_index.adoc:902 msgid "" "Once the download is complete, it will be necessary to extract the contents " "in the template directory by executing the following command:" msgstr "" "После завершения загрузки необходимо извлечь содержимое в каталог шаблона, " "выполнив следующую команду:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:802 #, no-wrap msgid "# tar -xf /usr/local/jails/media/{rel-latest}-RELEASE-base.txz -C /usr/local/jails/templates/{rel-latest}-RELEASE --unlink\n" msgstr "# tar -xf /usr/local/jails/media/{rel-latest}-RELEASE-base.txz -C /usr/local/jails/templates/{rel-latest}-RELEASE --unlink\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:805 msgid "" "With the userland extracted in the templates directory, it will be necessary " "to copy the timezone and DNS server files to the template directory by " "executing the following command:" msgstr "" "Когда пользовательская среда записана в каталог шаблонов, необходимо " "скопировать файлы часового пояса и DNS-сервера в каталог шаблона, выполнив " "следующую команду:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:810 #, no-wrap msgid "" "# cp /etc/resolv.conf /usr/local/jails/templates/{rel-latest}-RELEASE/etc/resolv.conf\n" "# cp /etc/localtime /usr/local/jails/templates/{rel-latest}-RELEASE/etc/localtime\n" msgstr "" "# cp /etc/resolv.conf /usr/local/jails/templates/{rel-latest}-RELEASE/etc/resolv.conf\n" "# cp /etc/localtime /usr/local/jails/templates/{rel-latest}-RELEASE/etc/localtime\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:813 msgid "" "The next thing to do is update to the latest patch level by executing the " "following command:" msgstr "" "Следующее, что нужно сделать, — обновиться до последнего уровня исправлений, " "выполнив следующую команду:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:817 #: documentation/content/en/books/handbook/jails/_index.adoc:1909 #, no-wrap msgid "# freebsd-update -b /usr/local/jails/templates/{rel-latest}-RELEASE/ fetch install\n" msgstr "# freebsd-update -b /usr/local/jails/templates/{rel-latest}-RELEASE/ fetch install\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:820 msgid "Once the update is finished, the template is ready." msgstr "После завершения обновления шаблон готов." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:822 msgid "" "To create an OpenZFS Snapshot from the template, execute the following " "command:" msgstr "Для создания снимка OpenZFS из шаблона выполните следующую команду:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:826 #, no-wrap msgid "# zfs snapshot zroot/jails/templates/{rel-latest}-RELEASE@base\n" msgstr "# zfs snapshot zroot/jails/templates/{rel-latest}-RELEASE@base\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:829 msgid "" "Once the OpenZFS Snapshot has been created, infinite jails can be created " "using the OpenZFS clone function." msgstr "" "После создания снимка OpenZFS можно создавать бесконечное количество клеток " "с помощью функции клонирования OpenZFS." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:831 msgid "To create a Thin Jail named `thinjail`, execute the following command:" msgstr "" "Для создания тонкой клетки с именем `thinjail` выполните следующую команду:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:835 #, no-wrap msgid "# zfs clone zroot/jails/templates/{rel-latest}-RELEASE@base zroot/jails/containers/thinjail\n" msgstr "# zfs clone zroot/jails/templates/{rel-latest}-RELEASE@base zroot/jails/containers/thinjail\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:849 #: documentation/content/en/books/handbook/jails/_index.adoc:1003 #, no-wrap msgid "" "thinjail {\n" " # STARTUP/LOGGING\n" " exec.start = \"/bin/sh /etc/rc\";\n" " exec.stop = \"/bin/sh /etc/rc.shutdown\";\n" " exec.consolelog = \"/var/log/jail_console_${name}.log\";\n" msgstr "" "thinjail {\n" " # STARTUP/LOGGING\n" " exec.start = \"/bin/sh /etc/rc\";\n" " exec.stop = \"/bin/sh /etc/rc.shutdown\";\n" " exec.consolelog = \"/var/log/jail_console_${name}.log\";\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:863 #, no-wrap msgid "" " # NETWORK\n" " ip4 = inherit;\n" " interface = em0;\n" "}\n" msgstr "" " # NETWORK\n" " ip4 = inherit;\n" " interface = em0;\n" "}\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:870 #: documentation/content/en/books/handbook/jails/_index.adoc:1040 #, no-wrap msgid "# service jail start thinjail\n" msgstr "# service jail start thinjail\n" #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:876 #, no-wrap msgid "Creating a Thin Jail Using NullFS" msgstr "Создание тонкой клетки с использованием NullFS" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:879 msgid "" "A jail can be created with reduced duplication of system files by using the " "Thin Jail technique and using NullFS to selectively share specific " "directories from the host system into the jail." msgstr "" "Клетка может быть создана с уменьшенным дублированием системных файлов с " "использованием техники тонкой клетки и NullFS для выборочного совместного " "использования определённых каталогов из хост-системы в клетке." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:881 msgid "" "The first step is to create the dataset to save the template, execute the " "following command if using OpenZFS:" msgstr "" "Первым шагом является создание набора данных для сохранения шаблона, " "выполните следующую команду, если используется OpenZFS:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:885 #, no-wrap msgid "# zfs create -p zroot/jails/templates/{rel-latest}-RELEASE-base\n" msgstr "# zfs create -p zroot/jails/templates/{rel-latest}-RELEASE-base\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:888 msgid "Or this one if using UFS:" msgstr "Или эту, если используется UFS:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:892 #, no-wrap msgid "# mkdir /usr/local/jails/templates/{rel-latest}-RELEASE-base\n" msgstr "# mkdir /usr/local/jails/templates/{rel-latest}-RELEASE-base\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:906 #, no-wrap msgid "# tar -xf /usr/local/jails/media/{rel-latest}-RELEASE-base.txz -C /usr/local/jails/templates/{rel-latest}-RELEASE-base --unlink\n" msgstr "# tar -xf /usr/local/jails/media/{rel-latest}-RELEASE-base.txz -C /usr/local/jails/templates/{rel-latest}-RELEASE-base --unlink\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:909 msgid "" "Once the userland is extracted in the templates directory, it will be " "necessary to copy the timezone and DNS server files to the template " "directory by executing the following command:" msgstr "" "Когда пользовательская среда записана в каталог шаблонов, необходимо " "скопировать файлы часового пояса и DNS-сервера в каталог шаблона, выполнив " "следующую команду:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:914 #, no-wrap msgid "" "# cp /etc/resolv.conf /usr/local/jails/templates/{rel-latest}-RELEASE-base/etc/resolv.conf\n" "# cp /etc/localtime /usr/local/jails/templates/{rel-latest}-RELEASE-base/etc/localtime\n" msgstr "" "# cp /etc/resolv.conf /usr/local/jails/templates/{rel-latest}-RELEASE-base/etc/resolv.conf\n" "# cp /etc/localtime /usr/local/jails/templates/{rel-latest}-RELEASE-base/etc/localtime\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:917 msgid "" "With the files moved to the template, the next thing to do is update to the " "latest patch level by executing the following command:" msgstr "" "После перемещения файлов в шаблон следующим шагом будет обновление до " "последнего уровня исправлений с помощью выполнения следующей команды:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:921 #, no-wrap msgid "# freebsd-update -b /usr/local/jails/templates/{rel-latest}-RELEASE-base/ fetch install\n" msgstr "# freebsd-update -b /usr/local/jails/templates/{rel-latest}-RELEASE-base/ fetch install\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:925 msgid "" "In addition to the base template, it is also necessary to create a directory " "where the `skeleton` will be located. Some directories will be copied from " "the template to the `skeleton`." msgstr "" "В дополнение к базовому шаблону также необходимо создать каталог, где будет " "располагаться `skeleton`. Некоторые каталоги будут скопированы из шаблона в " "`skeleton`." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:927 msgid "" "Execute the following command to create the dataset for the `skeleton` in " "case of using OpenZFS:" msgstr "" "Выполните следующую команду, чтобы создать набор данных для `skeleton` в " "случае использования OpenZFS:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:931 #, no-wrap msgid "# zfs create -p zroot/jails/templates/{rel-latest}-RELEASE-skeleton\n" msgstr "# zfs create -p zroot/jails/templates/{rel-latest}-RELEASE-skeleton\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:934 msgid "Or this one in case of using UFS:" msgstr "Или эту в случае использования UFS:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:938 #, no-wrap msgid "# mkdir /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton\n" msgstr "# mkdir /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:942 msgid "" "Then create the `skeleton` directories. The `skeleton` directories will " "hold the local directories of the jails." msgstr "" "Затем создайте `skeleton`-каталоги. `Skeleton`-каталоги будут содержать " "локальные каталоги для клеток." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:944 msgid "Execute the following commands to create the directories:" msgstr "Выполните следующие команды для создания каталогов:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:954 #, no-wrap msgid "" "# mkdir -p /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton/home\n" "# mkdir -p /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton/usr\n" "# mv /usr/local/jails/templates/{rel-latest}-RELEASE-base/etc /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton/etc\n" "# mv /usr/local/jails/templates/{rel-latest}-RELEASE-base/usr/local /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton/usr/local\n" "# mv /usr/local/jails/templates/{rel-latest}-RELEASE-base/tmp /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton/tmp\n" "# mv /usr/local/jails/templates/{rel-latest}-RELEASE-base/var /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton/var\n" "# mv /usr/local/jails/templates/{rel-latest}-RELEASE-base/root /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton/root\n" msgstr "" "# mkdir -p /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton/home\n" "# mkdir -p /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton/usr\n" "# mv /usr/local/jails/templates/{rel-latest}-RELEASE-base/etc /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton/etc\n" "# mv /usr/local/jails/templates/{rel-latest}-RELEASE-base/usr/local /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton/usr/local\n" "# mv /usr/local/jails/templates/{rel-latest}-RELEASE-base/tmp /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton/tmp\n" "# mv /usr/local/jails/templates/{rel-latest}-RELEASE-base/var /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton/var\n" "# mv /usr/local/jails/templates/{rel-latest}-RELEASE-base/root /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton/root\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:957 msgid "" "The next step is to create the symlinks to the `skeleton` by executing the " "following commands:" msgstr "" "Следующий шаг — создать символьные ссылки на `skeleton`, выполнив следующие " "команды:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:968 #, no-wrap msgid "" "# cd /usr/local/jails/templates/{rel-latest}-RELEASE-base/\n" "# mkdir skeleton\n" "# ln -s skeleton/etc etc\n" "# ln -s skeleton/home home\n" "# ln -s skeleton/root root\n" "# ln -s ../skeleton/usr/local usr/local\n" "# ln -s skeleton/tmp tmp\n" "# ln -s skeleton/var var\n" msgstr "" "# cd /usr/local/jails/templates/{rel-latest}-RELEASE-base/\n" "# mkdir skeleton\n" "# ln -s skeleton/etc etc\n" "# ln -s skeleton/home home\n" "# ln -s skeleton/root root\n" "# ln -s ../skeleton/usr/local usr/local\n" "# ln -s skeleton/tmp tmp\n" "# ln -s skeleton/var var\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:971 msgid "" "With the `skeleton` ready, it will be necessary to copy the data to the jail " "directory." msgstr "Когда `skeleton` готов, необходимо скопировать данные в клетку." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:973 msgid "" "In case of using OpenZFS, OpenZFS snapshots can be used to easily create as " "many jails as necessary by executing the following commands:" msgstr "" "В случае использования OpenZFS, снимки OpenZFS могут быть использованы для " "простого создания необходимого количества клеток с помощью выполнения " "следующих команд:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:978 #, no-wrap msgid "" "# zfs snapshot zroot/jails/templates/{rel-latest}-RELEASE-skeleton@base\n" "# zfs clone zroot/jails/templates/{rel-latest}-RELEASE-skeleton@base zroot/jails/containers/thinjail\n" msgstr "" "# zfs snapshot zroot/jails/templates/{rel-latest}-RELEASE-skeleton@base\n" "# zfs clone zroot/jails/templates/{rel-latest}-RELEASE-skeleton@base zroot/jails/containers/thinjail\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:981 msgid "" "In case of using UFS the man:cp[1] program can be used by executing the " "following command:" msgstr "" "В случае использования UFS можно использовать программу man:cp[1], выполнив " "следующую команду:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:985 #, no-wrap msgid "# cp -R /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton /usr/local/jails/containers/thinjail\n" msgstr "# cp -R /usr/local/jails/templates/{rel-latest}-RELEASE-skeleton /usr/local/jails/containers/thinjail\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:988 msgid "" "Then create the directory in which the base template and the skeleton will " "be mounted:" msgstr "" "Затем создайте каталог, в котором будут смонтированы базовый шаблон и " "skeleton:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:992 #, no-wrap msgid "# mkdir -p /usr/local/jails/thinjail-nullfs-base\n" msgstr "# mkdir -p /usr/local/jails/thinjail-nullfs-base\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:995 msgid "" "Add a jail entry in [.filename]#/etc/jail.conf# or a file in " "[.filename]#jail.conf.d# as follows:" msgstr "" "Добавьте запись о клетке в [.filename]#/etc/jail.conf# или файл в " "[.filename]#jail.conf.d# следующим образом:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1012 #, no-wrap msgid "" " # HOSTNAME/PATH\n" " host.hostname = \"${name}\";\n" " path = \"/usr/local/jails/${name}-nullfs-base\";\n" msgstr "" " # HOSTNAME/PATH\n" " host.hostname = \"${name}\";\n" " path = \"/usr/local/jails/${name}-nullfs-base\";\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1016 #, no-wrap msgid "" " # NETWORK\n" " ip4.addr = 192.168.1.153;\n" " interface = em0;\n" msgstr "" " # NETWORK\n" " ip4.addr = 192.168.1.153;\n" " interface = em0;\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1020 #, no-wrap msgid "" " # MOUNT\n" " mount.fstab = \"/usr/local/jails/${name}-nullfs-base.fstab\";\n" "}\n" msgstr "" " # MOUNT\n" " mount.fstab = \"/usr/local/jails/${name}-nullfs-base.fstab\";\n" "}\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1023 msgid "" "Then create the [.filename]#/usr/local/jails/thinjail-nullfs-base.fstab# " "file as follows:" msgstr "" "Затем создайте файл [.filename]#/usr/local/jails/thinjail-nullfs-base.fstab# " "следующего содержания:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1028 #, no-wrap msgid "" "/usr/local/jails/templates/{rel-latest}-RELEASE-base /usr/local/jails/thinjail-nullfs-base/ nullfs ro 0 0\n" "/usr/local/jails/containers/thinjail /usr/local/jails/thinjail-nullfs-base/skeleton nullfs rw 0 0\n" msgstr "" "/usr/local/jails/templates/{rel-latest}-RELEASE-base /usr/local/jails/thinjail-nullfs-base/ nullfs ro 0 0\n" "/usr/local/jails/containers/thinjail /usr/local/jails/thinjail-nullfs-base/skeleton nullfs rw 0 0\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1034 msgid "" "The [.filename]#fstab# file controls how man:mount_nullfs[8] presents the " "base template and the skeleton inside the jail. The base template is " "mounted read-only (`ro`) so that every NullFS jail shares one immutable copy " "of the base system. The per-jail skeleton is mounted read-write (`rw`), " "which is where each jail keeps its own writable [.filename]#/etc#, " "[.filename]#/var#, [.filename]#/usr/local#, and other local directories. " "Because all jails share that single read-only base template, updating the " "one template updates every NullFS jail at once, in contrast to independent " "OpenZFS clones which must each be updated separately." msgstr "" "Файл [.filename]#fstab# управляет тем, как man:mount_nullfs[8] представляет " "базовый шаблон и скелет внутри клетки. Базовый шаблон монтируется только для " "чтения (`ro`), чтобы каждая клетка NullFS использовала одну неизменяемую " "копию базовой системы. Скелет каждой клетки монтируется с возможностью " "чтения и записи (`rw`), и именно здесь каждая клетка хранит свои собственные " "доступные для записи каталоги [.filename]#/etc#, [.filename]#/var#, " "[.filename]#/usr/local# и другие локальные каталоги. Поскольку все клетки " "используют один и тот же базовый шаблон только для чтения, обновление одного " "шаблона сразу обновляет все клетки NullFS, в отличие от независимых клонов " "OpenZFS, каждый из которых необходимо обновлять отдельно." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1046 msgid "" "FreeBSD VNET Jails have their own distinct networking stack, including " "interfaces, IP addresses, routing tables, and firewall rules." msgstr "" "В клетках FreeBSD VNET используется отдельный сетевой стек, включающий " "интерфейсы, IP-адреса, таблицы маршрутизации и правила межсетевого экрана." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1048 msgid "" "The first step to create a VNET jail is to create the man:bridge[4] by " "executing the following command:" msgstr "" "Первым шагом для создания VNET-клетки является создание man:bridge[4] с " "помощью выполнения следующей команды:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1052 #, no-wrap msgid "# ifconfig bridge create\n" msgstr "# ifconfig bridge create\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1055 #: documentation/content/en/books/handbook/jails/_index.adoc:1466 #: documentation/content/en/books/handbook/jails/_index.adoc:1482 #: documentation/content/en/books/handbook/jails/_index.adoc:1510 msgid "The output should be similar to the following:" msgstr "Вывод должен быть похож на следующий:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1059 #, no-wrap msgid "bridge0\n" msgstr "bridge0\n" #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1067 msgid "" "Assigning an IP address to an interface that is a member of a bridge is " "deprecated. Assign the host's address to `bridge0` itself rather than to " "`em0`, exactly as the [.filename]#/etc/rc.conf# block below does. Such " "configurations keep working for now: FreeBSD 15.0 logs a kernel warning when " "an interface that carries an address is added to a bridge, and refuses it " "with `EINVAL` only when the `net.link.bridge.member_ifaddrs` sysctl is " "changed from its default of `1` to `0`. man:bridge[4] announces the removal " "of this sysctl in FreeBSD 16.0, after which addresses on bridge members will " "no longer be permitted." msgstr "" "Назначение IP-адреса интерфейсу, который является членом моста, устарело. " "Назначайте адрес хоста самому `bridge0`, а не `em0`, точно так же, как это " "делает приведённый ниже блок [.filename]#/etc/rc.conf#. Такие конфигурации " "пока продолжают работать: FreeBSD 15.0 записывает предупреждение ядра, когда " "интерфейс с адресом добавляется в мост, и отказывает ему с `EINVAL` только " "тогда, когда sysctl `net.link.bridge.member_ifaddrs` изменён с его значения " "по умолчанию `1` на `0`. man:bridge[4] объявляет об удалении этого sysctl в " "FreeBSD 16.0, после чего адреса на членах моста больше не будут разрешены." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1070 msgid "" "With the `bridge` created, it will be necessary to attach it to the `em0` " "interface and bring both of them up by executing the following commands:" msgstr "" "Создав `bridge`, необходимо подключить его к интерфейсу `em0` и включить " "оба, выполнив следующие команды:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1075 #, no-wrap msgid "" "# ifconfig bridge0 addm em0 up\n" "# ifconfig em0 up\n" msgstr "" "# ifconfig bridge0 addm em0 up\n" "# ifconfig em0 up\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1078 msgid "" "To make this setting persist across reboots, add the following lines to " "[.filename]#/etc/rc.conf#:" msgstr "" "Чтобы сохранить этот параметр после перезагрузки, добавьте следующие строки " "в [.filename]#/etc/rc.conf#:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1085 #, no-wrap msgid "" "defaultrouter=\"192.168.1.1\"\n" "cloned_interfaces=\"bridge0\"\n" "ifconfig_bridge0=\"inet 192.168.1.150/24 addm em0 up\"\n" "ifconfig_em0=\"up\"\n" msgstr "" "defaultrouter=\"192.168.1.1\"\n" "cloned_interfaces=\"bridge0\"\n" "ifconfig_bridge0=\"inet 192.168.1.150/24 addm em0 up\"\n" "ifconfig_em0=\"up\"\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1088 msgid "" "For more information on bridging, see crossref:advanced-networking[network-" "bridging, Network Bridging]." msgstr "" "Для получения дополнительной информации о мостах см. crossref:advanced-" "networking[network-bridging, Сетевые мосты]." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1090 msgid "The next step is to create the jail as indicated above." msgstr "Следующий шаг — создать клетку, как указано выше." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1094 msgid "" "Either the crossref:jails[classic-jail, Classic Jail (Thick Jail)] procedure " "or the crossref:jails[thin-jail, Thin Jails] procedure can be used. The " "only thing that will change is the configuration in the [.filename]#/etc/" "jail.conf# file." msgstr "" "Можно использовать как процедуру crossref:jails[classic-jail, Классической " "Клетки (Толстой клетки)], так и процедуру crossref:jails[thin-jail, Тонких " "Клеток]. Единственное, что изменится — это конфигурация в файле [.filename]#/" "etc/jail.conf#." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1096 msgid "" "The path [.filename]#/usr/local/jails/containers/vnet# will be used as an " "example for the created jail." msgstr "" "В качестве примера для созданной клетки будет использоваться путь " "[.filename]#/usr/local/jails/containers/vnet#." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1098 msgid "The following is an example configuration for a VNET jail:" msgstr "Вот пример конфигурации для VNET-клетки:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1104 #, no-wrap msgid "" "vnet {\n" " # STARTUP/LOGGING\n" " exec.consolelog = \"/var/log/jail_console_${name}.log\";\n" msgstr "" "vnet {\n" " # STARTUP/LOGGING\n" " exec.consolelog = \"/var/log/jail_console_${name}.log\";\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1110 #, no-wrap msgid "" " # PERMISSIONS\n" " allow.raw_sockets;\n" " exec.clean;\n" " mount.devfs;\n" " devfs_ruleset = 5;\n" msgstr "" " # PERMISSIONS\n" " allow.raw_sockets;\n" " exec.clean;\n" " mount.devfs;\n" " devfs_ruleset = 5;\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1114 #, no-wrap msgid "" " # PATH/HOSTNAME\n" " path = \"/usr/local/jails/containers/${name}\";\n" " host.hostname = \"${name}\";\n" msgstr "" " # PATH/HOSTNAME\n" " path = \"/usr/local/jails/containers/${name}\";\n" " host.hostname = \"${name}\";\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1118 #, no-wrap msgid "" " # VNET/VIMAGE\n" " vnet;\n" " vnet.interface = \"${epair}b\";\n" msgstr "" " # VNET/VIMAGE\n" " vnet;\n" " vnet.interface = \"${epair}b\";\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1125 #, no-wrap msgid "" " # NETWORKS/INTERFACES\n" " $id = \"154\"; <.>\n" " $ip = \"192.168.1.${id}/24\";\n" " $gateway = \"192.168.1.1\";\n" " $bridge = \"bridge0\"; <.>\n" " $epair = \"epair${id}\";\n" msgstr "" " # NETWORKS/INTERFACES\n" " $id = \"154\"; <.>\n" " $ip = \"192.168.1.${id}/24\";\n" " $gateway = \"192.168.1.1\";\n" " $bridge = \"bridge0\"; <.>\n" " $epair = \"epair${id}\";\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1137 #, no-wrap msgid "" " # ADD TO bridge INTERFACE\n" " exec.prestart = \"/sbin/ifconfig ${epair} create up\";\n" " exec.prestart += \"/sbin/ifconfig ${epair}a up descr jail:${name}\";\n" " exec.prestart += \"/sbin/ifconfig ${bridge} addm ${epair}a up\";\n" " exec.start += \"/sbin/ifconfig ${epair}b ${ip} up\";\n" " exec.start += \"/sbin/route add default ${gateway}\";\n" " exec.start += \"/bin/sh /etc/rc\";\n" " exec.stop = \"/bin/sh /etc/rc.shutdown\";\n" " exec.poststop = \"/sbin/ifconfig ${bridge} deletem ${epair}a\";\n" " exec.poststop += \"/sbin/ifconfig ${epair}a destroy\";\n" "}\n" msgstr "" " # ADD TO bridge INTERFACE\n" " exec.prestart = \"/sbin/ifconfig ${epair} create up\";\n" " exec.prestart += \"/sbin/ifconfig ${epair}a up descr jail:${name}\";\n" " exec.prestart += \"/sbin/ifconfig ${bridge} addm ${epair}a up\";\n" " exec.start += \"/sbin/ifconfig ${epair}b ${ip} up\";\n" " exec.start += \"/sbin/route add default ${gateway}\";\n" " exec.start += \"/bin/sh /etc/rc\";\n" " exec.stop = \"/bin/sh /etc/rc.shutdown\";\n" " exec.poststop = \"/sbin/ifconfig ${bridge} deletem ${epair}a\";\n" " exec.poststop += \"/sbin/ifconfig ${epair}a destroy\";\n" "}\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1140 msgid "" "A per-jail *unique* number used to derive both the epair device name (`epair$" "{id}`) and the last octet of the jail's address (`192.168.1.${id}`); give " "each jail on the bridge a different value." msgstr "" "Номер, *уникальный* для каждой клетки, используемый для получения как имени " "устройства epair (`epair${id}`), так и последнего октета адреса клетки " "(`192.168.1.${id}`); присвойте каждой клетке на мосту различное значение." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1141 msgid "Refers to the bridge created previously." msgstr "Относится к ранее созданному мосту." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1145 msgid "" "The `vnet.interface` parameter names the interface that man:jail[8] moves " "into the jail's network stack once the jail is created, here the jail side " "of the epair, `${epair}b`. That interface disappears from the host while " "the jail runs and is automatically released back to the host when the jail " "stops. A physical network card or an SR-IOV virtual function can be handed " "to a jail the same way, giving it dedicated networking without a bridge or " "an epair." msgstr "" "Параметр `vnet.interface` задает имя интерфейса, который man:jail[8] " "перемещает в сетевой стек клетки после ее создания, здесь это сторона epair, " "относящаяся к клетке, `${epair}b`. Этот интерфейс исчезает с хоста, пока " "клетка работает, и автоматически возвращается хосту при остановке клетки. " "Физическая сетевая карта или виртуальная функция SR-IOV могут быть переданы " "клетке таким же образом, обеспечивая ей выделенную сеть без моста или epair." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1149 msgid "" "The `devfs_ruleset = 5` line applies the `devfsrules_jail_vnet` ruleset from " "[.filename]#/etc/defaults/devfs.rules#, which extends the default jail " "ruleset by exposing [.filename]#/dev/pf#. A VNET jail can therefore run its " "own man:pf[4] firewall with `pf_enable=\"YES\"` and a private " "[.filename]#pf.conf#, independent of the host. See crossref:jails[jail-conf-" "devfs, Devfs Rulesets] for how rulesets are defined and " "crossref:firewalls[firewalls, Firewalls] for pf itself." msgstr "" "Строка `devfs_ruleset = 5` применяет набор правил `devfsrules_jail_vnet` из " "[.filename]#/etc/defaults/devfs.rules#, который расширяет стандартный набор " "правил для клеток, открывая доступ к [.filename]#/dev/pf#. Таким образом, " "клетка VNET может запускать собственный межсетевой экран man:pf[4] с " "`pf_enable=\"YES\"` и приватным [.filename]#pf.conf#, независимым от хоста. " "Смотрите crossref:jails[jail-conf-devfs, Devfs Rulesets] для описания " "определений наборов правил и crossref:firewalls[firewalls, Firewalls] для " "информации о самом pf." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1151 #, no-wrap msgid "Automating VNET Networking with jib" msgstr "Автоматизация сети VNET с помощью jib" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1155 msgid "" "Wiring up an epair and attaching it to the bridge by hand in `exec.prestart` " "and `exec.poststop`, as shown above, becomes tedious across many jails. The " "base system ships a helper script, [.filename]#/usr/share/examples/jails/" "jib#, that performs the same plumbing automatically." msgstr "" "Настройка epair и подключение его к мосту вручную в `exec.prestart` и " "`exec.poststop`, как показано выше, становится утомительной при большом " "количестве клеток. В базовой системе есть вспомогательный скрипт, " "[.filename]#/usr/share/examples/jails/jib#, который выполняет ту же самую " "настройку автоматически." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1157 msgid "" "Reference it from the jail's hooks instead of the five hand-rolled " "man:ifconfig[8] lines:" msgstr "" "Ссылайтесь на него из хуков клетки вместо пяти самодельных строк " "man:ifconfig[8]:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1162 #, no-wrap msgid "" " exec.prestart += \"jib addm ${name} em0\";\n" " exec.poststop += \"jib destroy ${name}\";\n" msgstr "" " exec.prestart += \"jib addm ${name} em0\";\n" " exec.poststop += \"jib destroy ${name}\";\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1164 #, no-wrap msgid " vnet.interface = \"e0b_${name}\";\n" msgstr " vnet.interface = \"e0b_${name}\";\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1170 msgid "" "`jib addm` creates an epair whose host side is named `e0a_` and whose " "jail side is `e0b_`, then attaches the host side to a bridge that it " "creates automatically, named after the member interface (for `em0` the " "bridge is `em0bridge`). Name that jail side in `vnet.interface`. When the " "jail stops, `jib destroy` removes the epair. The script also provides a " "`jib show` subcommand to list the interfaces it manages." msgstr "" "`jib addm` создает epair, чья сторона хоста называется `e0a_`, а " "сторона клетки — `e0b_`, затем присоединяет сторону хоста к мосту, " "который он создает автоматически, названному в честь интерфейса-члена (для " "`em0` мост называется `em0bridge`). Укажите эту сторону клетки в " "`vnet.interface`. Когда клетка останавливается, `jib destroy` удаляет epair. " "Скрипт также предоставляет подкоманду `jib show` для вывода списка " "интерфейсов, которыми он управляет." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1172 #, no-wrap msgid "Netgraph VNET Networking with jng" msgstr "Сетевые взаимодействия Netgraph VNET с помощью jng" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1176 msgid "" "The third networking mode mentioned in the crossref:jails[jails-networking, " "Networking] overview uses man:netgraph[4] instead of man:bridge[4] and " "epair. The base system ships a second helper, [.filename]#/usr/share/" "examples/jails/jng#, that builds an `ng_bridge` connected to an `ng_eiface` " "for each jail:" msgstr "" "Третий режим работы сети, упомянутый в обзоре crossref:jails[jails-" "networking, Сеть], использует man:netgraph[4] вместо man:bridge[4] и epair. " "В базовой системе поставляется второй вспомогательный скрипт, [.filename]#/" "usr/share/examples/jails/jng#, который создает `ng_bridge`, подключенный к " "`ng_eiface` для каждой клетки:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1181 #, no-wrap msgid "" " exec.prestart += \"jng bridge ${name} em0\";\n" " exec.poststop += \"jng shutdown ${name}\";\n" msgstr "" " exec.prestart += \"jng bridge ${name} em0\";\n" " exec.poststop += \"jng shutdown ${name}\";\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1183 #, no-wrap msgid " vnet.interface = \"ng0_${name}\";\n" msgstr " vnet.interface = \"ng0_${name}\";\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1187 msgid "" "`jng bridge` creates the netgraph nodes and a jail-side interface named " "`ng0_`, which is named in `vnet.interface`; `jng shutdown` tears the " "topology down when the jail stops. The result is functionally equivalent to " "the epair-and-bridge setup, but built on netgraph nodes rather than " "man:bridge[4]." msgstr "" "`jng bridge` создает узлы netgraph и интерфейс на стороне клетки с именем " "`ng0_`, который указывается в `vnet.interface`; `jng shutdown` " "разрушает топологию при остановке клетки. Результат функционально " "эквивалентен настройке с epair и bridge, но построен на узлах netgraph, а не " "на man:bridge[4]." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1189 #, no-wrap msgid "Running a Firewall and DHCP inside a VNET Jail" msgstr "Запуск межсетевого экрана и DHCP внутри клетки VNET" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1193 msgid "" "Because `devfs_ruleset = 5` exposes [.filename]#/dev/pf#, a VNET jail can " "run its own firewall. Enable it inside the jail exactly as on any host, " "with `pf_enable=\"YES\"` in the jail's [.filename]#/etc/rc.conf# and its own " "[.filename]#/etc/pf.conf#." msgstr "" "Поскольку `devfs_ruleset = 5` открывает доступ к [.filename]#/dev/pf#, " "клетка VNET может запускать собственный межсетевой экран. Включите его " "внутри клетки точно так же, как на любом хосте, с помощью " "`pf_enable=\"YES\"` в [.filename]#/etc/rc.conf# клетки и её собственном " "[.filename]#/etc/pf.conf#." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1197 msgid "" "Ruleset 5 does not expose [.filename]#/dev/bpf#, however. A VNET jail that " "obtains its address over DHCP, for example with " "`ifconfig_e0b_myjail=\"SYNCDHCP\"` in its [.filename]#/etc/rc.conf#, runs " "man:dhclient[8], which needs bpf and therefore fails under ruleset 5. " "Following the recipe in crossref:jails[jail-conf-devfs,Devfs Rulesets], " "define a custom ruleset in [.filename]#/etc/devfs.rules# that starts from " "`devfsrules_jail_vnet` and additionally unhides the bpf devices:" msgstr "" "Однако правила набора 5 не открывают доступ к [.filename]#/dev/bpf#. Клетка " "VNET, которая получает свой адрес через DHCP, например, с помощью " "`ifconfig_e0b_myjail=\"SYNCDHCP\"` в её [.filename]#/etc/rc.conf#, запускает " "man:dhclient[8], которому требуется bpf, и поэтому он терпит неудачу при " "использовании набора правил 5. Следуя рецепту из crossref:jails[jail-conf-" "devfs,Devfs Rulesets], определите собственный набор правил в [.filename]#/" "etc/devfs.rules#, который начинается с `devfsrules_jail_vnet` и " "дополнительно открывает устройства bpf:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1203 #, no-wrap msgid "" "[devfsrules_jail_vnet_dhcp=101]\n" "add include $devfsrules_jail_vnet\n" "add path 'bpf*' unhide\n" msgstr "" "[devfsrules_jail_vnet_dhcp=101]\n" "add include $devfsrules_jail_vnet\n" "add path 'bpf*' unhide\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1206 msgid "" "After running `service devfs restart` on the host, point the jail at the new " "ruleset with `devfs_ruleset = 101;`." msgstr "" "После выполнения `service devfs restart` на хосте, укажите клетке на новый " "набор правил с помощью `devfs_ruleset = 101;`." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1214 msgid "" "FreeBSD can run a Linux userland inside a jail using " "crossref:linuxemu[linuxemu,Linux Binary Compatibility] and package:sysutils/" "debootstrap[]. Jails do not have a kernel. They run on the host's kernel. " "Therefore it is necessary to enable Linux Binary Compatibility in the host " "system." msgstr "" "FreeBSD может запускать пользовательские программы Linux внутри клетки, " "используя crossref:linuxemu[linuxemu, Двоичную совместимость с Linux] и " "package:sysutils/debootstrap[]. Клетки не имеют собственного ядра. Они " "работают на ядре хоста. Поэтому необходимо включить Двоичную совместимость с " "Linux в хост-системе." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1216 msgid "To enable the Linux ABI at boot time, execute the following command:" msgstr "Чтобы включить ABI Linux при загрузке, выполните следующую команду:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1220 #, no-wrap msgid "# sysrc linux_enable=\"YES\"\n" msgstr "# sysrc linux_enable=\"YES\"\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1223 msgid "" "Once enabled, it can be started without rebooting by executing the following " "command:" msgstr "" "После включения его можно запустить без перезагрузки, выполнив следующую " "команду:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1227 #, no-wrap msgid "# service linux start\n" msgstr "# service linux start\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1231 msgid "" "The next step is to create a jail as indicated above, for example as in " "crossref:jails[creating-thin-jail-openzfs-snapshots, Creating a Thin Jail " "Using OpenZFS Snapshots], but *without* performing the configuration. " "FreeBSD Linux jails require a specific configuration that is detailed below." msgstr "" "Следующим шагом будет создание клетки, как указано выше, например, в разделе " "crossref:jails[creating-thin-jail-openzfs-snapshots, Создание тонкой клетки " "с использованием снимков OpenZFS], но *без* выполнения настройки. Клетки " "FreeBSD Linux требуют особой конфигурации, которая будет подробно описана " "ниже." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1233 msgid "" "If the host does not already have an [.filename]#/etc/jail.conf# — for " "example on a system whose jails so far have been created only from the " "command line — create an empty one so that man:service[8] can stop the jail " "later:" msgstr "" "Если на хосте ещё нет файла [.filename]#/etc/jail.conf# — например, в " "системе, где клетки до сих пор создавались только из командной строки, — " "создайте пустой файл, чтобы man:service[8] затем мог остановить клетку:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1237 #, no-wrap msgid "# touch /etc/jail.conf\n" msgstr "# touch /etc/jail.conf\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1241 msgid "" "The man:service[8] jail script reads [.filename]#/etc/jail.conf# when " "stopping a jail, so the stop command fails if the file does not exist. If " "an [.filename]#/etc/jail.conf# is already present from an earlier section, " "this step is not needed." msgstr "" "Скрипт man:service[8] jail читает [.filename]#/etc/jail.conf# при остановке " "клетки, поэтому команда остановки завершается ошибкой, если файл не " "существует. Если [.filename]#/etc/jail.conf# уже присутствует из предыдущего " "раздела, этот шаг не требуется." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1244 msgid "" "The following man:jail[8] command performs the required configuration for " "the jail and starts it directly, without a [.filename]#/etc/jail.conf# " "entry. The `-c` flag creates a new jail and `-m` modifies an existing one; " "combined as `-cm`, man:jail[8] creates the jail if it does not yet exist and " "updates it if it does:" msgstr "" "Следующая команда man:jail[8] выполняет необходимую настройку для клетки и " "запускает её напрямую, без записи в [.filename]#/etc/jail.conf#. Флаг `-c` " "создаёт новую клетку, а `-m` изменяет существующую; в сочетании как `-cm`, " "man:jail[8] создаёт клетку, если она ещё не существует, и обновляет её, если " "она существует:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1265 #, no-wrap msgid "" "# jail -cm \\\n" " name=ubuntu \\\n" " host.hostname=\"ubuntu.example.com\" \\\n" " path=\"/usr/local/jails/containers/ubuntu\" \\\n" " interface=\"em0\" \\\n" " ip4.addr=\"192.168.1.155\" \\\n" " exec.start=\"/bin/sh /etc/rc\" \\\n" " exec.stop=\"/bin/sh /etc/rc.shutdown\" \\\n" " mount.devfs \\\n" " devfs_ruleset=4 \\\n" " allow.mount \\\n" " allow.mount.devfs \\\n" " allow.mount.fdescfs \\\n" " allow.mount.procfs \\\n" " allow.mount.linprocfs \\\n" " allow.mount.linsysfs \\\n" " allow.mount.tmpfs \\\n" " enforce_statfs=1\n" msgstr "" "# jail -cm \\\n" " name=ubuntu \\\n" " host.hostname=\"ubuntu.example.com\" \\\n" " path=\"/usr/local/jails/containers/ubuntu\" \\\n" " interface=\"em0\" \\\n" " ip4.addr=\"192.168.1.155\" \\\n" " exec.start=\"/bin/sh /etc/rc\" \\\n" " exec.stop=\"/bin/sh /etc/rc.shutdown\" \\\n" " mount.devfs \\\n" " devfs_ruleset=4 \\\n" " allow.mount \\\n" " allow.mount.devfs \\\n" " allow.mount.fdescfs \\\n" " allow.mount.procfs \\\n" " allow.mount.linprocfs \\\n" " allow.mount.linsysfs \\\n" " allow.mount.tmpfs \\\n" " enforce_statfs=1\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1268 msgid "Access the newly created jail as `root` with man:jexec[8]:" msgstr "" "Получите доступ к вновь созданной клетке как `root` с помощью man:jexec[8]:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1272 #, no-wrap msgid "# jexec -u root ubuntu sh\n" msgstr "# jexec -u root ubuntu sh\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1277 msgid "" "Inside the jail, install package:sysutils/debootstrap[] and use it to build " "the Ubuntu userland under [.filename]#/compat/ubuntu#. package:sysutils/" "debootstrap[] is the tool that builds the Linux userland; it is not required " "to enter the jail afterward. Running man:pkg[7] for the first time " "bootstraps it automatically:" msgstr "" "Внутри клетки установите package:sysutils/debootstrap[] и используйте его " "для сборки пользовательского окружения Ubuntu в [.filename]#/compat/ubuntu#. " "package:sysutils/debootstrap[] — это инструмент, который собирает " "пользовательское окружение Linux; после этого он не требуется для входа в " "клетку. Первый запуск man:pkg[7] автоматически выполняет его начальную " "настройку:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1282 #, no-wrap msgid "" "# pkg install debootstrap\n" "# debootstrap jammy /compat/ubuntu\n" msgstr "" "# pkg install debootstrap\n" "# debootstrap jammy /compat/ubuntu\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1286 msgid "" "`jammy` selects Ubuntu 22.04 LTS. A newer LTS such as `noble` (Ubuntu " "24.04) can be selected instead, provided it runs under the linuxulator." msgstr "" "`jammy` выбирает Ubuntu 22.04 LTS. Можно выбрать более новую LTS, например " "`noble` (Ubuntu 24.04), при условии, что она работает в linuxulator." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1289 msgid "" "When the process has finished and the message `Base system installed " "successfully` is displayed on the console, stop the jail from the host " "system. Because this jail is not enabled in [.filename]#/etc/rc.conf# and " "not yet listed in [.filename]#/etc/jail.conf#, use the `one`-prefixed " "man:service[8] action, which runs even for a jail that is not enabled:" msgstr "" "Когда процесс завершится и на консоли появится сообщение `Base system " "installed successfully`, из хост-системы остановите клетку. Так как эта " "клетка не активирована в [.filename]#/etc/rc.conf# и еще не перечислена в " "[.filename]#/etc/jail.conf#, используйте действие man:service[8] с префиксом " "`one`, которое запускает клетки, которые не активированы:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1293 #, no-wrap msgid "# service jail onestop ubuntu\n" msgstr "# service jail onestop ubuntu\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1296 msgid "" "The `onestart` and `onestop` actions are the counterparts of `start` and " "`stop` for jails that are not enabled through `jail_enable` or listed in " "`jail_list`." msgstr "" "Действия `onestart` и `onestop` являются аналогами `start` и `stop` для " "клеток, которые не включены через `jail_enable` или не перечислены в " "`jail_list`." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1298 msgid "Then add an entry in [.filename]#/etc/jail.conf# for the Linux jail:" msgstr "" "Затем добавьте запись в [.filename]#/etc/jail.conf# для Linux-контейнера:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1306 #, no-wrap msgid "" "ubuntu {\n" " # STARTUP/LOGGING\n" " exec.start = \"/bin/sh /etc/rc\";\n" " exec.stop = \"/bin/sh /etc/rc.shutdown\";\n" " exec.consolelog = \"/var/log/jail_console_${name}.log\";\n" msgstr "" "ubuntu {\n" " # STARTUP/LOGGING\n" " exec.start = \"/bin/sh /etc/rc\";\n" " exec.stop = \"/bin/sh /etc/rc.shutdown\";\n" " exec.consolelog = \"/var/log/jail_console_${name}.log\";\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1312 #, no-wrap msgid "" " # PERMISSIONS\n" " allow.raw_sockets;\n" " exec.clean;\n" " mount.devfs;\n" " devfs_ruleset = 4;\n" msgstr "" " # PERMISSIONS\n" " allow.raw_sockets;\n" " exec.clean;\n" " mount.devfs;\n" " devfs_ruleset = 4;\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1320 #, no-wrap msgid "" " # NETWORK\n" " ip4.addr = 192.168.1.155;\n" " interface = em0;\n" msgstr "" " # NETWORK\n" " ip4.addr = 192.168.1.155;\n" " interface = em0;\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1330 #, no-wrap msgid "" " # MOUNT\n" " mount += \"devfs $path/compat/ubuntu/dev devfs rw 0 0\";\n" " mount += \"tmpfs $path/compat/ubuntu/dev/shm tmpfs rw,size=1g,mode=1777 0 0\";\n" " mount += \"fdescfs $path/compat/ubuntu/dev/fd fdescfs rw,linrdlnk 0 0\";\n" " mount += \"linprocfs $path/compat/ubuntu/proc linprocfs rw 0 0\";\n" " mount += \"linsysfs $path/compat/ubuntu/sys linsysfs rw 0 0\";\n" " mount += \"/tmp $path/compat/ubuntu/tmp nullfs rw 0 0\";\n" " mount += \"/home $path/compat/ubuntu/home nullfs rw 0 0\";\n" "}\n" msgstr "" " # MOUNT\n" " mount += \"devfs $path/compat/ubuntu/dev devfs rw 0 0\";\n" " mount += \"tmpfs $path/compat/ubuntu/dev/shm tmpfs rw,size=1g,mode=1777 0 0\";\n" " mount += \"fdescfs $path/compat/ubuntu/dev/fd fdescfs rw,linrdlnk 0 0\";\n" " mount += \"linprocfs $path/compat/ubuntu/proc linprocfs rw 0 0\";\n" " mount += \"linsysfs $path/compat/ubuntu/sys linsysfs rw 0 0\";\n" " mount += \"/tmp $path/compat/ubuntu/tmp nullfs rw 0 0\";\n" " mount += \"/home $path/compat/ubuntu/home nullfs rw 0 0\";\n" "}\n" #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1337 msgid "" "The jail can also present a specific Linux kernel identity to the programs " "running inside it. The `linux` parameter selects whether the jail inherits " "the host's Linux emulation environment (`inherit`) or gets its own (`new`), " "and `linux.osname`, `linux.osrelease`, and `linux.oss_version` set the OS " "name, release, and OSS version that Linux binaries see. For example, " "`linux.osrelease=6.1.0` makes man:uname[1] and version-checking Linux " "programs inside the jail report that kernel release instead of the host-wide " "`compat.linux.osrelease` value." msgstr "" "Клетка также может представлять конкретную идентичность ядра Linux " "программам, работающим внутри неё. Параметр `linux` выбирает, наследует ли " "клетка среду эмуляции Linux хост-системы (`inherit`) или получает " "собственную (`new`), а `linux.osname`, `linux.osrelease` и " "`linux.oss_version` задают имя ОС, релиз и версию OSS, которые видят " "бинарные файлы Linux. Например, `linux.osrelease=6.1.0` заставляет " "man:uname[1] и проверяющие версию программы Linux внутри клетки сообщать " "указанный релиз ядра вместо значения `compat.linux.osrelease` для всей хоста-" "системы." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1340 msgid "Then the jail can be started as usual with the following command:" msgstr "Затем клетку можно запустить как обычно с помощью следующей команды:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1344 #, no-wrap msgid "# service jail start ubuntu\n" msgstr "# service jail start ubuntu\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1347 msgid "The Ubuntu environment can be accessed using the following command:" msgstr "Окружение Ubuntu можно запустить с помощью следующей команды:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1351 #, no-wrap msgid "# jexec ubuntu chroot /compat/ubuntu /bin/bash\n" msgstr "# jexec ubuntu chroot /compat/ubuntu /bin/bash\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1354 msgid "" "More information can be found in the chapter " "crossref:linuxemu[linuxemu,Linux Binary Compatibility]." msgstr "" "Дополнительную информацию можно найти в главе crossref:linuxemu[linuxemu, " "Двоичная совместимость с Linux]." #. type: Title == #: documentation/content/en/books/handbook/jails/_index.adoc:1356 #, no-wrap msgid "NAT and Port Forwarding for Jails" msgstr "NAT и перенаправление портов для клеток" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1360 msgid "" "A jail that is given a private address — on a cloned man:lo[4] interface " "such as `lo1`, on a private bridge, or on a VNET epair on an internal " "network — has no route to the internet of its own. The host must translate " "the jail's traffic to a routable address, and, to reach a service running " "inside such a jail from outside, redirect incoming connections to the jail." msgstr "" "Клетка, которой присвоен частный адрес — на клонированном интерфейсе " "man:lo[4], таком как `lo1`, на частном мосту или на VNET epair во внутренней " "сети, — не имеет собственного маршрута в интернет. Хост должен транслировать " "трафик клетки в маршрутизируемый адрес, а для доступа к службе, работающей " "внутри такой клетки, извне — перенаправлять входящие соединения на клетку." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1363 msgid "" "First, allow the host to forward packets between its interfaces. Enable it " "at boot and immediately with the following commands:" msgstr "" "Сначала разрешите хосту пересылать пакеты между его интерфейсами. Включите " "это при загрузке и немедленно с помощью следующих команд:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1368 #, no-wrap msgid "" "# sysrc gateway_enable=\"YES\"\n" "# sysctl net.inet.ip.forwarding=1\n" msgstr "" "# sysrc gateway_enable=\"YES\"\n" "# sysctl net.inet.ip.forwarding=1\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1371 msgid "" "For IPv6, use `ipv6_gateway_enable=\"YES\"` and `net.inet6.ip6.forwarding=1`." msgstr "" "Для IPv6 используйте `ipv6_gateway_enable=\"YES\"` и " "`net.inet6.ip6.forwarding=1`." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1374 msgid "" "Then configure Network Address Translation on the host with man:pf[4]. The " "following [.filename]#/etc/pf.conf# gives every jail on the private " "`192.168.0.0/24` network outbound access through the host's external " "interface `em0`, and publishes a jailed web server on the host's port 80:" msgstr "" "Затем настройте трансляцию сетевых адресов на хосте с помощью man:pf[4]. " "Следующий [.filename]#/etc/pf.conf# предоставляет каждой клетке в частной " "сети `192.168.0.0/24` исходящий доступ через внешний интерфейс хоста `em0` и " "публикует веб-сервер внутри клетки на порту 80 хоста:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1378 #, no-wrap msgid "ext_if = \"em0\"\n" msgstr "ext_if = \"em0\"\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1381 #, no-wrap msgid "" "# Translate outbound jail traffic to the host address\n" "nat on $ext_if from 192.168.0.0/24 to any -> ($ext_if)\n" msgstr "" "# Translate outbound jail traffic to the host address\n" "nat on $ext_if from 192.168.0.0/24 to any -> ($ext_if)\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1384 #, no-wrap msgid "" "# Forward inbound web traffic to the jailed server\n" "rdr on $ext_if proto tcp to port 80 -> 192.168.0.151\n" msgstr "" "# Forward inbound web traffic to the jailed server\n" "rdr on $ext_if proto tcp to port 80 -> 192.168.0.151\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1387 msgid "The `rdr` target must be the jail's own address." msgstr "Цель `rdr` должна быть собственным адресом клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1389 msgid "Enable and start man:pf[4] with the following commands:" msgstr "Активируйте и запустите man:pf[4] с помощью следующей команды:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1394 #, no-wrap msgid "" "# sysrc pf_enable=\"YES\"\n" "# service pf start\n" msgstr "" "# sysrc pf_enable=\"YES\"\n" "# service pf start\n" #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1400 msgid "" "FreeBSD 15.0 adds the OpenBSD-style inline `nat-to` and `rdr-to` syntax, " "which attaches translation to a `pass` or `match` rule, for example `match " "out on $ext_if from 192.168.0.0/24 to any nat-to ($ext_if)`. The classic " "`nat on` and `rdr on` rules shown above work on both FreeBSD 14.x and 15.x." msgstr "" "FreeBSD 15.0 добавляет синтаксис в стиле OpenBSD для встроенных `nat-to` и " "`rdr-to`, который привязывает трансляцию к правилу `pass` или `match`, " "например `match out on $ext_if from 192.168.0.0/24 to any nat-to ($ext_if)`. " "Классические правила `nat on` и `rdr on`, показанные выше, работают как на " "FreeBSD 14.x, так и на 15.x." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1403 msgid "" "For the full treatment of man:pf[4] and man:ipfw[8], including complete rule " "sets and man:ipfw[8]-based NAT, see crossref:firewalls[firewalls,Firewalls]." msgstr "" "Для полного рассмотрения man:pf[4] и man:ipfw[8], включая полные наборы " "правил и NAT на основе man:ipfw[8], см. " "crossref:firewalls[firewalls,Межсетевые экраны]." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1413 msgid "" "Service jails are available since FreeBSD 15.0. A service jail is " "configured completely via [.filename]#/etc/rc.conf# or man:sysrc[8]. The " "base system services are service jails ready. They contain a config line " "which enables networking or lifts other restrictions of jails. Base system " "services which do not make sense to run inside jails are configured to not " "be started as a service jail, even if enabled in [.filename]#/etc/rc.conf#. " "Some examples of such a service are services which want to mount or unmount " "something in the start or stop method, or only configure something like a " "route, or firewall, or the like." msgstr "" "Сервисная клетка полностью настраивается через [.filename]#/etc/rc.conf# или " "man:sysrc[8]. Базовые системные сервисы готовы для работы в сервисных " "клетках. Они содержат строку конфигурации, которая включает сеть или снимает " "другие ограничения клеток. Базовые системные сервисы, которые не имеет " "смысла запускать внутри клеток, настроены так, чтобы не запускаться как " "сервисные клетки, даже если они включены в [.filename]#/etc/rc.conf#. " "Некоторые примеры таких сервисов — это сервисы, которые хотят монтировать " "или размонтировать что-то в методе start или stop, или только настраивают " "что-то, например маршрут, межсетевой экран или подобное." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1416 msgid "" "Third party services may or may not be service jails ready. To check if a " "service is service jail ready, the following command can be used:" msgstr "" "Сторонние службы могут быть или не быть готовы к использованию в сервисных " "клетках. Чтобы проверить, готова ли служба к работе в сервисной клетке, " "можно использовать следующую команду:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1420 #, no-wrap msgid "# grep _svcj_options /path/to/rc.d/servicename\n" msgstr "# grep _svcj_options /path/to/rc.d/servicename\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1423 msgid "" "If there is no output, the service is not service jail ready, or does not " "need any additional privileges like for example, network access." msgstr "" "Если вывод отсутствует, служба не готова к работе в клетке или не требует " "дополнительных привилегий, таких как, например, доступ к сети." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1425 msgid "" "If the service is not service jail ready, and needs network access, it can " "be made ready by adding the necessary config to [.filename]#/etc/rc.conf#:" msgstr "" "Если служба не готова к работе в клетке и требует доступа к сети, её можно " "подготовить, добавив необходимую конфигурацию в [.filename]#/etc/rc.conf#:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1429 #, no-wrap msgid "# sysrc servicename_svcj_options=net_basic\n" msgstr "# sysrc servicename_svcj_options=net_basic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1432 msgid "For all possible `_svcj_options` see the man:rc.conf[5] man-page." msgstr "" "Для всех возможных `_svcj_options` см. справочную страницу man:rc.conf[5]." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1435 msgid "" "To enable a service jail for a given service, the service needs to be " "stopped and the `servicename_svcj` variable needs to be set to YES. To put " "man:syslogd[8] into a service jail, use the following sequence of commands:" msgstr "" "Для включения сервисной клетки для указанной службы необходимо остановить " "службу и установить переменную `servicename_svcj` в значение YES. Чтобы " "поместить man:syslogd[8] в сервисную клетку, используйте следующую " "последовательность команд:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1441 #, no-wrap msgid "" "# service syslogd stop\n" "# sysrc syslogd_svcj=YES\n" "# service syslogd start\n" msgstr "" "# service syslogd stop\n" "# sysrc syslogd_svcj=YES\n" "# service syslogd start\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1445 msgid "" "If the `servicename_svcj` variable is changed, the service needs to be " "stopped before it is changed. If it is not stopped, the rc framework will " "not detect the correct state of the service and will not be able to do what " "is requested." msgstr "" "Если переменная `servicename_svcj` изменяется, службу необходимо остановить " "перед внесением изменений. Если она не будет остановлена, rc-фреймворк не " "определит корректное состояние службы и не сможет выполнить запрошенное " "действие." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1448 msgid "" "Service jails are managed only via man:rc.conf[5]/man:sysrc[8] and the " "man:service[8] command. The jail utilities, like man:jls[8] as described in " "crossref:jails[jail-management,Jail Management], can be used to investigate " "the operation, but the man:jail[8] command is not supposed to be used to " "manage them." msgstr "" "Сервисные клетки управляются только через man:rc.conf[5]/man:sysrc[8] и " "команду man:service[8]. Утилиты для работы с клетками, такие как man:jls[8], " "описанные в разделе crossref:jails[jail-management,Управление клетками], " "могут использоваться для проверки их работы, но команда man:jail[8] не " "предназначена для управления ими." #. type: Title == #: documentation/content/en/books/handbook/jails/_index.adoc:1450 #, no-wrap msgid "Jail Management" msgstr "Управление клетками" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1454 msgid "" "Once the jail is created, there are a number of operations that can be " "performed, like starting, rebooting or deleting the jail, installing " "software in it, etc. In this section the different actions that can be done " "with jails from the host will be described." msgstr "" "После создания клетки можно выполнить ряд операций, таких как запуск, " "перезагрузка или удаление клетки, установка программного обеспечения в неё и " "т.д. В этом разделе описаны различные действия, которые можно выполнять с " "клетками с хоста." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1456 #, no-wrap msgid "List Running Jails" msgstr "Список работающих клеток" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1459 msgid "" "To list the jails that are running on the host system, the command " "man:jls[8] can be used:" msgstr "" "Для вывода списка клеток, запущенных в хост-системе, можно использовать " "команду man:jls[8]:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1463 #, no-wrap msgid "# jls\n" msgstr "# jls\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1470 #, no-wrap msgid "" " JID IP Address Hostname Path\n" " 1 192.168.1.151 classic /usr/local/jails/containers/classic\n" msgstr "" " JID IP Address Hostname Path\n" " 1 192.168.1.151 classic /usr/local/jails/containers/classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1473 msgid "" "man:jls[8] supports the `--libxo` argument, which through the man:libxo[3] " "library allows other types of formats to be displayed, such as `JSON`, " "`HTML`, etc." msgstr "" "man:jls[8] поддерживает аргумент `--libxo`, который через библиотеку " "man:libxo[3] позволяет отображать данные в других форматах, таких как " "`JSON`, `HTML` и т.д." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1475 msgid "For example, execute the following command to get the `JSON` output:" msgstr "" "Например, выполните следующую команду для получения вывода в формате `JSON`:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1479 #, no-wrap msgid "# jls --libxo=json\n" msgstr "# jls --libxo=json\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1485 #, no-wrap msgid "{\"__version\": \"2\", \"jail-information\": {\"jail\": [{\"jid\":1,\"ipv4\":\"192.168.1.151\",\"hostname\":\"classic\",\"path\":\"/usr/local/jails/containers/classic\"}]}}\n" msgstr "{\"__version\": \"2\", \"jail-information\": {\"jail\": [{\"jid\":1,\"ipv4\":\"192.168.1.151\",\"hostname\":\"classic\",\"path\":\"/usr/local/jails/containers/classic\"}]}}\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1489 msgid "" "The default listing is only a small part of what man:jls[8] can report. Add " "the `-v` flag for a verbose, multi-line summary of each jail that includes " "its state and its assigned cpuset ID:" msgstr "" "Стандартный вывод является лишь малой частью того, что может сообщить " "man:jls[8]. Добавьте флаг `-v` для подробной многострочной сводки по каждой " "клетке, включающей её состояние и назначенный идентификатор набора " "процессоров (cpuset ID):" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1493 #, no-wrap msgid "# jls -v\n" msgstr "# jls -v\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1496 msgid "" "Use `-h` to print a header line with the field names above the values of the " "requested parameters:" msgstr "" "Используйте `-h` для вывода строки заголовка с названиями полей над " "значениями запрашиваемых параметров:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1500 #, no-wrap msgid "# jls -h jid name path\n" msgstr "# jls -h jid name path\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1503 msgid "" "To query specific parameters of a single jail, name it with `-j` and list " "the parameters to print:" msgstr "" "Чтобы запросить конкретные параметры одной клетки, укажите её с помощью `-j` " "и перечислите параметры для вывода:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1507 #, no-wrap msgid "# jls -j classic path host.hostname ip4.addr\n" msgstr "# jls -j classic path host.hostname ip4.addr\n" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1513 #, no-wrap msgid "/usr/local/jails/containers/classic classic 192.168.1.151\n" msgstr "/usr/local/jails/containers/classic classic 192.168.1.151\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1516 msgid "" "Add `-d` to include jails that are shutting down, which are otherwise hidden " "while in the dying state:" msgstr "" "Добавьте `-d`, чтобы включить клетки, которые завершают работу и в противном " "случае скрыты, пока находятся в состоянии завершения:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1520 #, no-wrap msgid "# jls -d\n" msgstr "# jls -d\n" #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1523 #, no-wrap msgid "Start, Restart, and Stop a Jail" msgstr "Запуск, перезапуск и остановка клетки" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1526 msgid "man:service[8] is used to start, reboot, or stop a jail on the host." msgstr "" "man:service[8] используется для запуска, перезагрузки или остановки клетки " "на хосте." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1528 msgid "For example, to start a jail, run the following command:" msgstr "Например, чтобы запустить клетку, выполните следующую команду:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1532 #, no-wrap msgid "# service jail start jailname\n" msgstr "# service jail start jailname\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1535 msgid "" "Change the `start` argument to `restart` or `stop` to perform other actions " "on the jail." msgstr "" "Измените аргумент `start` на `restart` или `stop`, чтобы выполнить другие " "действия с клеткой." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1542 msgid "" "Stopping a jail is more than killing the processes inside it. When a jail " "is stopped, man:jail[8] first runs the commands in its `exec.stop` parameter " "— typically `/bin/sh /etc/rc.shutdown` — inside the jail so that its " "services shut down cleanly. It then sends `SIGTERM` to any processes still " "running in the jail and waits up to `stop.timeout` seconds (10 by default) " "for them to exit. Once that time has passed, the jail is removed, which " "kills whatever remains with `SIGKILL`. If `stop.timeout` is set to zero, no " "`SIGTERM` is sent and the jail is removed immediately. This is why a jail " "with a slow-stopping daemon can appear to hang for ten seconds while it " "stops; raise `stop.timeout` in [.filename]#/etc/jail.conf# for a jail that " "runs a database or another service that needs longer to shut down gracefully." msgstr "" "Остановка клетки — это не просто завершение процессов внутри неё. Когда " "клетка останавливается, man:jail[8] сначала выполняет команды из её " "параметра `exec.stop` — обычно `/bin/sh /etc/rc.shutdown` — внутри клетки, " "чтобы её службы корректно завершились. Затем он отправляет `SIGTERM` всем " "процессам, всё ещё работающим в клетке, и ждёт до `stop.timeout` секунд (по " "умолчанию 10) их завершения. По истечении этого времени клетка удаляется, " "что завершает оставшиеся процессы сигналом `SIGKILL`. Если `stop.timeout` " "установлен в ноль, `SIGTERM` не отправляется, и клетка удаляется " "немедленно. Именно поэтому клетка с медленно останавливающимся демоном " "может казаться зависшей на десять секунд при остановке; увеличьте " "`stop.timeout` в [.filename]#/etc/jail.conf# для клетки, в которой работает " "база данных или другая служба, требующая больше времени для корректного " "завершения." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1544 #, no-wrap msgid "Destroy a Jail" msgstr "Удаление клетки" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1547 msgid "" "Destroying a jail is not as simple as stopping the jail using man:service[8] " "and removing the jail directory and [.filename]#/etc/jail.conf# entry." msgstr "" "Удаление клетки, это не просто остановка клетки с помощью man:service[8] и " "удаление каталога клетки и записи в [.filename]#/etc/jail.conf#." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1552 msgid "" "FreeBSD takes system security very seriously. For this reason there are " "certain files that not even the root user can delete. This functionality is " "known as File Flags. On a jail whose files live on a UFS file system, these " "flags must be cleared before the jail directory can be removed." msgstr "" "FreeBSD очень серьезно относится к безопасности системы. По этой причине " "существуют определённые файлы, которые не может удалить даже пользователь " "root. Эта функциональность называется Флаги Файлов. В клетках, чьи файлы " "находятся на файловой системе UFS, эти флаги должны быть очищены до удаление " "каталога клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1554 msgid "" "The first step is to stop the desired jail executing the following command:" msgstr "" "Первым шагом является остановка нужной клетки с помощью выполнения следующей " "команды:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1558 #, no-wrap msgid "# service jail stop classic\n" msgstr "# service jail stop classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1561 msgid "" "The second step is to remove these flags with man:chflags[1] by executing " "the following command, in which `classic` is the name of the jail to remove:" msgstr "" "Второй шаг — удалить эти флаги с помощью man:chflags[1], выполнив следующую " "команду, где `classic` — имя удаляемой клетки:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1565 #, no-wrap msgid "# chflags -R 0 /usr/local/jails/containers/classic\n" msgstr "# chflags -R 0 /usr/local/jails/containers/classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1568 msgid "The third step is to delete the directory where the jail was:" msgstr "Третий шаг — удалить каталог, в котором находилась клетка:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1572 #, no-wrap msgid "# rm -rf /usr/local/jails/containers/classic\n" msgstr "# rm -rf /usr/local/jails/containers/classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1577 msgid "" "The two steps above apply to a jail stored on a UFS file system. A jail " "backed by its own ZFS dataset — as created in crossref:jails[host-" "configuration-directories,Setting Up the Jail Directory Tree] — is removed " "by destroying the dataset instead. Dataset destruction is not blocked by " "file flags, so the man:chflags[1] step is unnecessary in this case:" msgstr "" "Два шага выше относятся к клетке, хранящейся в файловой системе UFS. Клетка, " "поддерживаемая собственным набором данных ZFS — как созданная в " "crossref:jails[host-configuration-directories,Настройка дерева каталогов " "клетки] — удаляется вместо этого путем уничтожения набора данных. " "Уничтожение набора данных не блокируется файловыми флагами, поэтому шаг с " "man:chflags[1] в этом случае не требуется:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1582 #, no-wrap msgid "" "# service jail stop classic\n" "# zfs destroy zroot/jails/containers/classic\n" msgstr "" "# service jail stop classic\n" "# zfs destroy zroot/jails/containers/classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1585 msgid "Add `-r` to also destroy any snapshots the dataset holds." msgstr "" "Добавьте `-r`, чтобы также уничтожить любые снимки, которые хранит набор " "данных." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1591 msgid "" "A ZFS thin jail created by cloning a template snapshot (see " "crossref:jails[thin-jail,Thin Jails]) depends on that snapshot. While any " "clone still exists, man:zfs[8] refuses to destroy the template snapshot and " "prints the list of dependent clones. To retire a template, first destroy " "every jail cloned from it, or run `zfs promote` on a clone so it no longer " "depends on the template." msgstr "" "Тонкая клетка на ZFS, созданная клонированием снимка шаблона (см. " "crossref:jails[thin-jail,Тонкие клетки]), зависит от этого снимка. Пока " "существует любой клон, man:zfs[8] отказывается уничтожать снимок шаблона и " "выводит список зависимых клонов. Чтобы удалить шаблон, сначала уничтожьте " "каждую клетку, клонированную из него, или выполните `zfs promote` на клоне, " "чтобы он больше не зависел от шаблона." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1595 msgid "" "Finally, in either case, remove the jail entry in [.filename]#/etc/" "jail.conf# or in [.filename]#/etc/jail.conf.d#. For a NullFS thin jail, " "also delete its [.filename]#.fstab# file and its now-empty mountpoint " "directory." msgstr "" "Наконец, в любом случае удалите запись клетки в [.filename]#/etc/jail.conf# " "или в [.filename]#/etc/jail.conf.d#. Для тонкой клетки NullFS также удалите " "её файл [.filename]#.fstab# и её теперь пустой каталог точки монтирования." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1597 #, no-wrap msgid "Handle Packages in a Jail" msgstr "Работа с пакетами в клетке" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1600 msgid "" "The man:pkg[8] tool supports the `-j` argument in order to handle packages " "installed inside the jail." msgstr "" "Утилита man:pkg[8] поддерживает аргумент `-j` для управления пакетами, " "установленными внутри клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1602 msgid "" "For example, to install package:www/nginx-lite[] in the jail, the next " "command can be executed *from the host*:" msgstr "" "Например, чтобы установить пакет package:www/nginx-lite[] в клетке, можно " "выполнить следующую команду *с хоста*:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1606 #, no-wrap msgid "# pkg -j classic install nginx-lite\n" msgstr "# pkg -j classic install nginx-lite\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1609 msgid "" "For more information on working with packages in FreeBSD, see " "crossref:ports[ports,\"Installing Applications: Packages and Ports\"]." msgstr "" "Для получения дополнительной информации о работе с пакетами в FreeBSD см. " "crossref:ports[ports,\"Установка приложений: Пакеты и порты\"]." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1611 #, no-wrap msgid "Managing Services in a Jail from the Host" msgstr "Управление службами в клетке с хост-системы" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1615 msgid "" "Services inside a jail can be enabled and controlled from the host without " "first entering the jail with man:jexec[8]. Both man:service[8] and " "man:sysrc[8] accept a `-j` argument that names the target jail by ID or name " "and operates on that jail's man:rc[8] configuration." msgstr "" "Службы внутри клетки можно включать и контролировать с хост-системы, не " "заходя сначала в клетку через man:jexec[8]. Как man:service[8], так и " "man:sysrc[8] принимают аргумент `-j`, который указывает целевую клетку по ID " "или имени и работает с конфигурацией man:rc[8] этой клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1617 msgid "" "Continuing the package example above, enable and start nginx in the " "`classic` jail directly from the host:" msgstr "" "Продолжая пример с пакетами выше, включите и запустите nginx в клетке " "`classic` непосредственно с хост-системы:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1622 #, no-wrap msgid "" "# sysrc -j classic nginx_enable=YES\n" "# service -j classic nginx start\n" msgstr "" "# sysrc -j classic nginx_enable=YES\n" "# service -j classic nginx start\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1625 msgid "" "These commands have the same effect as running man:sysrc[8] and " "man:service[8] through man:jexec[8], but they keep host-side administration " "and scripting uniform with an unjailed system." msgstr "" "Эти команды имеют тот же эффект, что и запуск man:sysrc[8] и man:service[8] " "через man:jexec[8], но они сохраняют единообразие администрирования и " "написания сценариев на стороне хост-системы с системой без клеток." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1627 #, no-wrap msgid "Access a Jail" msgstr "Доступ к клетке" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1630 msgid "" "While it has been stated above that it is best to manage jails from the host " "system, a jail can be entered with man:jexec[8]." msgstr "" "Как уже упоминалось выше, оптимальным является управление клетками из хост-" "системы, однако в клетку можно войти с помощью man:jexec[8]." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1632 msgid "The jail can be entered by running man:jexec[8] from the host:" msgstr "В клетку можно войти, выполнив man:jexec[8] с хоста:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1636 #, no-wrap msgid "# jexec -u root jailname\n" msgstr "# jexec -u root jailname\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1642 msgid "" "The `-u` flag selects the user to run as, resolving the name against the " "*host* password database. To resolve the user against the *jail's* own " "password database instead, use `-U`. When no command is given, as here, " "man:jexec[8] starts that user's login shell inside the jail. Add `-l` to " "run it in a clean login environment that keeps only `HOME`, `SHELL`, `TERM`, " "and `USER`, resets `PATH` to [.filename]#/bin:/usr/bin#, and behaves like a " "fresh login; `-d` sets the working directory, which defaults to the jail " "root." msgstr "" "Флаг `-u` выбирает пользователя, от имени которого выполняется команда, " "разрешая имя через базу данных паролей *хост-системы*. Чтобы разрешить " "пользователя через *собственную* базу данных паролей клетки, используйте `-" "U`. Если команда не задана, как в данном случае, man:jexec[8] запускает " "оболочку входа этого пользователя внутри клетки. Добавьте `-l`, чтобы " "запустить её в чистой среде входа, сохраняющей только `HOME`, `SHELL`, " "`TERM` и `USER`, сбрасывающей `PATH` на [.filename]#/bin:/usr/bin# и ведущей " "себя как новый вход; `-d` задаёт рабочую директорию, по умолчанию это корень " "клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1644 msgid "" "When gaining access to the jail, the message configured in man:motd[5] will " "be displayed." msgstr "" "При входе в клетку будет отображено сообщение, настроенное в man:motd[5]." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1646 #, no-wrap msgid "Execute Commands in a Jail" msgstr "Выполнение команд в клетке" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1649 msgid "" "To execute a command from the host system in a jail the man:jexec[8] can be " "used." msgstr "" "Для выполнения команды в клетке из хост-системы можно использовать " "man:jexec[8]." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1651 msgid "" "For example, to stop a service that is running inside a jail, the command " "will be executed:" msgstr "" "Например, чтобы остановить службу, работающую внутри клетки, будет выполнена " "команда:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1655 #, no-wrap msgid "# jexec -l jailname service nginx stop\n" msgstr "# jexec -l jailname service nginx stop\n" #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1658 #, no-wrap msgid "Viewing Jailed Processes and Sockets from the Host" msgstr "Просмотр процессов и сокетов в клетках с хост-системы" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1661 msgid "" "From the host, the processes and sockets of every jail are visible and can " "be filtered by jail." msgstr "" "С хост-системы процессы и сокеты каждой клетки видны и могут фильтроваться " "по клетке." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1663 msgid "" "man:ps[1] accepts `-J` to restrict its output to a single jail, given by JID " "or name:" msgstr "" "man:ps[1] принимает `-J` для ограничения своего вывода одной клеткой, " "заданной по JID или имени:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1667 #, no-wrap msgid "# ps -J classic\n" msgstr "# ps -J classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1670 msgid "" "The output should be similar to the following, where the `J` in the `STAT` " "column marks a process that is running in a jail:" msgstr "" "Вывод должен быть похож на следующий, где `J` в столбце `STAT` отмечает " "процесс, запущенный в клетке:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1675 #, no-wrap msgid "" " PID TT STAT TIME COMMAND\n" "2841 - IsJ 0:00.02 /usr/sbin/syslogd -ss\n" "2903 - IsJ 0:00.00 nginx: master process /usr/local/sbin/nginx\n" msgstr "" " PID TT STAT TIME COMMAND\n" "2841 - IsJ 0:00.02 /usr/sbin/syslogd -ss\n" "2903 - IsJ 0:00.00 nginx: master process /usr/local/sbin/nginx\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1680 msgid "" "Use `ps -J 0` to show only the host's own processes. The `jail` and `jid` " "keywords can also be added to the `-o` output format to show which jail each " "process belongs to. For example, to list every process on the host together " "with its jail:" msgstr "" "Используйте `ps -J 0`, чтобы показать только процессы самой хост-системы. " "Ключевые слова `jail` и `jid` также можно добавить в формат вывода `-o`, " "чтобы показать, к какой клетке относится каждый процесс. Например, чтобы " "вывести список всех процессов на хост-системе вместе с их клеткой:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1684 #, no-wrap msgid "# ps ax -o pid,jail,command\n" msgstr "# ps ax -o pid,jail,command\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1687 msgid "" "man:top[1] takes `-J` to filter its live display to one jail, which implies " "`-j` and adds the `JID` column:" msgstr "" "man:top[1] принимает `-J` для фильтрации своего живого отображения по одной " "клетке, что подразумевает `-j` и добавляет столбец `JID`:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1691 #, no-wrap msgid "# top -J classic\n" msgstr "# top -J classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1694 msgid "" "man:sockstat[1] lists the sockets belonging to a jail with `-j`, which is " "the natural way to check which ports a jail's daemons have actually bound " "after starting a service in it:" msgstr "" "man:sockstat[1] выводит список сокетов, принадлежащих клетке, с помощью `-" "j`, что является естественным способом проверить, какие порты демоны клетки " "фактически привязали после запуска в ней службы:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1698 #, no-wrap msgid "# sockstat -4 -6 -l -j classic\n" msgstr "# sockstat -4 -6 -l -j classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1701 msgid "" "From inside a jail the picture is reversed: a jailed process sees only its " "own jail's processes and sockets, never those of the host or of other jails." msgstr "" "Изнутри клетки картина обратная: процесс, заключенный в клетку, видит только " "процессы и сокеты своей собственной клетки и никогда не видит процессы или " "сокеты хоста или других клеток." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1703 #, no-wrap msgid "Managing Jails Directly with the jail Utility" msgstr "Управление клетками напрямую с помощью утилиты jail" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1706 msgid "" "The man:service[8] wrapper shown above is the usual way to run jails at " "boot, but man:jail[8] can also create, modify, and remove jails directly, " "which is useful for scripting and for testing a configuration without the rc " "framework." msgstr "" "Представленная выше обёртка man:service[8] — это обычный способ запуска " "клеток при загрузке, но man:jail[8] также может создавать, изменять и " "удалять клетки напрямую, что полезно для написания скриптов и тестирования " "конфигурации без фреймворка rc." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1708 msgid "Create a configured jail by name:" msgstr "Создайте настроенную клетку по имени:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1712 #, no-wrap msgid "# jail -c classic\n" msgstr "# jail -c classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1715 msgid "" "Remove a running jail; this also removes any child jails it created and " "kills the processes inside it:" msgstr "" "Удалите работающую клетку; это также удалит все дочерние клетки, которые она " "создала, и завершит процессы внутри неё:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1719 #, no-wrap msgid "# jail -r classic\n" msgstr "# jail -r classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1723 msgid "" "The `-m` flag modifies the parameters of an already-running jail without " "restarting it. For example, to add a second IPv4 address to a running jail:" msgstr "" "Флаг `-m` изменяет параметры уже запущенной клетки без её перезапуска. " "Например, чтобы добавить второй IPv4-адрес к запущенной клетке:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1727 #, no-wrap msgid "# jail -m name=classic ip4.addr+=192.168.250.71\n" msgstr "# jail -m name=classic ip4.addr+=192.168.250.71\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1730 msgid "" "man:jail[8] notes that \"Some parameters may not be changed on a running " "jail\"; in practice this includes `path` and `vnet`, which require the jail " "to be restarted." msgstr "" "man:jail[8] отмечает, что «некоторые параметры нельзя изменить в работающей " "клетке»; на практике это включает `path` и `vnet`, для изменения которых " "требуется перезапуск клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1733 msgid "" "Finally, `-e` exhibits all configured non-wildcard jails and their " "parameters without creating, modifying, or removing anything, which is handy " "for verifying a configuration file. It takes a string used to separate the " "parameters:" msgstr "" "Наконец, `-e` отображает все настроенные не-шаблонные клетки и их параметры " "без создания, изменения или удаления чего-либо, что удобно для проверки " "файла конфигурации. В качестве аргумента она принимает строку, используемую " "для разделения параметров:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1737 #, no-wrap msgid "# jail -e ,\n" msgstr "# jail -e ,\n" #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1740 #, no-wrap msgid "Backing Up and Migrating a Jail" msgstr "Резервное копирование и перенос клетки" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1743 msgid "" "A jail is largely self-contained, so backing one up or moving it to another " "host is mostly a matter of copying its files and its configuration." msgstr "" "Клетка в значительной степени самодостаточна, поэтому её резервное " "копирование или перенос на другой хост в основном сводится к копированию её " "файлов и её конфигурации." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1746 msgid "" "Stop the jail first for a consistent copy; a ZFS-backed jail can instead be " "snapshotted while running. For a jail on its own ZFS dataset, take a " "recursive snapshot and stream it to the destination host:" msgstr "" "Остановите клетку сначала для получения консистентной копии; клетку на " "основе ZFS можно вместо этого сделать снимок во время её работы. Для клетки " "на собственном наборе данных ZFS выполните рекурсивный снимок и передайте " "его на целевой хост:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1752 #, no-wrap msgid "" "# service jail stop classic\n" "# zfs snapshot -r zroot/jails/containers/classic@migrate\n" "# zfs send -R zroot/jails/containers/classic@migrate | ssh newhost zfs receive zroot/jails/containers/classic\n" msgstr "" "# service jail stop classic\n" "# zfs snapshot -r zroot/jails/containers/classic@migrate\n" "# zfs send -R zroot/jails/containers/classic@migrate | ssh newhost zfs receive zroot/jails/containers/classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1755 msgid "" "The full mechanics of man:zfs-send[8] and man:zfs-receive[8], including " "incremental transfers, are covered in crossref:zfs[zfs-zfs-send,Replication]." msgstr "" "Полная механика man:zfs-send[8] и man:zfs-receive[8], включая " "инкрементальные передачи, описана в crossref:zfs[zfs-zfs-send,Репликация]." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1757 msgid "" "For a jail on a UFS file system, use man:tar[1] with `-p` so that ownership, " "permissions, and file flags are preserved:" msgstr "" "Для клетки на файловой системе UFS используйте man:tar[1] с опцией `-p`, " "чтобы сохранить владельца, права доступа и флаги файлов:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1761 #, no-wrap msgid "# tar -cpf classic.tar -C /usr/local/jails/containers classic\n" msgstr "# tar -cpf classic.tar -C /usr/local/jails/containers classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1765 msgid "" "Extract the archive as `root` on the destination host with `tar -xpf` so the " "flags survive. man:dump[8] and man:restore[8] are an alternative when a " "jail occupies a dedicated UFS file system of its own; they operate on whole " "file systems, so they do not apply to the layout used in this chapter, where " "all jails are directories within one shared file system." msgstr "" "Извлеките архив как `root` на целевой системе с помощью `tar -xpf`, чтобы " "сохранились флаги. man:dump[8] и man:restore[8] являются альтернативой, " "когда клетка занимает выделенную файловую систему UFS; они работают с целыми " "файловыми системами, поэтому не применимы к структуре, используемой в этой " "главе, где все клетки являются каталогами в одной общей файловой системе." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1767 msgid "" "Finally, copy the jail's block from [.filename]#/etc/jail.conf# — or its " "file in [.filename]#/etc/jail.conf.d# — to the new host, adjust any host-" "specific parameters such as `interface`, `ip4.addr`, or the bridge used by a " "VNET jail, and start the jail there." msgstr "" "Наконец, скопируйте блок строк, относящихся к клетке, из [.filename]#/etc/" "jail.conf# — или его файл в [.filename]#/etc/jail.conf.d# — на новый хост, " "настройте любые параметры, специфичные для хоста, такие как `interface`, " "`ip4.addr` или мост, используемый клеткой VNET, и запустите клетку там." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1773 msgid "" "The destination host must not run an older FreeBSD release than the jail's " "userland, following the same rule that a jail can never run a newer version " "than its host. A NullFS thin jail is not self-contained: its template and " "skeleton must exist on the destination host too, so migrate those as well or " "convert the jail to a thick copy first. Any man:rctl[8] rules kept in " "[.filename]#/etc/rctl.conf# must be carried over separately." msgstr "" "Целевая хост-система не должна запускать более старую версию FreeBSD, чем " "пользовательское окружение клетки, следуя тому же правилу, что клетка " "никогда не может запускать более новую версию, чем её хост-система. Тонкая " "клетка на NullFS не является автономной: её шаблон и скелет также должны " "существовать на целевой хост-системе, поэтому перенесите и их, или сначала " "преобразуйте клетку в толстую копию. Любые правила man:rctl[8], хранящиеся в " "[.filename]#/etc/rctl.conf#, должны быть перенесены отдельно." #. type: Title == #: documentation/content/en/books/handbook/jails/_index.adoc:1776 #, no-wrap msgid "Administration from Inside a Jail" msgstr "Администрирование изнутри клетки" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1780 msgid "" "Most jail administration is done from the host, but some tasks are performed " "from within the jail itself, and a script running inside a jail sometimes " "needs to know that it is jailed. This section describes what an " "administrator sees and can do from inside a jail." msgstr "" "Большая часть администрирования клеток выполняется с хост-системы, но " "некоторые задачи выполняются изнутри самой клетки, и скрипт, запущенный " "внутри клетки, иногда должен знать, что он находится в клетке. В этом " "разделе описывается, что администратор видит и может делать изнутри клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1782 msgid "" "A process can detect whether it is running inside a jail by reading the " "`security.jail.jailed` sysctl, which is `1` inside a jail and `0` on the " "host:" msgstr "" "Процесс может определить, находится ли он внутри клетки, прочитав sysctl " "`security.jail.jailed`, который равен `1` внутри клетки и `0` на хост-" "системе:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1787 #, no-wrap msgid "" "# sysctl security.jail.jailed\n" "security.jail.jailed: 1\n" msgstr "" "# sysctl security.jail.jailed\n" "security.jail.jailed: 1\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1790 msgid "Inside a jail the environment is deliberately restricted:" msgstr "Внутри клетки окружение намеренно ограничено:" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1793 msgid "" "The host's view of the system is hidden. A jailed process sees only its own " "jail's processes, sockets, and file systems, never those of the host or of " "other jails." msgstr "" "Вид на хост-систему скрыт. Процесс, находящийся в клетке, видит только " "процессы, сокеты и файловые системы своей собственной клетки, но никогда не " "видит процессы, сокеты и файловые системы хост-системы или других клеток." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1795 msgid "" "Kernel state is largely read-only. Kernel tunables cannot be written from " "inside a jail, man:kldload[8] and man:kldunload[8] are not permitted, and " "man:dmesg[8] and the kernel message buffer are unavailable unless " "`allow.read_msgbuf` is set." msgstr "" "Состояние ядра в значительной степени доступно только для чтения. " "Настраиваемые параметры ядра не могут быть записаны изнутри клетки, " "man:kldload[8] и man:kldunload[8] не разрешены, а man:dmesg[8] и буфер " "сообщений ядра недоступны, если не установлен параметр `allow.read_msgbuf`." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1797 msgid "" "Privileged operations that would cross the jail boundary are denied unless " "the host explicitly allows them. Creating raw sockets — as man:ping[8] and " "man:traceroute[8] require — needs `allow.raw_sockets` (see the parameter " "description in crossref:jails[jail-configuration-files,Jail Configuration " "Files]), mounting file systems needs `allow.mount` and its per-filesystem " "children, and man:chflags[1] is disabled by default (see crossref:jails[jail-" "upgrading,Jail Upgrading])." msgstr "" "Привилегированные операции, которые пересекали бы границу клетки, запрещены, " "если только хост-система явно не разрешает их. Создание raw-сокетов — как " "того требуют man:ping[8] и man:traceroute[8] — требует `allow.raw_sockets` " "(см. описание параметра в разделе crossref:jails[jail-configuration-" "files,Файлы конфигурации клеток]), монтирование файловых систем требует " "`allow.mount` и его дочерних параметров для конкретных файловых систем, а " "man:chflags[1] по умолчанию отключен (см. crossref:jails[jail-" "upgrading,Обновление клеток])." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1800 msgid "" "A handful of per-jail sysctl variables can be changed from inside the jail " "without affecting the host, including `kern.hostname`, `kern.domainname`, " "`kern.hostid`, `kern.hostuuid`, `kern.securelevel`, and " "`security.bsd.suser_enabled`. The current set of available jail parameters " "can be listed with man:sysctl[8]:" msgstr "" "Горстка переменных sysctl, относящихся к каждой клетке, может быть изменена " "изнутри клетки без влияния на хост-систему, включая `kern.hostname`, " "`kern.domainname`, `kern.hostid`, `kern.hostuuid`, `kern.securelevel` и " "`security.bsd.suser_enabled`. Текущий набор доступных параметров клетки " "можно вывести с помощью man:sysctl[8]:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1804 #, no-wrap msgid "# sysctl -d security.jail.param\n" msgstr "# sysctl -d security.jail.param\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1808 msgid "" "Managing the jail's own services from inside works exactly as it does on an " "unjailed system: man:service[8] and man:sysrc[8] operate on the jail's own " "man:rc[8] configuration. This is the in-jail counterpart to the host-side " "crossref:jails[jail-services-host,service -j and sysrc -j] shown above." msgstr "" "Управление собственными службами клетки изнутри работает точно так же, как и " "в системе вне клетки: man:service[8] и man:sysrc[8] работают с собственной " "конфигурацией man:rc[8] клетки. Это внутриклеточный аналог показанных выше " "crossref:jails[jail-services-host,service -j и sysrc -j] из хост-системы." #. type: Title == #: documentation/content/en/books/handbook/jails/_index.adoc:1810 #, no-wrap msgid "Jail Upgrading" msgstr "Обновление клетки" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1813 msgid "" "Upgrading FreeBSD Jails ensures that the isolated environments remain " "secure, up-to-date, and in line with the latest features and improvements " "available in the FreeBSD ecosystem." msgstr "" "Обновление клеток FreeBSD гарантирует, что изолированные среды остаются " "безопасными, актуальными и соответствуют последним функциям и улучшениям, " "доступным в экосистеме FreeBSD." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1819 msgid "" "The right tool depends on how the jail's userland was installed. Jails " "installed from a distribution set (the [.filename]#base.txz# extracted in " "the creation sections, or one produced by man:bsdinstall[8]) are updated " "from the host with man:freebsd-update[8] through its `-j` flag, on both " "FreeBSD 14.x and 15.x. Jails installed from base packages, available from " "FreeBSD 15.0, are updated with man:pkg[8] instead; man:freebsd-update[8] " "does not apply to them. Jails built from source are updated with the source " "procedure (`make installworld` and `make distribution`). Never mix these " "mechanisms on the same jail." msgstr "" "Правильный инструмент зависит от того, как была установлена пользовательская " "среда клетки. Клетки, установленные из набора дистрибутивов (файл " "[.filename]#base.txz#, извлечённый в разделах создания, или созданный с " "помощью man:bsdinstall[8]), обновляются с хоста с помощью man:freebsd-" "update[8] через его флаг `-j`, как на FreeBSD 14.x, так и на 15.x. Клетки, " "установленные из базовых пакетов, доступных с FreeBSD 15.0, обновляются с " "помощью man:pkg[8] вместо этого; man:freebsd-update[8] к ним не применяется. " "Клетки, собранные из исходного кода, обновляются с помощью процедуры для " "исходного кода (`make installworld` и `make distribution`). Никогда не " "смешивайте эти механизмы в одной клетке." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1824 msgid "" "Support for distribution sets is planned for removal in FreeBSD 16, but will " "continue, together with man:freebsd-update[8], for the lifetime of the " "FreeBSD 15 stable branch. Base packages are offered as a technology preview " "in FreeBSD 15.0 and are expected to become the standard method in future " "releases, so pkgbase is the forward-looking path." msgstr "" "Поддержка наборов дистрибутивов планируется к удалению в FreeBSD 16, но " "будет продолжена, вместе с man:freebsd-update[8], на протяжении всего срока " "жизни стабильной ветки FreeBSD 15. Базовые пакеты предлагаются как " "технологическая превью в FreeBSD 15.0 и, как ожидается, станут стандартным " "методом в будущих выпусках, поэтому pkgbase — это перспективный путь." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1829 msgid "" "On OpenZFS, snapshot the jail's dataset before upgrading, so a failed " "upgrade can be undone instantly:" msgstr "" "В OpenZFS выполните снимок набора данных клетки перед обновлением, чтобы " "неудачное обновление можно было мгновенно отменить:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1833 #, no-wrap msgid "# zfs snapshot zroot/jails/containers/classic@preupgrade\n" msgstr "# zfs snapshot zroot/jails/containers/classic@preupgrade\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1839 msgid "" "If the upgrade fails, stop the jail and run `zfs rollback zroot/jails/" "containers/classic@preupgrade` to restore the previous state. This requires " "the jail to be its own dataset: the OpenZFS thin-jail clone already is, but " "a classic jail created with man:mkdir[1] is not, so create it with `zfs " "create` instead. For a NullFS thin jail, snapshot the template dataset " "instead. man:zfs-rollback[8] reverts only to the most recent snapshot " "unless `-r` is given to destroy any newer ones." msgstr "" "Если обновление не удалось, остановите клетку и выполните `zfs rollback " "zroot/jails/containers/classic@preupgrade`, чтобы восстановить предыдущее " "состояние. Для этого требуется, чтобы клетка была отдельным набором данных: " "тонкая клетка OpenZFS уже является таковым, но классическая клетка, " "созданная с помощью man:mkdir[1], не является, поэтому создайте её с помощью " "`zfs create` вместо этого. Для тонкой клетки NullFS сделайте снимок набора " "данных шаблона. man:zfs-rollback[8] откатывается только к самому последнему " "снимку, если не указан параметр `-r` для уничтожения более новых." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1842 #, no-wrap msgid "Upgrading a Classic Jail or a Thin Jail using OpenZFS Snapshots" msgstr "Обновление классической клетки или тонкой клетки с использованием снимков OpenZFS" #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1847 msgid "" "Jails *must be updated from the host* operating system. The default " "behavior in FreeBSD is to disallow the use of man:chflags[1] in a jail. " "This will prevent the update of some files so updating from within the jail " "will fail." msgstr "" "Клетки *должны обновляться их операционной системы хоста*. В FreeBSD по " "умолчанию запрещено использование man:chflags[1] в клетке. Это предотвращает " "обновление некоторых файлов, поэтому обновление изнутри клетки завершится " "ошибкой." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1849 msgid "" "To update the jail to the latest patch release of the version of FreeBSD it " "is running, execute the following commands on the host:" msgstr "" "Для обновления клетки до последнего патч-релиза версии FreeBSD, под которой " "он работает, выполните следующие команды на хосте:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1854 #, no-wrap msgid "" "# freebsd-update -j classic fetch install\n" "# service jail restart classic\n" msgstr "" "# freebsd-update -j classic fetch install\n" "# service jail restart classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1858 msgid "" "To upgrade the jail to a new major or minor version, first upgrade the host " "system as described in crossref:cutting-edge[freebsdupdate-upgrade," "\"Performing Major and Minor Version Upgrades\"]. Once the host has been " "upgraded and rebooted, the jail can then be upgraded." msgstr "" "Для обновления клетки до новой основной или промежуточной версии сначала " "обновите хост-систему, как описано в crossref:cutting-edge[freebsdupdate-" "upgrade,\"Выполнение обновлений основной и промежуточной версий\"]. После " "обновления и перезагрузки хоста можно обновить клетку." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1862 msgid "" "In case of upgrade from one version to another, it is easier to create a new " "jail than to upgrade completely." msgstr "" "В случае обновления с одной версии на другую проще создать новую клетку, чем " "выполнять полное обновление." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1865 msgid "" "For example, to upgrade the `classic` jail to {rel-latest}-RELEASE, execute " "the following commands on the host:" msgstr "" "Например, для обновления с `классической` клетки до {rel-latest}-RELEASE " "выполните следующие команды на хосте:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1873 #, no-wrap msgid "" "# freebsd-update -j classic -r {rel-latest}-RELEASE upgrade\n" "# freebsd-update -j classic install\n" "# service jail restart classic\n" "# freebsd-update -j classic install\n" "# service jail restart classic\n" msgstr "" "# freebsd-update -j classic -r {rel-latest}-RELEASE upgrade\n" "# freebsd-update -j classic install\n" "# service jail restart classic\n" "# freebsd-update -j classic install\n" "# service jail restart classic\n" #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1880 msgid "" "The `install` step is run twice on purpose. A jail has no kernel of its own " "(it runs the host's kernel), so nothing here upgrades a kernel. The first " "`install` writes the new userland into the jail; after the jail restarts on " "the updated files, the second `install` finishes replacing the components " "that could not be changed while their previous versions were still in use." msgstr "" "Шаг `install` намеренно запускается дважды. Клетка не имеет собственного " "ядра (она работает на ядре хоста), поэтому здесь ничего не обновляет ядро. " "Первый `install` записывает новое пользовательское окружение в клетку; после " "того как клетка перезапускается на обновлённых файлах, второй `install` " "завершает замену компонентов, которые нельзя было изменить, пока их " "предыдущие версии всё ещё использовались." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1884 msgid "" "Then, if it was a major version upgrade, reinstall all installed packages " "and restart the jail again. This is required because the ABI version " "changes when upgrading between major versions of FreeBSD." msgstr "" "Затем, если это было обновление основной версии, переустановите все " "установленные пакеты и перезапустите клетку снова. Это необходимо, потому " "что версия ABI изменяется при обновлении между основными версиями FreeBSD." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1886 msgid "From the host:" msgstr "С хоста:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1891 #, no-wrap msgid "" "# pkg -j classic upgrade -f\n" "# service jail restart classic\n" msgstr "" "# pkg -j classic upgrade -f\n" "# service jail restart classic\n" #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1894 #, no-wrap msgid "Upgrading OpenZFS Thin Jails" msgstr "Обновление тонкой клетки OpenZFS" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1899 msgid "" "The thin jails created in crossref:jails[creating-thin-jail-openzfs-" "snapshots,\"Creating a Thin Jail Using OpenZFS Snapshots\"] are OpenZFS " "clones of a template snapshot, but a clone is independent of that template " "once it exists. Refreshing the template does *not* update jails that were " "already cloned from it, and updating a clone does *not* update the " "template. There are therefore two ways to keep these jails current." msgstr "" "Тонкие клетки, созданные в crossref:jails[creating-thin-jail-openzfs-" "snapshots,\"Создание тонкой клетки с помощью снимков OpenZFS\"], являются " "клонами OpenZFS снимка шаблона, но после создания клон независим от этого " "шаблона. Обновление шаблона *не* обновляет клетки, которые уже были " "клонированы из него, а обновление клона *не* обновляет шаблон. Поэтому " "существует два способа поддерживать эти клетки в актуальном состоянии." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1902 msgid "" "The first option is to update each clone in place with man:freebsd-" "update[8], exactly as for a classic jail, as described in " "crossref:jails[jails-updating,\"Upgrading a Classic Jail or a Thin Jail " "using OpenZFS Snapshots\"]. This is the simplest approach for a handful of " "jails, but every clone that is patched diverges from the template snapshot: " "the changed blocks are duplicated per jail, which erodes the space savings, " "and a major upgrade rewrites so much of the userland that most of the " "sharing is lost." msgstr "" "Первый вариант — обновить каждый клон на месте с помощью man:freebsd-" "update[8], точно так же, как и для классической клетки, как описано в " "crossref:jails[jails-updating,\"Обновление классической клетки или тонкой " "клетки с использованием снимков OpenZFS\"]. Это самый простой подход для " "нескольких клеток, но каждый пропатченный клон отклоняется от шаблонного " "снимка: изменённые блоки дублируются для каждой клетки, что сокращает " "экономию места, а крупное обновление переписывает так много " "пользовательского окружения, что большая часть совместного использования " "теряется." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1905 msgid "" "The second option keeps the sharing intact by refreshing the template and re-" "cloning. Update the template to the latest patch level on the host:" msgstr "" "Второй вариант сохраняет совместное использование, обновляя шаблон и " "повторно клонируя его. Обновите шаблон до последнего уровня исправлений на " "хосте:" #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1915 msgid "" "man:freebsd-update[8] with `-b` reads the running release from the host's " "`uname -r`, not from the template. If the template runs an older release " "than the host, add `--currently-running ` so it patches " "the template's release instead of the host's, as shown in " "crossref:jails[upgrading-thin-jail,\"Upgrading a Thin Jail Using NullFS\"]." msgstr "" "man:freebsd-update[8] с параметром `-b` читает текущую версию выпуска из " "`uname -r` хост-системы, а не из шаблона. Если шаблон работает на более " "старой версии выпуска, чем хост-система, добавьте `--currently-running " "`, чтобы он применял исправления к версии выпуска шаблона, " "а не хоста-системы, как показано в crossref:jails[upgrading-thin-jail," "\"Обновление тонкой клетки с использованием NullFS\"]." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1918 msgid "Then take a new snapshot and clone future jails from it:" msgstr "Затем создайте новый снимок и клонируйте будущие клетки из него:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1923 #, no-wrap msgid "" "# zfs snapshot zroot/jails/templates/{rel-latest}-RELEASE@base-p2\n" "# zfs clone zroot/jails/templates/{rel-latest}-RELEASE@base-p2 zroot/jails/containers/newjail\n" msgstr "" "# zfs snapshot zroot/jails/templates/{rel-latest}-RELEASE@base-p2\n" "# zfs clone zroot/jails/templates/{rel-latest}-RELEASE@base-p2 zroot/jails/containers/newjail\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1927 msgid "" "Existing clones keep the base they were created from until they are re-" "created from the new snapshot. For a major or minor version upgrade, create " "a fresh template dataset for the new release following " "crossref:jails[creating-thin-jail-openzfs-snapshots,\"Creating a Thin Jail " "Using OpenZFS Snapshots\"], rather than upgrading the existing template in " "place, and clone new jails from its `@base` snapshot." msgstr "" "Существующие клоны сохраняют базу, из которой они были созданы, до тех пор, " "пока они не будут пересозданы из нового снимка. Для обновления основной или " "дополнительной версии создайте новый шаблонный набор данных для нового " "выпуска, следуя разделу crossref:jails[creating-thin-jail-openzfs-snapshots," "\"Создание тонкой клетки с помощью снимков OpenZFS\"], вместо обновления " "существующего шаблона на месте, и клонируйте новые клетки из его снимка " "`@base`." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1931 msgid "" "Keep each jail's application data and configuration on separate datasets, or " "in the jail's local storage, so that re-creating a jail from an updated " "template snapshot is cheap and preferable to patching every clone " "individually." msgstr "" "Храните данные приложений и конфигурацию каждой клетки на отдельных наборах " "данных или в локальном хранилище клетки, чтобы повторное создание клетки из " "обновлённого снимка шаблона было дешёвым и предпочтительным по сравнению с " "отдельным обновлением каждого клона." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1934 #, no-wrap msgid "Upgrading a Thin Jail Using NullFS" msgstr "Обновление тонкой клетки с использованием NullFS" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1939 msgid "" "Since Thin Jails that use NullFS share the majority of system directories, " "they are very easy to update. It is enough to update the template. This " "allows updating multiple jails at the same time." msgstr "" "Поскольку тонкие клетки, использующие NullFS, разделяют большинство " "системных каталогов, их очень легко обновлять. Достаточно обновить шаблон. " "Это позволяет обновлять несколько клеток одновременно." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1941 msgid "" "To update the template to the latest patch release of the version of FreeBSD " "it is running, execute the following commands on the host:" msgstr "" "Для обновления шаблона до последнего патч-релиза версии FreeBSD, на которой " "он работает, выполните следующие команды на хосте:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1946 #, no-wrap msgid "" "# freebsd-update -b /usr/local/jails/templates/{rel-latest}-RELEASE-base/ fetch install\n" "# service jail restart\n" msgstr "" "# freebsd-update -b /usr/local/jails/templates/{rel-latest}-RELEASE-base/ fetch install\n" "# service jail restart\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1950 msgid "" "To upgrade the template to a new major or minor version, first upgrade the " "host system as described in crossref:cutting-edge[freebsdupdate-upgrade," "\"Performing Major and Minor Version Upgrades\"]. Once the host has been " "upgraded and rebooted, the template can then be upgraded." msgstr "" "Для обновления шаблона до новой основной или промежуточной версии сначала " "обновите хост-систему, как описано в crossref:cutting-edge[freebsdupdate-" "upgrade,\"Выполнение обновлений основной и промежуточной версий\"]. После " "обновления и перезагрузки хост-системы можно обновить шаблон." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1954 msgid "" "Because the host was upgraded first, man:freebsd-update[8] with `-b` would " "otherwise detect the host's new release rather than the template's older " "one: `-b` reads the running version from the host's `uname -r`, unlike `-j`, " "which detects the jail's own userland. Pass `--currently-running ` so the template is patched from its actual release. The following " "example upgrades a template running 14.2-RELEASE to 14.3-RELEASE; substitute " "the releases that apply:" msgstr "" "Поскольку хост-система была обновлёна первой, man:freebsd-update[8] с `-b` в " "противном случае обнаружил бы новый выпуск хост-системы, а не более старый " "выпуск шаблона: `-b` считывает текущую версию из `uname -r` хост-системы, в " "отличие от `-j`, который определяет собственную пользовательскую среду " "клетки. Передайте `--currently-running `, чтобы шаблон был " "обновлён с его фактического выпуска. Следующий пример обновляет шаблон, " "работающий на 14.2-RELEASE, до 14.3-RELEASE; подставьте применимые выпуски:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1962 #, no-wrap msgid "" "# freebsd-update -b /usr/local/jails/templates/14.2-RELEASE-base/ --currently-running 14.2-RELEASE -r 14.3-RELEASE upgrade\n" "# freebsd-update -b /usr/local/jails/templates/14.2-RELEASE-base/ install\n" "# service jail restart\n" "# freebsd-update -b /usr/local/jails/templates/14.2-RELEASE-base/ install\n" "# service jail restart\n" msgstr "" "# freebsd-update -b /usr/local/jails/templates/14.2-RELEASE-base/ --currently-running 14.2-RELEASE -r 14.3-RELEASE upgrade\n" "# freebsd-update -b /usr/local/jails/templates/14.2-RELEASE-base/ install\n" "# service jail restart\n" "# freebsd-update -b /usr/local/jails/templates/14.2-RELEASE-base/ install\n" "# service jail restart\n" #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:1965 #, no-wrap msgid "Upgrading pkgbase Jails" msgstr "Обновление клеток с pkgbase" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1968 msgid "" "Jails installed from base packages, available from FreeBSD 15.0, are " "upgraded with man:pkg[8] against the `FreeBSD-base` repository rather than " "with man:freebsd-update[8]." msgstr "" "Клетки, установленные из базовых пакетов, доступных с FreeBSD 15.0, " "обновляются с помощью man:pkg[8] через репозиторий `FreeBSD-base`, а не с " "помощью man:freebsd-update[8]." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1970 msgid "" "The `FreeBSD-base` repository is defined in [.filename]#/etc/pkg/" "FreeBSD.conf# but is disabled by default on FreeBSD 15.0, so enable it " "before upgrading." msgstr "" "Репозиторий `FreeBSD-base` определён в [.filename]#/etc/pkg/FreeBSD.conf#, " "но по умолчанию отключён в FreeBSD 15.0, поэтому включите его перед " "обновлением." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1972 msgid "" "From the host, point man:pkg[8] at the jail's root directory with `-r` (`--" "rootdir`):" msgstr "" "С хост-системы укажите man:pkg[8] на корневой каталог клетки с помощью `-r` " "(`--rootdir`):" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1978 #, no-wrap msgid "" "# pkg -r /usr/local/jails/containers/pkgjail update\n" "# pkg -r /usr/local/jails/containers/pkgjail upgrade\n" "# service jail restart pkgjail\n" msgstr "" "# pkg -r /usr/local/jails/containers/pkgjail update\n" "# pkg -r /usr/local/jails/containers/pkgjail upgrade\n" "# service jail restart pkgjail\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1981 msgid "" "The same upgrade can be run from inside the jail with man:jexec[8] and a " "plain `pkg upgrade`:" msgstr "" "Тот же самый апгрейд можно выполнить изнутри клетки с помощью man:jexec[8] и " "обычной команды `pkg upgrade`:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:1986 #, no-wrap msgid "" "# jexec -l pkgjail pkg upgrade\n" "# service jail restart pkgjail\n" msgstr "" "# jexec -l pkgjail pkg upgrade\n" "# service jail restart pkgjail\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1993 msgid "" "man:pkg[8] performs a three-way merge on tagged configuration files under " "[.filename]#/etc#. When a merge cannot be completed automatically it leaves " "the new version as [.filename]#.pkgnew#, and when it takes over a file " "that was not previously packaged it saves the old copy as " "[.filename]#.pkgsave#. Review [.filename]#/etc# after an upgrade and " "reconcile any such files by hand. Do not run man:etcupdate[8] on a pkgbase " "system; man:pkg[8] handles configuration merging itself. See " "crossref:cutting-edge[cutting-edge,\"Updating and Upgrading FreeBSD\"] for " "the host-side base-package workflow." msgstr "" "man:pkg[8] выполняет трехстороннее слияние размеченных конфигурационных " "файлов в [.filename]#/etc#. Когда слияние не может быть завершено " "автоматически, он оставляет новую версию как [.filename]#.pkgnew#, а " "когда он забирает файл, который ранее не был упакован, он сохраняет старую " "копию как [.filename]#.pkgsave#. Проверьте [.filename]#/etc# после " "обновления и вручную согласуйте любые такие файлы. Не запускайте " "man:etcupdate[8] в системе pkgbase; man:pkg[8] сам обрабатывает слияние " "конфигураций. Смотрите crossref:cutting-edge[cutting-edge,\"Обновление и " "модернизация FreeBSD\"] для описания рабочего процесса с базовыми пакетами " "на стороне хоста." #. type: Title == #: documentation/content/en/books/handbook/jails/_index.adoc:1995 #, no-wrap msgid "Jail Resource Limits" msgstr "Ограничения ресурсов клетки" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:1998 msgid "" "Controlling the resources that a jail uses from the host system is a task to " "be taken into account by the system administrator." msgstr "" "Управление ресурсами хост-системы, которые использует клетка — это задача, " "которую должен учитывать системный администратор." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2000 msgid "" "Use man:rctl[8] to manage the resources that a jail can use from the host " "system." msgstr "" "Используйте man:rctl[8] для управления ресурсами хост-системы, которые " "клетка может использовать." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2004 msgid "" "The `kern.racct.enable` tunable must be enabled at [.filename]#/boot/" "loader.conf#." msgstr "" "Настройка `kern.racct.enable` должна быть включена в файле [.filename]#/boot/" "loader.conf#." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2007 msgid "The syntax to limit the resources of a jail is as follows:" msgstr "Синтаксис для ограничения ресурсов клетки выглядит следующим образом:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2011 #, no-wrap msgid "rctl -a jail::resource:action=amount[/per]\n" msgstr "rctl -a jail::resource:action=amount[/per]\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2016 msgid "" "The optional `per` component is not a percentage; it is the accounting " "entity the limit is applied to, one of `process`, `user`, `loginclass`, or " "`jail`. For example, `deny=2G/jail` limits the sum for the whole jail, " "while `deny=2G/process` applies the same figure to each process " "individually. A percentage is only meaningful for the `pcpu` resource, " "whose amount is expressed as a percentage of a single CPU core." msgstr "" "Необязательный компонент `per` не является процентным соотношением; это " "учетная единица, к которой применяется ограничение: одна из `process`, " "`user`, `loginclass` или `jail`. Например, `deny=2G/jail` ограничивает сумму " "для всей клетки, тогда как `deny=2G/process` применяет то же значение к " "каждому процессу по отдельности. Процентное соотношение имеет смысл только " "для ресурса `pcpu`, количество которого выражается в процентах от одного " "ядра процессора." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2018 msgid "" "For example, to limit the maximum RAM that a jail can access, run the " "following command:" msgstr "" "Например, чтобы ограничить максимальный объём оперативной памяти, доступной " "для клетки, выполните следующую команду:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2022 #, no-wrap msgid "# rctl -a jail:classic:memoryuse:deny=2G\n" msgstr "# rctl -a jail:classic:memoryuse:deny=2G\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2025 msgid "" "To make the limitation persistent across reboots of the host system, it will " "be necessary to add the rule to the [.filename]#/etc/rctl.conf# file as " "follows:" msgstr "" "Чтобы ограничение сохранялось после перезагрузки хост-системы, необходимо " "добавить правило в файл [.filename]#/etc/rctl.conf# следующим образом:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2029 #, no-wrap msgid "jail:classic:memoryuse:deny=2G/jail\n" msgstr "jail:classic:memoryuse:deny=2G/jail\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2034 msgid "" "man:rctl[8] can limit far more than memory. The resources most relevant to " "a jail include `pcpu` (percentage of a single CPU core), `maxproc` (number " "of processes), `openfiles` (open file descriptors), `vmemoryuse` (address " "space), and `swapuse` (swap space). Each of them is set the same way:" msgstr "" "man:rctl[8] может ограничивать гораздо больше, чем память. Ресурсы, наиболее " "значимые для клетки, включают `pcpu` (процент одного ядра ЦП), `maxproc` " "(количество процессов), `openfiles` (открытые файловые дескрипторы), " "`vmemoryuse` (адресное пространство) и `swapuse` (пространство подкачки). " "Каждый из них настраивается одинаково:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2041 #, no-wrap msgid "" "# rctl -a jail:classic:pcpu:deny=80\n" "# rctl -a jail:classic:maxproc:deny=1000\n" "# rctl -a jail:classic:openfiles:deny=5000\n" "# rctl -a jail:classic:vmemoryuse:deny=4G\n" msgstr "" "# rctl -a jail:classic:pcpu:deny=80\n" "# rctl -a jail:classic:maxproc:deny=1000\n" "# rctl -a jail:classic:openfiles:deny=5000\n" "# rctl -a jail:classic:vmemoryuse:deny=4G\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2044 msgid "" "Disk throughput is limited with `readbps` and `writebps`, but these " "resources do not support the `deny` action; pair them with `throttle` " "instead:" msgstr "" "Пропускная способность диска ограничивается параметрами `readbps` и " "`writebps`, но эти ресурсы не поддерживают действие `deny`; вместо этого " "объединяйте их с `throttle`:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2048 #, no-wrap msgid "# rctl -a jail:classic:writebps:throttle=1m\n" msgstr "# rctl -a jail:classic:writebps:throttle=1m\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2051 msgid "" "The action after the resource selects what happens when the limit is " "reached: `deny` blocks the operation, `log` records it to the system log, " "and `devctl` sends a notification through man:devd[8]." msgstr "" "Действие после ресурса определяет, что происходит при достижении лимита: " "`deny` блокирует операцию, `log` записывает её в системный журнал, а " "`devctl` отправляет уведомление через man:devd[8]." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2053 msgid "" "Report the current resource usage of a jail with the `-u` flag, adding `-h` " "for human-readable units:" msgstr "" "Сообщите о текущем использовании ресурсов клетки с помощью флага `-u`, " "добавив `-h` для единиц, удобных для чтения человеком:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2057 #, no-wrap msgid "# rctl -hu jail:classic\n" msgstr "# rctl -hu jail:classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2060 msgid "List the rules that apply to a jail:" msgstr "Перечислите правила, которые применяются к клетке:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2064 #, no-wrap msgid "# rctl jail:classic\n" msgstr "# rctl jail:classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2067 msgid "Remove every rule that matches a jail with `-r`:" msgstr "Удалите каждое правило, которое соответствует клетке, с помощью `-r`:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2071 #, no-wrap msgid "# rctl -r jail:classic\n" msgstr "# rctl -r jail:classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2074 msgid "" "More information on resource limits can be found in the security chapter in " "the crossref:security[security-resourcelimits,\"Resource Limits section\"]." msgstr "" "Дополнительная информация об ограничениях ресурсов доступна в главе о " "безопасности в разделе crossref:security[security-resourcelimits," "\"Ограничения ресурсов\"]." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:2076 #, no-wrap msgid "CPU Pinning with cpuset" msgstr "Привязка CPU с помощью cpuset" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2079 msgid "" "man:rctl[8] with `pcpu` caps how much CPU time a jail may consume, but it " "does not tie the jail to particular cores; man:cpuset[1] assigns specific " "cores instead." msgstr "" "man:rctl[8] с ограничением `pcpu` определяет, сколько времени ЦП может " "потреблять клетка, но она не привязывает клетку к конкретным ядрам; " "man:cpuset[1] вместо этого назначает конкретные ядра." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2081 msgid "Restrict a running jail to a set of CPUs by its name or JID:" msgstr "Ограничить работающую клетку набором CPU по её имени или JID:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2085 #, no-wrap msgid "# cpuset -l 0-3 -j classic\n" msgstr "# cpuset -l 0-3 -j classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2088 msgid "Query the cores a jail is currently allowed to use with `-g`:" msgstr "" "Запросить ядра, которые клетка в настоящее время может использовать, с " "помощью `-g`:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2092 #, no-wrap msgid "# cpuset -g -j classic\n" msgstr "# cpuset -g -j classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2096 msgid "" "The assigned set is also reported in the cpuset column of `jls -v`. There " "is no jail.conf parameter for CPU affinity, so pin the jail at start time by " "running man:cpuset[1] from an `exec.created` or `exec.poststart` hook, both " "of which run in the host environment:" msgstr "" "Назначенный набор также отображается в столбце `cpuset` команды `jls -v`. В " "файле `jail.conf` нет параметра для привязки к процессору, поэтому закрепите " "клетку при запуске, выполнив man:cpuset[1] из хука `exec.created` или " "`exec.poststart`, оба из которых выполняются в среде хоста:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2100 #, no-wrap msgid "exec.poststart = \"cpuset -l 0-3 -j classic\";\n" msgstr "exec.poststart = \"cpuset -l 0-3 -j classic\";\n" #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:2103 #, no-wrap msgid "Limiting Disk Space" msgstr "Ограничение дискового пространства" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2107 msgid "" "man:rctl[8] has no resource for filesystem space. When each jail lives in " "its own ZFS dataset, cap and guarantee its disk usage with ZFS quotas and " "reservations instead:" msgstr "" "man:rctl[8] не имеет ресурса для файлового пространства. Когда каждая клетка " "находится в собственном наборе данных ZFS, ограничьте и гарантируйте " "использование дискового пространства с помощью квот и резервирований ZFS " "вместо этого:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2112 #, no-wrap msgid "" "# zfs set quota=20G zroot/jails/containers/classic\n" "# zfs set reservation=5G zroot/jails/containers/classic\n" msgstr "" "# zfs set quota=20G zroot/jails/containers/classic\n" "# zfs set reservation=5G zroot/jails/containers/classic\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2117 msgid "" "This requires the jail to be a dataset of its own. The ZFS thin jails " "created earlier already are, but the Classic Jail procedure creates the jail " "directory with `mkdir` inside the shared [.filename]#containers# dataset, so " "create it with `zfs create` first for these commands to apply. See " "crossref:jails[host-configuration-directories,\"Setting Up the Jail " "Directory Tree\"] for the dataset layout and man:zfs-set[8] for the `quota` " "and `reservation` properties." msgstr "" "Для этого требуется, чтобы клетка была собственным набором данных. Созданные " "ранее тонкие клетки ZFS уже таковыми являются, но процедура Классической " "Клетки создает каталог клетки с помощью `mkdir` внутри общего набора данных " "[.filename]#containers#, поэтому сначала создайте его с помощью `zfs " "create`, чтобы эти команды применялись. См. crossref:jails[host-" "configuration-directories,\"Настройка дерева каталогов клетки\"] для " "структуры наборов данных и man:zfs-set[8] для свойств `quota` и " "`reservation`." #. type: Title == #: documentation/content/en/books/handbook/jails/_index.adoc:2119 #, no-wrap msgid "More Jail Options" msgstr "Дополнительные параметры клетки" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2126 msgid "" "man:jail[8] exposes many more parameters than the examples in this chapter " "use. A jail is a strong isolation boundary, but it is not an absolute one. " "Every `allow.*` relaxation trades isolation for capability and moves the " "jail's privileged users a step closer to the privileges of the host's " "`root`. Grant a jail only the permissions the workload inside it genuinely " "needs, and leave everything else at its more restrictive default. The full " "list is in man:jail[8] and man:jail.conf[5]; the parameters below are the " "ones an administrator reaches for most often." msgstr "" "man:jail[8] предоставляет гораздо больше параметров, чем используется в " "примерах из этой главы. Клетка является сильной границей изоляции, но не " "абсолютной. Каждое послабление `allow.*` обменивает изоляцию на возможности " "и приближает привилегированных пользователей клетки на шаг ближе к " "привилегиям `root` на хост-системе. Предоставляйте клетке только те " "разрешения, которые действительно необходимы для выполняемой в ней рабочей " "нагрузки, а всё остальное оставляйте в более ограничительном режиме по " "умолчанию. Полный список приведён в man:jail[8] и man:jail.conf[5]; " "параметры ниже — это те, к которым администраторы обращаются чаще всего." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:2128 #, no-wrap msgid "The allow.* Permissions" msgstr "Разрешения allow.*" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2132 msgid "" "The `allow.*` parameters are booleans that hand individual privileges to the " "jail. Per man:jail[8], \"With the exception of allow.set_hostname and " "allow.reserved_ports, these boolean parameters are off by default\", so a " "jail starts locked down and each capability must be granted explicitly." msgstr "" "Параметры `allow.*` являются логическими значениями, которые предоставляют " "отдельные привилегии клетке. Согласно man:jail[8], \"За исключением " "allow.set_hostname и allow.reserved_ports, эти логические параметры по " "умолчанию выключены\", поэтому клетка запускается в заблокированном " "состоянии, и каждая возможность должна быть предоставлена явно." #. type: Block title #: documentation/content/en/books/handbook/jails/_index.adoc:2133 #, no-wrap msgid "Common `allow.*` parameters" msgstr "Общие параметры `allow.*`" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2136 #, no-wrap msgid "Parameter" msgstr "Параметр" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2136 #, no-wrap msgid "Default" msgstr "По умолчанию" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2138 #, no-wrap msgid "Effect" msgstr "Эффект" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2139 #, no-wrap msgid "`allow.set_hostname`" msgstr "`allow.set_hostname`" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2140 #: documentation/content/en/books/handbook/jails/_index.adoc:2144 #, no-wrap msgid "On" msgstr "On" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2142 #, no-wrap msgid "The jail may change its own hostname." msgstr "Клетка может изменить собственное имя хоста." #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2143 #, no-wrap msgid "`allow.reserved_ports`" msgstr "`allow.reserved_ports`" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2146 #, no-wrap msgid "Jailed `root` may bind the reserved ports below 1024." msgstr "`root` в клетке может открывать (делать bind) зарезервированные порты ниже 1024." #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2147 #, no-wrap msgid "`allow.raw_sockets`" msgstr "`allow.raw_sockets`" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2148 #: documentation/content/en/books/handbook/jails/_index.adoc:2152 #: documentation/content/en/books/handbook/jails/_index.adoc:2156 #: documentation/content/en/books/handbook/jails/_index.adoc:2160 #: documentation/content/en/books/handbook/jails/_index.adoc:2164 #: documentation/content/en/books/handbook/jails/_index.adoc:2168 #: documentation/content/en/books/handbook/jails/_index.adoc:2172 #: documentation/content/en/books/handbook/jails/_index.adoc:2176 #: documentation/content/en/books/handbook/jails/_index.adoc:2180 #: documentation/content/en/books/handbook/jails/_index.adoc:2184 #, no-wrap msgid "Off" msgstr "Off" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2150 #, no-wrap msgid "Enables raw sockets, so man:ping[8] and man:traceroute[8] work inside the jail." msgstr "Включает «сырые» (raw) сокеты, чтобы man:ping[8] и man:traceroute[8] работали внутри клетки." #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2151 #, no-wrap msgid "`allow.chflags`" msgstr "`allow.chflags`" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2154 #, no-wrap msgid "Jailed `root` may manipulate system file flags as it would on the host." msgstr "`root` в клетке может управлять системными файловыми флагами так же, как и на хост-системе." #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2155 #, no-wrap msgid "`allow.mount`" msgstr "`allow.mount`" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2158 #, no-wrap msgid "The jail may mount and unmount filesystems, together with the `allow.mount.*` children." msgstr "Клетка может монтировать и размонтировать файловые системы, вместе с дочерними опциями `allow.mount.*`." #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2159 #, no-wrap msgid "`allow.quotas`" msgstr "`allow.quotas`" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2162 #, no-wrap msgid "The jail may administer filesystem quotas." msgstr "Клетка может администрировать квоты файловой системы." #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2163 #, no-wrap msgid "`allow.read_msgbuf`" msgstr "`allow.read_msgbuf`" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2166 #, no-wrap msgid "Jailed processes may read the kernel message buffer with man:dmesg[8]." msgstr "Процессы в клетках могут читать буфер сообщений ядра с помощью man:dmesg[8]." #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2167 #, no-wrap msgid "`allow.socket_af`" msgstr "`allow.socket_af`" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2170 #, no-wrap msgid "Allows socket address families other than IPv4, IPv6, local, and route." msgstr "Разрешает семейства адресов сокетов, отличные от IPv4, IPv6, локальных и маршрутных." #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2171 #, no-wrap msgid "`allow.mlock`" msgstr "`allow.mlock`" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2174 #, no-wrap msgid "Jailed processes may lock physical memory with man:mlock[2]." msgstr "Процессы в клетках могут блокировать физическую память с помощью man:mlock[2]." #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2175 #, no-wrap msgid "`allow.unprivileged_proc_debug`" msgstr "`allow.unprivileged_proc_debug`" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2178 #, no-wrap msgid "Unprivileged users may use debugging facilities on their own processes." msgstr "Непривилегированные пользователи могут использовать средства отладки для своих собственных процессов." #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2179 #, no-wrap msgid "`allow.vmm`" msgstr "`allow.vmm`" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2182 #, no-wrap msgid "The jail may use the man:vmm[4] hypervisor to run man:bhyve[8] guests." msgstr "Клетка может использовать гипервизор man:vmm[4] для запуска гостевых систем man:bhyve[8]." #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2183 #, no-wrap msgid "`allow.nfsd`" msgstr "`allow.nfsd`" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2185 #, no-wrap msgid "The jail may run an NFS server." msgstr "Клетка может запускать NFS-сервер." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2188 msgid "" "Weigh each relaxation against what it exposes: `allow.raw_sockets` lets " "jailed processes forge packets, `allow.chflags` lets jailed `root` clear the " "immutable and append-only flags the host relies on, and `allow.mount` opens " "up the filesystem namespace." msgstr "" "Взвесьте каждое послабление относительно того, что оно открывает: " "`allow.raw_sockets` позволяет процессам в клетке подделывать пакеты, " "`allow.chflags` позволяет `root` в клетке снимать флаги неизменяемости и " "только для добавления, на которые полагается хост-система, а `allow.mount` " "открывает пространство имён файловой системы." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2190 msgid "" "Running an NFS server inside a jail, highlighted in the FreeBSD 14.0 release " "notes, needs `allow.nfsd` set, a VNET jail whose root directory is itself a " "filesystem mount point, and `enforce_statfs` not set to `0`." msgstr "" "Запуск NFS-сервера внутри клетки, отмеченный в примечаниях к выпуску FreeBSD " "14.0, требует установки параметра `allow.nfsd`, VNET-клетки, корневой " "каталог которой сам является точкой монтирования файловой системы, а также " "параметра `enforce_statfs`, не установленного в значение `0`." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:2192 #, no-wrap msgid "System V IPC" msgstr "IPC System V (межпроцессное взаимодействие)" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2196 msgid "" "Databases and other software that rely on System V shared memory, " "semaphores, and message queues are controlled per module with the `sysvmsg`, " "`sysvsem`, and `sysvshm` parameters. Each takes one of three values: " "`inherit` makes all of the host's IPC objects visible to the jail, `new` " "gives the jail its own private key namespace, and `disable` makes the " "related system calls fail." msgstr "" "Базы данных и другое программное обеспечение, которое полагается на " "разделяемую память System V, семафоры и очереди сообщений, управляются по " "модулям с помощью параметров `sysvmsg`, `sysvsem` и `sysvshm`. Каждый из них " "принимает одно из трёх значений: `inherit` делает все объекты IPC узла " "видимыми для клетки, `new` предоставляет клетке собственное частное " "пространство имён ключей, а `disable` приводит к сбою этих системных вызовов." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2198 msgid "" "For the classic case of running PostgreSQL in a jail, `new` is the right " "choice, giving the database its own shared-memory namespace without exposing " "the host's:" msgstr "" "Для классического случая запуска PostgreSQL в клетке, выбор `new` является " "правильным, предоставляя базе данных собственное пространство имён " "разделяемой памяти, не раскрывая пространство хост-системы:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2204 #, no-wrap msgid "" "sysvmsg = new;\n" "sysvsem = new;\n" "sysvshm = new;\n" msgstr "" "sysvmsg = new;\n" "sysvsem = new;\n" "sysvshm = new;\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2208 msgid "" "The older `allow.sysvipc` parameter is deprecated. It is equivalent to " "setting all three module parameters to `inherit`, which shares the host-wide " "IPC namespace with the jail, so prefer the per-module parameters above." msgstr "" "Устаревший параметр `allow.sysvipc` больше не используется. Он эквивалентен " "установке всех трех параметров модуля в значение `inherit`, что разделяет " "общесистемное пространство имен IPC с клеткой, поэтому предпочтительнее " "использовать указанные выше параметры для каждого модуля." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:2210 #, no-wrap msgid "Mounting Filesystems" msgstr "Монтирование файловых систем" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2215 msgid "" "`allow.mount` lets a jail mount filesystems, and a family of child " "parameters selects which types: `allow.mount.devfs`, `allow.mount.fdescfs`, " "`allow.mount.fusefs`, `allow.mount.nullfs`, `allow.mount.procfs`, " "`allow.mount.linprocfs`, `allow.mount.linsysfs`, `allow.mount.tmpfs`, and " "`allow.mount.zfs`. Per man:jail[8], each child \"is effective only together " "with allow.mount and only when enforce_statfs is set to a value lower than " "2\". The convenience parameters `mount.devfs`, `mount.fdescfs`, and " "`mount.procfs` mount those filesystems for the jail automatically, and " "`mount.fstab` points at an fstab file of additional mounts." msgstr "" "`allow.mount` позволяет клетке монтировать файловые системы, а семейство " "дочерних параметров выбирает, какие именно типы: `allow.mount.devfs`, " "`allow.mount.fdescfs`, `allow.mount.fusefs`, `allow.mount.nullfs`, " "`allow.mount.procfs`, `allow.mount.linprocfs`, `allow.mount.linsysfs`, " "`allow.mount.tmpfs` и `allow.mount.zfs`. Согласно man:jail[8], каждый " "дочерний параметр «действует только вместе с `allow.mount` и только когда " "`enforce_statfs` установлен в значение ниже 2». Удобные параметры " "`mount.devfs`, `mount.fdescfs` и `mount.procfs` автоматически монтируют " "соответствующие файловые системы для клетки, а `mount.fstab` указывает на " "файл fstab с дополнительными точками монтирования." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2218 msgid "" "The `enforce_statfs` parameter controls both which mount points a jail can " "see and, through the rule above, whether the `allow.mount.*` permissions " "take effect. It takes three values:" msgstr "" "Параметр `enforce_statfs` управляет как тем, какие точки монтирования может " "видеть клетка, так и, согласно приведенному выше правилу, тем, действуют ли " "разрешения `allow.mount.*`. Он принимает три значения:" #. type: Block title #: documentation/content/en/books/handbook/jails/_index.adoc:2219 #, no-wrap msgid "`enforce_statfs` values" msgstr "`enforce_statfs` значения" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2222 #, no-wrap msgid "Value" msgstr "Значение" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2224 #, no-wrap msgid "Mount points visible to the jail" msgstr "Точки монтирования, видимые клетке" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2225 #, no-wrap msgid "`0`" msgstr "`0`" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2227 #, no-wrap msgid "All mount points on the host, with no restrictions." msgstr "Все точки монтирования на хост-системе, без каких-либо ограничений." #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2228 #, no-wrap msgid "`1`" msgstr "`1`" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2230 #, no-wrap msgid "Only the mount points below the jail's root directory." msgstr "Видны только точки монтирования ниже корневого каталога клетки." #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2231 #, no-wrap msgid "`2` (default)" msgstr "`2` (по умолчанию)" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2232 #, no-wrap msgid "Only the single mount point where the jail's root directory is located." msgstr "Видна только единственная точка монтирования, где расположен корневой каталог клетки." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2235 msgid "" "Because the `allow.mount.*` permissions require a value lower than `2`, a " "jail that must mount its own filesystems is typically configured with " "`enforce_statfs = 1`." msgstr "" "Поскольку для прав `allow.mount.*` требуется значение ниже `2`, клетка, " "которой необходимо монтировать собственные файловые системы, обычно " "настраивается с параметром `enforce_statfs = 1`." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:2237 #, no-wrap msgid "Per-Jail securelevel" msgstr "Уровень безопасности (securelevel) для каждой клетки" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2242 msgid "" "The `securelevel` parameter sets the jail's `kern.securelevel` and raises " "the kernel's immutable-flag and device protections inside the jail. Per " "man:jail[8], \"A jail never has a lower securelevel than its parent system, " "but by setting this parameter it may have a higher one\". A network-facing " "jail can therefore run at a hardened `securelevel = 3` while the host stays " "at its default." msgstr "" "Параметр `securelevel` устанавливает значение `kern.securelevel` для клетки " "и повышает уровень защиты ядра от изменений флагов и устройств внутри " "клетки. Согласно man:jail[8], «клетка никогда не имеет более низкого уровня " "securelevel, чем её родительская система, но, установив этот параметр, она " "может иметь более высокий». Таким образом, клетка, обращённая к сети, может " "работать при ужесточённом `securelevel = 3`, в то время как хост-система " "остаётся на уровне по умолчанию." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:2244 #, no-wrap msgid "Hierarchical Jails" msgstr "Иерархичские клетки (Hierarchical Jails)" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2250 msgid "" "A jail may itself create child jails, which is how nested or hierarchical " "jail hierarchies are built. The `children.max` parameter sets how many " "child jails a jail may create; it defaults to `0`, meaning no child jails " "are allowed, and the read-only `children.cur` reports how many currently " "exist. A child can never exceed the privileges of its parent: per " "man:jail[8], \"Jailed processes are not allowed to confer greater " "permissions than they themselves are given\". This makes it possible to run " "a jail manager inside a jail." msgstr "" "Клетка сама может создавать дочерние клетки, именно так строятся вложенные " "или иерархические структуры клеток. Параметр `children.max` задаёт, сколько " "дочерних клеток может создать клетка; по умолчанию он равен `0`, что " "означает отсутствие разрешения на создание дочерних клеток, а доступный " "только для чтения параметр `children.cur` сообщает, сколько их существует в " "данный момент. Дочерняя клетка никогда не может превысить привилегии своего " "родителя: согласно man:jail[8], «Процессы, находящиеся в клетке, не имеют " "права предоставлять большие полномочия, чем те, которые даны им самим». Это " "делает возможным запуск менеджера клеток внутри клетки." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:2252 #, no-wrap msgid "Empty and Persistent Jails" msgstr "Пустые и постоянные клетки" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2258 msgid "" "By default a jail exists only while it has running processes; when its last " "process exits, the jail disappears. Setting the `persist` parameter, in the " "words of man:jail[8], \"allows a jail to exist without any processes\". " "This is what keeps a jail alive after it has been created empty and before " "anything is populated into it, and what anchors a VNET jail that only holds " "network state. A jail can be created empty and kept alive for " "experimentation:" msgstr "" "По умолчанию клетка существует только пока в ней есть запущенные процессы; " "когда её последний процесс завершается, клетка исчезает. Установка параметра " "`persist`, по словам man:jail[8], «позволяет клетке существовать без каких-" "либо процессов». Именно это поддерживает клетку в живых после её создания " "пустой и до того, как в неё будет что-либо помещено, а также закрепляет VNET-" "клетку, которая хранит только сетевое состояние. Клетка может быть создана " "пустой и поддерживаться в живых для экспериментов:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2262 #, no-wrap msgid "# jail -c name=test path=/rescue persist\n" msgstr "# jail -c name=test path=/rescue persist\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2265 msgid "" "Clear the flag with `nopersist` to let the jail be removed once idle again." msgstr "" "Сбросьте флаг с помощью `nopersist`, чтобы клетка могла быть удалена после " "того, как снова станет неактивной." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:2267 #, no-wrap msgid "Presenting a Different OS Release" msgstr "Представление другого выпуска ОС" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2274 msgid "" "A jail's userland may be older than the host kernel, but tools inside it " "still read the host's version through man:uname[1] unless told otherwise. " "The `osrelease` parameter sets the string reported by the jail's " "`kern.osrelease` and `uname -r`, and `osreldate` sets the number reported by " "`kern.osreldate` and `uname -K`. Setting them so that an older userland " "reports its own release keeps man:uname[1], man:sysctl[8] consumers, and " "version-sniffing build tooling behaving correctly, including man:freebsd-" "update[8] run inside the jail. Package management is unaffected either way, " "because man:pkg[8] derives its ABI from the ELF notes of the jail's own " "binaries rather than from man:uname[1]. This complements the rule that a " "jail's userland can never be newer than the host kernel; see " "crossref:jails[jail-upgrading,\"Jail Upgrading\"]." msgstr "" "Пользовательское окружение клетки может быть старше, чем ядро хост-системы, " "но инструменты внутри нее все равно читают версию хост-системы через " "man:uname[1], если не указано иное. Параметр `osrelease` задает строку, " "сообщаемую через `kern.osrelease` и `uname -r` клетки, а `osreldate` задает " "число, сообщаемое через `kern.osreldate` и `uname -K`. Установка их таким " "образом, чтобы более старое пользовательское окружение сообщало о " "собственной версии, обеспечивает корректную работу man:uname[1], " "потребителей man:sysctl[8] и инструментов сборки, определяющих версию, " "включая man:freebsd-update[8], запускаемый внутри клетки. Управление " "пакетами не затрагивается ни в ту, ни в другую сторону, потому что " "man:pkg[8] получает свой ABI из ELF-заметок собственных бинарных файлов " "клетки, а не из man:uname[1]. Это дополняет правило, согласно которому " "пользовательское окружение клетки никогда не может быть новее, чем ядро " "хоста; см. crossref:jails[jail-upgrading,\"Обновление клеток\"]." #. type: Title == #: documentation/content/en/books/handbook/jails/_index.adoc:2276 #, no-wrap msgid "Jails and ZFS" msgstr "Клетки и ZFS" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2280 msgid "" "A jail can be given control of one or more ZFS datasets, allowing the jailed " "root user to create, snapshot, clone, and roll back child datasets without " "any involvement from the host administrator. This is the recommended way to " "give a jail its own writable, snapshot-capable storage." msgstr "" "Клетка может получить контроль над одним или несколькими наборами данных " "ZFS, позволяя привилегированному пользователю внутри клетки создавать, " "снимать снимки, клонировать и откатывать дочерние наборы данных без участия " "администратора хост-системы. Это рекомендуемый способ предоставить клетке " "собственное записываемое хранилище с поддержкой снимков." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2283 msgid "" "The host retains ownership of the dataset and only delegates management of " "the delegated tree and its descendants to the jail. The `jailed` property, " "the `zfs jail` subcommand, and the interaction between the two are described " "in crossref:zfs[zfs-zfs-jail,ZFS and Jails]." msgstr "" "Хост-система сохраняет право собственности на набор данных и делегирует " "клетке только управление делегированным деревом и его потомками. Свойство " "`jailed`, подкоманда `zfs jail` и взаимодействие между ними описаны в " "crossref:zfs[zfs-zfs-jail,ZFS и клетки]." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:2285 #, no-wrap msgid "Delegating a Dataset Manually" msgstr "Ручное делегирование набора данных" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2288 msgid "This method works on all supported releases of FreeBSD." msgstr "Этот метод работает на всех поддерживаемых выпусках FreeBSD." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2290 msgid "On the host, create the dataset to delegate and mark it as jailed:" msgstr "" "На хост-системе создайте набор данных для делегирования и пометьте его как " "клетку:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2295 #, no-wrap msgid "" "# zfs create zroot/jails/data\n" "# zfs set jailed=on zroot/jails/data\n" msgstr "" "# zfs create zroot/jails/data\n" "# zfs set jailed=on zroot/jails/data\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2298 msgid "" "Setting the `jailed` property tells ZFS that the dataset will be managed " "from inside a jail, so the host stops mounting it automatically." msgstr "" "Установка свойства `jailed` сообщает ZFS, что набор данных будет управляться " "изнутри клетки, поэтому хост-система автоматически перестаёт его монтировать." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2301 msgid "" "Next, allow the jail to mount ZFS filesystems and attach the dataset when " "the jail is created. Add the following to the jail's section in " "[.filename]#/etc/jail.conf#:" msgstr "" "Далее, разрешите клетке монтировать файловые системы ZFS и присоединять " "набор данных при создании клетки. Добавьте следующее в раздел клетки в " "[.filename]#/etc/jail.conf#:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2308 #, no-wrap msgid "" "allow.mount;\n" "allow.mount.zfs;\n" "enforce_statfs = 1;\n" "exec.created += \"zfs jail ${name} zroot/jails/data\";\n" msgstr "" "allow.mount;\n" "allow.mount.zfs;\n" "enforce_statfs = 1;\n" "exec.created += \"zfs jail ${name} zroot/jails/data\";\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2313 msgid "" "The `allow.mount.zfs` permission takes effect only together with " "`allow.mount` and an `enforce_statfs` value below 2; see crossref:jails[jail-" "more-options,More Jail Options] for the mount permissions and how they " "interact with `enforce_statfs`. Because a delegated dataset is detached " "when the jail stops, the `exec.created` hook re-attaches it on every start, " "where `${name}` expands to the jail name. The same attachment can be " "performed against an already running jail with `zfs jail zroot/" "jails/data`." msgstr "" "Права `allow.mount.zfs` действуют только вместе с `allow.mount` и значением " "`enforce_statfs` ниже 2; см. crossref:jails[jail-more-options,More Jail " "Options] для прав на монтирование и их взаимодействия с `enforce_statfs`. " "Поскольку делегированный набор данных отсоединяется при остановке клетки, " "хук `exec.created` повторно присоединяет его при каждом запуске, где `${name}" "` расширяется до имени клетки. То же присоединение можно выполнить к уже " "запущенной клетке с помощью команды `zfs jail zroot/jails/data`." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2318 msgid "" "The jail needs access to [.filename]#/dev/zfs#. The default devfs ruleset " "for jails (`devfsrules_jail`, ruleset 4) already unhides it, so no custom " "devfs ruleset is required for ZFS delegation." msgstr "" "Клетке требуется доступ к [.filename]#/dev/zfs#. Стандартный набор правил " "devfs для клеток (`devfsrules_jail`, набор правил 4) уже открывает его, " "поэтому для делегирования ZFS не требуется пользовательский набор правил " "devfs." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2321 msgid "" "Inside the jail, mount the delegated datasets and manage them like any other:" msgstr "" "Внутри клетки смонтируйте делегированные наборы данных и управляйте ими как " "любыми другими:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2327 #, no-wrap msgid "" "# zfs mount -a\n" "# zfs create zroot/jails/data/work\n" "# zfs snapshot zroot/jails/data/work@monday\n" msgstr "" "# zfs mount -a\n" "# zfs create zroot/jails/data/work\n" "# zfs snapshot zroot/jails/data/work@monday\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2330 msgid "" "The jailed root user can create, snapshot, clone, and roll back datasets " "under the delegated tree, but the `quota` property of the delegated dataset " "can only be set from the host." msgstr "" "root-пользователь в клетке может создавать, делать снимки, клонировать и " "откатывать наборы данных в делегированном дереве, но свойство `quota` " "делегированного набора данных может быть установлено только с хоста-системы." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:2332 #, no-wrap msgid "Attaching Datasets Automatically" msgstr "Автоматическое подключение наборов данных" #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2338 msgid "" "The `zfs.dataset` parameter requires FreeBSD 15.0. It is not present in the " "man:jail[8] of FreeBSD 14.3." msgstr "" "Параметр `zfs.dataset` требует FreeBSD 15.0. Он отсутствует в man:jail[8] " "для FreeBSD 14.3." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2342 msgid "" "Starting with FreeBSD 15.0, man:jail[8] can attach datasets on its own, " "removing the need for the manual `jailed` and `zfs jail` steps. List the " "datasets to delegate in the `zfs.dataset` parameter:" msgstr "" "Начиная с FreeBSD 15.0, man:jail[8] может самостоятельно подключать наборы " "данных, устраняя необходимость в ручных шагах `jailed` и `zfs jail`. " "Перечислите наборы данных для делегирования в параметре `zfs.dataset`:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2349 #, no-wrap msgid "" "allow.mount;\n" "allow.mount.zfs;\n" "enforce_statfs = 1;\n" "zfs.dataset = \"zroot/jails/data\";\n" msgstr "" "allow.mount;\n" "allow.mount.zfs;\n" "enforce_statfs = 1;\n" "zfs.dataset = \"zroot/jails/data\";\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2353 msgid "" "man:jail[8] attaches each listed dataset when the jail starts, so the " "`exec.created` hook shown above is no longer needed. The parameter requires " "`allow.mount.zfs` to be set." msgstr "" "man:jail[8] присоединяет каждый перечисленный набор данных при запуске " "клетки, поэтому показанный выше хук `exec.created` больше не требуется. Этот " "параметр требует, чтобы было установлено значение `allow.mount.zfs`." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2355 msgid "" "For unmaintained jail managers that do not yet understand `zfs.dataset`, the " "rc.d/jail startup script also honors the legacy variable " "`jail__zfs_dataset` in [.filename]#/etc/rc.conf#." msgstr "" "Для неустаревших менеджеров клеток, которые еще не понимают `zfs.dataset`, " "стартовый сценарий rc.d/jail также учитывает устаревшую переменную " "`jail__zfs_dataset` в [.filename]#/etc/rc.conf#." #. type: Title === #: documentation/content/en/books/handbook/jails/_index.adoc:2357 #, no-wrap msgid "Accessing Snapshots from Inside a Jail" msgstr "Доступ к снимкам изнутри клетки" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2361 msgid "" "The `zfs.mount_snapshot` parameter, available on FreeBSD 14.x and 15.x, lets " "jailed users reach snapshot contents without delegating a whole dataset. " "When set to `1`, jailed users may read the contents of a filesystem's " "snapshots under its [.filename]#.zfs/snapshot# directory:" msgstr "" "Параметр `zfs.mount_snapshot`, доступный в FreeBSD 14.x и 15.x, позволяет " "пользователям внутри клетки получать доступ к содержимому снимков без " "делегирования всего набора данных. Когда он установлен в значение `1`, " "пользователи клетки могут читать содержимое снимков файловой системы в её " "каталоге [.filename]#.zfs/snapshot#:" #. type: delimited block . 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2365 #, no-wrap msgid "zfs.mount_snapshot = 1;\n" msgstr "zfs.mount_snapshot = 1;\n" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2370 msgid "" "This is convenient for restoring individual files from host-taken " "snapshots. If `allow.mount.zfs` is also set, the snapshots may additionally " "be mounted inside the jail. The dataset's `snapdir` property controls " "whether the [.filename]#.zfs# directory is visible." msgstr "" "Это удобно для восстановления отдельных файлов из снимков, сделанных на хост-" "системе. Если также установлено `allow.mount.zfs`, снимки могут быть " "дополнительно смонтированы внутри клетки. Свойство `snapdir` набора данных " "управляет тем, будет ли виден каталог [.filename]#.zfs#." #. type: delimited block = 4 #: documentation/content/en/books/handbook/jails/_index.adoc:2375 msgid "" "A delegated dataset combined with `allow.mount.zfs` lets the jailed root " "user set mount-related ZFS properties and mount filesystems inside the " "jail. Grant these permissions deliberately, and only to jails that are " "trusted to manage their own storage." msgstr "" "Делегированный набор данных в сочетании с `allow.mount.zfs` позволяет root-" "пользователю внутри клетки устанавливать связанные с монтированием свойства " "ZFS и монтировать файловые системы внутри клетки. Предоставляйте эти " "разрешения обдуманно и только тем клеткам, которым доверено управлять " "собственным хранилищем." #. type: Title == #: documentation/content/en/books/handbook/jails/_index.adoc:2378 #, no-wrap msgid "Jail Managers and Containers" msgstr "Менеджеры клеток и контейнеры" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2381 msgid "" "As previously explained, each type of FreeBSD Jail can be created and " "configured manually, but FreeBSD also has third-party utilities to make " "configuration and administration easier." msgstr "" "Как уже объяснялось ранее, каждый тип клетки FreeBSD может быть создан и " "настроен вручную, но в FreeBSD также существуют сторонние утилиты для " "упрощения настройки и администрирования." #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2383 msgid "Below is an incomplete list of the different FreeBSD Jail managers:" msgstr "Ниже приведён неполный список различных менеджеров клеток FreeBSD:" #. type: Block title #: documentation/content/en/books/handbook/jails/_index.adoc:2384 #, no-wrap msgid "Jail Managers" msgstr "Менеджеры клеток" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2387 #, no-wrap msgid "Name" msgstr "Имя" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2387 #, no-wrap msgid "License" msgstr "Лицензия" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2387 #, no-wrap msgid "Package" msgstr "Пакет" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2389 #, no-wrap msgid "Documentation" msgstr "Documentation" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2390 #, no-wrap msgid "BastilleBSD" msgstr "BastilleBSD" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2391 #: documentation/content/en/books/handbook/jails/_index.adoc:2396 #: documentation/content/en/books/handbook/jails/_index.adoc:2406 #, no-wrap msgid "BSD-3" msgstr "BSD-3" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2392 #, no-wrap msgid "package:sysutils/bastille[]" msgstr "package:sysutils/bastille[]" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2394 #, no-wrap msgid "link:https://bastille.readthedocs.io/en/latest/[Documentation]" msgstr "link:https://bastille.readthedocs.io/ru/latest/[Документация]" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2395 #, no-wrap msgid "pot" msgstr "pot" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2397 #, no-wrap msgid "package:sysutils/pot[]" msgstr "package:sysutils/pot[]" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2399 #, no-wrap msgid "link:https://pot.pizzamig.dev/[Documentation]" msgstr "link:https://pot.pizzamig.dev/[Документация]" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2400 #, no-wrap msgid "cbsd" msgstr "cbsd" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2401 #: documentation/content/en/books/handbook/jails/_index.adoc:2411 #, no-wrap msgid "BSD-2" msgstr "BSD-2" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2402 #, no-wrap msgid "package:sysutils/cbsd[]" msgstr "package:sysutils/cbsd[]" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2404 #, no-wrap msgid "link:https://github.com/cbsd/cbsd[Documentation]" msgstr "link:https://github.com/cbsd/cbsd[Документация]" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2405 #, no-wrap msgid "AppJail" msgstr "AppJail" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2407 #, no-wrap msgid "package:sysutils/appjail[], for devel package:sysutils/appjail-devel[]" msgstr "package:sysutils/appjail[], для разработки package:sysutils/appjail-devel[]" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2409 #, no-wrap msgid "link:https://github.com/DtxdF/AppJail#getting-started[Documentation]" msgstr "link:https://github.com/DtxdF/AppJail#getting-started[Документация]" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2410 #, no-wrap msgid "iocage" msgstr "iocage" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2412 #, no-wrap msgid "package:sysutils/iocage[]" msgstr "package:sysutils/iocage[]" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2414 #, no-wrap msgid "link:https://freebsd.github.io/iocage/[Documentation]" msgstr "link:https://freebsd.github.io/iocage/[Документация]" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2415 #, no-wrap msgid "ezjail" msgstr "ezjail" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2416 #, no-wrap msgid "link:https://erdgeist.org/beerware.html[Beer Ware]" msgstr "link:https://erdgeist.org/beerware.html[Пивная Лицензия]" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2417 #, no-wrap msgid "package:sysutils/ezjail[]" msgstr "package:sysutils/ezjail[]" #. type: Table #: documentation/content/en/books/handbook/jails/_index.adoc:2419 #, no-wrap msgid "link:https://erdgeist.org/arts/software/ezjail/[Documentation]" msgstr "link:https://erdgeist.org/arts/software/ezjail/[Документация]" #. type: Plain text #: documentation/content/en/books/handbook/jails/_index.adoc:2421 msgid "" "FreeBSD has published official OCI base-system images since FreeBSD 14.3-" "RELEASE, and OCI (Docker-style) containers (which are built on the same jail " "technology and managed with the Podman toolkit) are covered in the " "crossref:containers[containers,Containers] chapter, which complements the " "native jails described here." msgstr "" "FreeBSD публикует официальные OCI-образы базовой системы, начиная с FreeBSD " "14.3-RELEASE, а OCI-контейнеры (стиль Docker), которые построены на той же " "технологии клеток и управляются с помощью инструментария Podman, " "рассматриваются в главе crossref:containers[containers,Контейнеры], которая " "дополняет обычные клетки, описанные здесь." #~ msgid "" #~ "A thin jail shares the base system using OpenZFS snapshots or NullFS " #~ "mounts from a template. Only a minimal subset of base system is " #~ "duplicated for each thin jail, resulting in less resource consumption " #~ "compared to a thick jail. However, this also means that thin jails have " #~ "less isolation and independence compared to thick jails. Changes in " #~ "shared components could potentially affect multiple thin jails " #~ "simultaneously." #~ msgstr "" #~ "Тонкая клетка (thin jail) использует базовую систему через снимки OpenZFS " #~ "или монтирования NullFS из шаблона. Для каждой тонкой клетки дублируется " #~ "лишь минимальное подмножество базовой системы, что приводит к меньшему " #~ "потреблению ресурсов по сравнению с толстой клеткой. Однако это также " #~ "означает, что тонкие клетки обладают меньшей изоляцией и независимостью " #~ "по сравнению с толстыми. Изменения в общих компонентах могут потенциально " #~ "затрагивать несколько тонких клеток одновременно." #~ msgid "" #~ "In host networking mode, a jail shares the same networking stack as the " #~ "host system. When a jail is created in host networking mode it uses the " #~ "same network interface and IP address. This means that the jail does not " #~ "have a separate IP address, and its network traffic is associated with " #~ "the host's IP." #~ msgstr "" #~ "В режиме сетевого взаимодействия хоста (host networking) клетка " #~ "использует тот же сетевой стек, что и хост-система. При создании клетки в " #~ "этом режиме она использует тот же сетевой интерфейс и IP-адрес. Это " #~ "означает, что клетка не имеет отдельного IP-адреса, и его сетевой трафик " #~ "ассоциируется с IP-адресом хоста." #~ msgid "" #~ "`mount.devfs` - Mount a man:devfs[5] filesystem on the chrooted " #~ "[.filename]#/dev# directory, and apply the ruleset in the devfs_ruleset " #~ "parameter to restrict the devices visible inside the jail." #~ msgstr "" #~ "`mount.devfs` — подключает файловую систему man:devfs[5] в каталоге " #~ "[.filename]#/dev# внутри chroot и применяет набор правил из параметра " #~ "devfs_ruleset, чтобы ограничить видимость устройств внутри клетки." #~ msgid "" #~ "`ip4.addr` - IPv4 address. There are two configuration possibilities for " #~ "IPv4. The first is to establish an IP or a list of IPs as has been done " #~ "in the example. The other is to use `ip4` instead and set the `inherit` " #~ "value to inherit the host's IP address." #~ msgstr "" #~ "`ip4.addr` — IPv4-адрес. Существует два варианта настройки IPv4. Первый — " #~ "указать IP-адрес или список IP-адресов, как показано в примере. Второй — " #~ "использовать параметр `ip4` со значением `inherit`, чтобы унаследовать IP-" #~ "адрес хоста." #~ msgid "" #~ "`ip6.addr` - IPv6 address. There are two configuration possibilities for " #~ "IPv6. The first is to establish an IP or a list of IPs as has been done " #~ "in the example. The other is to use `ip6` instead and set the `inherit` " #~ "value to inherit the host's IP address." #~ msgstr "" #~ "`ip6.addr` — IPv6-адрес. Существует два варианта настройки для IPv6. " #~ "Первый — указать IP или список IP, как это сделано в примере. Второй — " #~ "использовать `ip6` и установить значение `inherit` для наследования IP-" #~ "адреса хоста." #, no-wrap #~ msgid "Creating a VNET Jail" #~ msgstr "Создание клетки VNET" #~ msgid "Represents the IP of the Jail, it must be *unique*." #~ msgstr "Представляет IP-адрес клетки, он должен быть *уникальным*." #, no-wrap #~ msgid "Creating a Linux Jail" #~ msgstr "Создание клетки Linux" #~ msgid "" #~ "Once the jail has been created as explained above, execute the following " #~ "command to perform required configuration for the jail and start it:" #~ msgstr "" #~ "После создания клетки, как описано выше, выполните следующую команду для " #~ "выполнения необходимой конфигурации и запуска клетки:" #~ msgid "" #~ "To access the jail, it will be necessary to install package:sysutils/" #~ "debootstrap[]." #~ msgstr "" #~ "Для доступа к клетке необходимо установить пакет package:sysutils/" #~ "debootstrap[]." #~ msgid "Execute the following command to access the FreeBSD Linux jail:" #~ msgstr "Выполните следующую команду для доступа к клетке FreeBSD Linux:" #~ msgid "" #~ "Inside the jail, execute the following commands to install " #~ "package:sysutils/debootstrap[] and prepare the Ubuntu environment:" #~ msgstr "" #~ "Внутри клетки выполните следующие команды для установки пакета " #~ "package:sysutils/debootstrap[] и подготовки окружения Ubuntu:" #, no-wrap #~ msgid "Configuring Service Jails" #~ msgstr "Настройка сервисных клеток" #, no-wrap #~ msgid "# service jail stop jailname\n" #~ msgstr "# service jail stop jailname\n" #~ msgid "" #~ "Finally, it will be necessary to remove the jail entry in [.filename]#/" #~ "etc/jail.conf# or in [.filename]#jail.conf.d#." #~ msgstr "" #~ "Наконец, необходимо удалить запись о клетке в [.filename]#/etc/jail.conf# " #~ "или в [.filename]#jail.conf.d#." #~ msgid "" #~ "For example to upgrade from 13.1-RELEASE to 13.2-RELEASE, execute the " #~ "following commands on the host:" #~ msgstr "" #~ "Например, для обновления с 13.1-RELEASE до 13.2-RELEASE выполните " #~ "следующие команды на хосте:" #~ msgid "" #~ "It is necessary to execute the `install` step two times. The first one " #~ "upgrades the kernel, and the second one upgrades the rest of the " #~ "components." #~ msgstr "" #~ "Необходимо выполнить шаг `install` дважды. Первый раз обновляется ядро, а " #~ "второй — остальные компоненты." #, no-wrap #~ msgid "link:https://www.bsdstore.ru/en/docs.html[Documentation]" #~ msgstr "link:https://github.com/cbsd/cbsd[Документация]" #, no-wrap #~ msgid "link:https://iocage.readthedocs.io/en/latest/[Documentation]" #~ msgstr "link:https://iocage.readthedocs.io/en/latest/[Документация]"