From ca2b75e8c0fdfaea79e8360d08145b7646ba038e Mon Sep 17 00:00:00 2001 From: Barry McCormick Date: Fri, 20 Oct 2023 22:28:00 -0700 Subject: [PATCH 1/3] added iocage migration doc --- docs/chapters/migration.rst | 36 ++++++++++++++++++++++++++++++++++++ docs/index.rst | 1 + 2 files changed, 37 insertions(+) create mode 100644 docs/chapters/migration.rst diff --git a/docs/chapters/migration.rst b/docs/chapters/migration.rst new file mode 100644 index 00000000..2bcb4313 --- /dev/null +++ b/docs/chapters/migration.rst @@ -0,0 +1,36 @@ +Stop the running jail and export it: + +.. code-block:: shell + + iocage stop jailname + iocage export jailname + +Move the backup files (.zip and .sha256) into Bastille backup dir (default: /usr/local/bastille/backups/): + +.. code-block:: shell + + mv /iocage/images/jailname_2020-03-26.* /usr/local/bastille/backups/ + +for remote systems you could use rsync: + +.. code-block:: shell + + rsync -avh /iocage/images/jailname_2020-03-26.* root@10.0.1.10:/usr/local/bastille/backups/ + + +Import the iocage backup file (use zip file name) + +.. code-block:: shell + + bastille import jailname_2020-03-26.zip + +Set your new ip address and interface: + +.. code-block:: shell + + vim /usr/local/bastille/jails/jailname/jail.conf + interface = bastille0; + ip4.addr = "192.168.0.1"; + + +You can use you primary network interface instead of the virtual bastille0 interface as well if you know what you’re doing. diff --git a/docs/index.rst b/docs/index.rst index 8dbc2637..1551706f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -21,6 +21,7 @@ https://docs.bastillebsd.org. chapters/jail-config chapters/zfs-support chapters/gcp + chapters/migration copyright From b0ba336d7e09f5b61f3a6c80e0f3591b1ba73651 Mon Sep 17 00:00:00 2001 From: Barry McCormick Date: Wed, 25 Oct 2023 21:14:40 -0700 Subject: [PATCH 2/3] documented .hushlogin and uname in jails --- docs/chapters/subcommands/create.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/chapters/subcommands/create.rst b/docs/chapters/subcommands/create.rst index eb9a9677..d3543639 100644 --- a/docs/chapters/subcommands/create.rst +++ b/docs/chapters/subcommands/create.rst @@ -31,3 +31,12 @@ ranges include: Bastille does its best to validate the submitted ip is valid. This has not been thouroughly tested--I generally use the 10/8 range. + +One point to be made about jails. If you run uname inside a jail you will not +get the information about the jail, but about the host system. If you want accurate +information about the jail please use freebsd-version inside the jail. + +Also, the MOTD also was reporting the host system instead of the jail. This +caused a lot of confusion for users, so the MOTD was disabled by the use of +the .hushlogin file. This prevents confusing contradictory information to be +shown to the user. From 440b24371bdd80f11ac514fb45ef57c47feaf015 Mon Sep 17 00:00:00 2001 From: Barry McCormick Date: Wed, 25 Oct 2023 21:36:01 -0700 Subject: [PATCH 3/3] update filenames --- docs/chapters/migration.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/chapters/migration.rst b/docs/chapters/migration.rst index 2bcb4313..f297558b 100644 --- a/docs/chapters/migration.rst +++ b/docs/chapters/migration.rst @@ -9,20 +9,20 @@ Move the backup files (.zip and .sha256) into Bastille backup dir (default: /usr .. code-block:: shell - mv /iocage/images/jailname_2020-03-26.* /usr/local/bastille/backups/ + mv /iocage/images/jailname_$(date +%F).* /usr/local/bastille/backups/ for remote systems you could use rsync: .. code-block:: shell - rsync -avh /iocage/images/jailname_2020-03-26.* root@10.0.1.10:/usr/local/bastille/backups/ + rsync -avh /iocage/images/jailname_$(date +%F).* root@10.0.1.10:/usr/local/bastille/backups/ Import the iocage backup file (use zip file name) .. code-block:: shell - bastille import jailname_2020-03-26.zip + bastille import jailname_$(date +%F).zip Set your new ip address and interface: