Skip to content

Commit bbf6367

Browse files
author
olevole
committed
jail: add environment/environment_global params
1 parent 3dfad97 commit bbf6367

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

share/jail-arg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ allow_suser \
9292
allow_extattr \
9393
allow_adjtime \
9494
allow_settime \
95+
environment \
96+
environment_global \
9597
"
9698

9799
###

share/local-jails.schema

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exec_master_prestop status exec_timeout exec_fib stop_timeout mount_fdescfs allo
77
emulator_flags allow_kmem exec_consolelog jdomain b_order allow_fdescfs allow_sysvipc protected hidden maintenance name allow_reserved_ports \
88
childrenmax persist enforce_statfs state_time allow_raw_sockets allow_fusefs allow_linprocfs allow_linsysfs allow_read_msgbuf allow_vmm \
99
allow_unprivileged_proc_debug sysvsem sysvshm sysvmsg mnt_start mnt_stop allow_mlock mount_procfs mount_linprocfs mount_linsysfs gid tags \
10-
ci_gw4 zfs_encryption boot_delay allow_nfsd jnameserver allow_suser allow_extattr allow_adjtime allow_settime"
10+
ci_gw4 zfs_encryption boot_delay allow_nfsd jnameserver allow_suser allow_extattr allow_adjtime allow_settime environment_global environment"
1111

1212
jname="text default 0 unique PRIMARY KEY"
1313
jid="integer default 0"
@@ -123,5 +123,8 @@ boot_delay="integer default 0"
123123

124124
jnameserver="text default \"0\""
125125

126+
environment_global="TEXT default \"environment\""
127+
environment="TEXT default \"environment.local\""
128+
126129
INITDB=""
127130
CONSTRAINT=""

upgrade/pre-patch-14.2.6.1

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
#v12.1.3
3+
# Update jails for environment / environment_global
4+
: ${distdir="/usr/local/cbsd"}
5+
[ ! -r "${distdir}/subr/cbsdbootstrap.subr" ] && exit 1
6+
. ${distdir}/subr/cbsdbootstrap.subr || exit 1
7+
test_sql_stuff
8+
9+
[ ! -h "${dbdir}/local.sqlite" ] && exit 0
10+
11+
mydb="${dbdir}/local.sqlite"
12+
13+
unset _test _count
14+
_count=$( ${miscdir}/sqlcli ${mydb} 'SELECT COUNT(jname) FROM jails WHERE emulator="jail"' )
15+
[ "${_count}" = "0" ] && exit 0 # no jails here
16+
17+
_test=$( ${miscdir}/sqlcli ${mydb} "SELECT environment FROM jails LIMIT 1" )
18+
if [ -z "${_test}" ]; then
19+
${ECHO} " * ${N1_COLOR}Update jails tables: add environment${N0_COLOR}"
20+
${miscdir}/sqlcli ${mydb} "ALTER TABLE jails ADD COLUMN environment TEXT default \"environment.local\""
21+
fi
22+
23+
_test=$( ${miscdir}/sqlcli ${mydb} "SELECT environment_global FROM jails LIMIT 1" )
24+
if [ -z "${_test}" ]; then
25+
${ECHO} " * ${N1_COLOR}Update jails tables: add environment_global${N0_COLOR}"
26+
${miscdir}/sqlcli ${mydb} "ALTER TABLE jails ADD COLUMN environment_global TEXT default \"environment\""
27+
fi
28+
29+
exit 0

0 commit comments

Comments
 (0)