forked from evolix/evobackup
bkctld-init: create "incs/\<jail\>" directory for jails
This commit is contained in:
parent
f9a295daae
commit
89b0636cf6
|
@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
* bkctld-init: create "incs/\<jail\>" directory for jails
|
||||
|
||||
### Changed
|
||||
|
||||
### Deprecated
|
||||
|
||||
### Removed
|
||||
|
|
|
@ -12,11 +12,12 @@ if [ -z "${jail_name}" ]; then
|
|||
show_help && exit 1
|
||||
fi
|
||||
jail_path=$(jail_path "${jail_name}")
|
||||
incs_path=$(incs_path "${jail_name}")
|
||||
|
||||
test -d "${jail_path}" && error "Skip jail \`${jail_name}' : it already exists"
|
||||
|
||||
# Create config and jails directory
|
||||
mkdir --parents "${CONFDIR}" "${JAILDIR}"
|
||||
# Create config, jails and incs directories
|
||||
mkdir --parents "${CONFDIR}" "${JAILDIR}" "${INCDIR}"
|
||||
|
||||
if is_btrfs "$(dirname "${JAILDIR}")" || is_btrfs "${JAILDIR}"; then
|
||||
btrfs_bin=$(command -v btrfs)
|
||||
|
@ -28,6 +29,8 @@ else
|
|||
mkdir --parents "${jail_path}"
|
||||
fi
|
||||
|
||||
mkdir --parents "${incs_path}"
|
||||
|
||||
setup_jail_chroot "${jail_name}"
|
||||
setup_jail_config "${jail_name}"
|
||||
|
||||
|
|
|
@ -9,6 +9,11 @@ load test_helper
|
|||
run test -e "${CONFDIR}/${JAILNAME}.d/incs_policy"
|
||||
[ "${status}" -eq 0 ]
|
||||
}
|
||||
@test "Inc directory after jail init" {
|
||||
# An incs_policy file should exist
|
||||
run test -d "${INCDIR}/${JAILNAME}"
|
||||
[ "${status}" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "Normal inc creation" {
|
||||
/usr/lib/bkctld/bkctld-inc
|
||||
|
|
Loading…
Reference in a new issue