Bug 287221 - [NEW PORT] sysutils/jailmanager - simple utility for creating and managing jails
Summary: [NEW PORT] sysutils/jailmanager - simple utility for creating and managing jails
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Hiroki Tagato
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-01 21:23 UTC by Jesse Smith
Modified: 2025-06-06 05:49 UTC (History)
2 users (show)

See Also:


Attachments
Initial port of JailManager (1.54 KB, patch)
2025-06-01 21:23 UTC, Jesse Smith
no flags Details | Diff
Updated jailmanager port with suggested changes (1.52 KB, patch)
2025-06-02 22:49 UTC, Jesse Smith
no flags Details | Diff
Updated port of jail manager (1.53 KB, patch)
2025-06-04 12:04 UTC, Jesse Smith
no flags Details | Diff
Updated port with fixes for host patch level (1.53 KB, patch)
2025-06-05 13:14 UTC, Jesse Smith
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Smith 2025-06-01 21:23:52 UTC
Created attachment 260881 [details]
Initial port of JailManager

This project provides a simple shell script for creating and managing jails. It does not require any dependencies other than Bash and it works on any FreeBSD system (version 13.x and newer) with either the UFS or ZFS filesystem.

Website of the upstream project: https://github.com/slicer69/JailManager
Comment 1 Hiroki Tagato freebsd_committer freebsd_triage 2025-06-02 21:14:50 UTC
Thanks for a new port submission.

A number of comments:
- You don't have to suffix LICENSE_FILE when the port has a single license.
- Use NO_BUILD=yes insted of defining an empty do-make target.
- Probably NO_ARCH=yes should be added since there are no architecture-dependent files installed.
Comment 2 Jesse Smith 2025-06-02 22:49:50 UTC
Created attachment 260910 [details]
Updated jailmanager port with suggested changes
Comment 3 Jesse Smith 2025-06-02 22:50:34 UTC
Thank you for the feedback. I have updated the Makefile with the suggestions and uploaded a fresh version of the port.
Comment 4 Hiroki Tagato freebsd_committer freebsd_triage 2025-06-04 00:49:07 UTC
(In reply to Jesse Smith from comment #3)

Don't remove LICENSE_FILE entirely. Something like the following should be sufficient:
LICENSE_FILE= ${WRKSRC}/LICENSE

In addition, can you check the port files with portlint/portclippy?
Comment 5 Jesse Smith 2025-06-04 12:04:01 UTC
Created attachment 260964 [details]
Updated port of jail manager

Updated patch with link to license file and clean portlint report.
Comment 6 Hiroki Tagato freebsd_committer freebsd_triage 2025-06-05 04:30:16 UTC
(In reply to Jesse Smith from comment #5)

Thanks. Now the port looks fine. However, I got the following error when I installed the port and tried to create a new jail:

$ sudo jm create sample 
Fetching system files for FreeBSD 14.2-RELEASE-p3 ...
fetch: https://download.freebsd.org/ftp/releases/amd64/amd64/14.2-RELEASE-p3/base.txz: Not Found
Creating new jail configuration file for sample
Creating a directory for the new jail...
Installing system files inside the jail...
tar: Error opening archive: Failed to open '/usr/local/jails/media/14.2-RELEASE-p3-base.txz'
Copying configuration files to the jail...
cp: /usr/local/jails/containers/sample/etc/resolv.conf: No such file or directory
cp: /usr/local/jails/containers/sample/etc/localtime: No such file or directory
Jail creation for sample finished.
Consider running 'jm start sample' followed by 'jm update sample' to make sure it is up to date.

Any ideas?
Comment 7 Herbert J. Skuhra 2025-06-05 06:48:17 UTC
(In reply to Hiroki Tagato from comment #6)
According to the git repo the script uses:

  freebsdversion=$(freebsd-version -k)
  echo "Fetching system files for FreeBSD $freebsdversion ..."
  fetch -m https://download.freebsd.org/ftp/releases/amd64/amd64/"$freebsdversion"/base.txz -o /usr/local/jails/media/"$freebsdversion"-base.txz

So this will fail in most cases (STABLE, CURRENT, RELEASE-pX, etc.).
Comment 8 Jesse Smith 2025-06-05 12:00:39 UTC
I see the problem. On my test system freebsd-version is returning the version and -RELEASE tag. Like 14.2-RELEASE or 13.5-RELEASE. It isn't returning patch level from "freebsd-version -k".

I'll add a filter to take out the trailing patch level.
Comment 9 Jesse Smith 2025-06-05 13:14:21 UTC
Created attachment 261001 [details]
Updated port with fixes for host patch level

This patch updates to the latest version of the port which includes checks for the FreeBSD host patch level.
Comment 10 commit-hook freebsd_committer freebsd_triage 2025-06-06 05:48:33 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d8a1de3bd82ebc8689d05ae3354777bf31d199f8

commit d8a1de3bd82ebc8689d05ae3354777bf31d199f8
Author:     Hiroki Tagato <tagattie@FreeBSD.org>
AuthorDate: 2025-06-06 05:41:51 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2025-06-06 05:41:51 +0000

    sysutils/jailmanager: add port: Simple shell script for managing FreeBSD jails

    JailManager is a shell script for creating, managing,
    updating, and removing jails. It handles initializing the
    underlying FreeBSD system, creating jails, handling initial
    configuration, updates, and starting/stopping jails.

    JailManager runs on FreeBSD 13.x and newer. It does
    not require ZFS and works on any BSD filesystem.

    WWW: https://github.com/slicer69/jailmanager

    PR:             287221
    Reported by:    Jesse Smith <jsmith@resonatingmedia.com> (new maintainer)
    Reviewed by:    Herbert J. Skuhra <herbert@gojira.at>

 sysutils/Makefile                    |  1 +
 sysutils/jailmanager/Makefile (new)  | 24 ++++++++++++++++++++++++
 sysutils/jailmanager/distinfo (new)  |  3 +++
 sysutils/jailmanager/pkg-descr (new) |  7 +++++++
 4 files changed, 35 insertions(+)
Comment 11 Hiroki Tagato freebsd_committer freebsd_triage 2025-06-06 05:49:14 UTC
Committed, thanks!