KlaraSystems / jectl

Jail Environments tool
12 stars 3 forks source link

jectl does not clean up after itself if a build fails #1

Open Subito opened 2 years ago

Subito commented 2 years ago
root@files10:~ # poudriere image -j 130x64 -n nginxtest -t zfs+send -z 2022 -B /usr/src/sbin/jectl/generate-je.sh -s 20G -c /home/svbito/overlay -f /root/nginxtest.pkgs
[00:00:00] Preparing the image 'nginxtest'
[00:00:00] Calculated image size 19531m
[00:00:01] [jail environment] generate stream to create new jail
[00:00:02] Installing world with tar
>>> Removing old files (only deletes safe to delete libs)
>>> Old files removed
>>> Removing old directories
>>> Old directories removed
To remove old libraries run 'make delete-old-libs'.
>>> Removing old libraries
Please be sure no application still uses those libraries, else you
can not start such an application. Consult UPDATING for more
information regarding how to cope with the removal/revision bump
of a specific library.
>>> Old libraries removed
[00:02:41] Installing world done
[00:02:41] Installing packages
mount_nullfs: /usr/local/poudriere/data/packages/130x64-default-2022: No such file or directory
[00:02:41] Error while create image. cleaning up.
mdconfig: ioctl(/dev/mdctl): Device busy

Fixing my mistake, trying the build again:

root@files10:~ # poudriere image -j 130x64 -n nginxtest -t zfs+send -z 2022 -B /usr/src/sbin/jectl/generate-je.sh -s 20G -c /home/svbito/overlay -f /root/nginxtest.pkgs
[00:00:00] Error: Target pool name already exists

Destroying the zpool by hand solves this. The md* files are also left, but that maybe doesn't matter?

rob-wing commented 2 years ago

Can you post the contents of the overlay directory and the package list?

Subito commented 2 years ago

Thats probably unrelated. The problem in this case was, that the repository "130x64-default-2022" was still beeing build by poudriere and the folder simply did not exist. I waited a bit for the build to finish and ran the command again and it worked - only that I had to clean up the zpool first that was left by generate-je.sh.

For completeness:

# tree overlay/
overlay/
└── etc
    ├── master.passwd -> /config/master.passwd
    ├── rc.conf -> /config/rc.conf
    └── resolv.conf -> /config/resolv.conf
# cat /root/nginxtest.pkgs
nginx
screen
sudo
ca_root_nss
curl