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]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
* bkctld-init: create "incs/\<jail\>" directory for jails
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
|
@ -12,11 +12,12 @@ if [ -z "${jail_name}" ]; then
|
||||||
show_help && exit 1
|
show_help && exit 1
|
||||||
fi
|
fi
|
||||||
jail_path=$(jail_path "${jail_name}")
|
jail_path=$(jail_path "${jail_name}")
|
||||||
|
incs_path=$(incs_path "${jail_name}")
|
||||||
|
|
||||||
test -d "${jail_path}" && error "Skip jail \`${jail_name}' : it already exists"
|
test -d "${jail_path}" && error "Skip jail \`${jail_name}' : it already exists"
|
||||||
|
|
||||||
# Create config and jails directory
|
# Create config, jails and incs directories
|
||||||
mkdir --parents "${CONFDIR}" "${JAILDIR}"
|
mkdir --parents "${CONFDIR}" "${JAILDIR}" "${INCDIR}"
|
||||||
|
|
||||||
if is_btrfs "$(dirname "${JAILDIR}")" || is_btrfs "${JAILDIR}"; then
|
if is_btrfs "$(dirname "${JAILDIR}")" || is_btrfs "${JAILDIR}"; then
|
||||||
btrfs_bin=$(command -v btrfs)
|
btrfs_bin=$(command -v btrfs)
|
||||||
|
@ -28,6 +29,8 @@ else
|
||||||
mkdir --parents "${jail_path}"
|
mkdir --parents "${jail_path}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
mkdir --parents "${incs_path}"
|
||||||
|
|
||||||
setup_jail_chroot "${jail_name}"
|
setup_jail_chroot "${jail_name}"
|
||||||
setup_jail_config "${jail_name}"
|
setup_jail_config "${jail_name}"
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,11 @@ load test_helper
|
||||||
run test -e "${CONFDIR}/${JAILNAME}.d/incs_policy"
|
run test -e "${CONFDIR}/${JAILNAME}.d/incs_policy"
|
||||||
[ "${status}" -eq 0 ]
|
[ "${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" {
|
@test "Normal inc creation" {
|
||||||
/usr/lib/bkctld/bkctld-inc
|
/usr/lib/bkctld/bkctld-inc
|
||||||
|
|
Loading…
Reference in a new issue