Skip to content

Commit

Permalink
OS-5783 make .zonecontrol a mount from the GZ instead of a directory …
Browse files Browse the repository at this point in the history
…in the dataset

Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Julien Gilli <julien.gilli@joyent.com>
Approved by: Josh Wilsdon <josh@wilsdon.ca>
  • Loading branch information
joshwilsdon committed Dec 9, 2016
1 parent 78cf711 commit 8074b65
Show file tree
Hide file tree
Showing 8 changed files with 212 additions and 439 deletions.
3 changes: 3 additions & 0 deletions overlay/generic/lib/svc/method/svc-zones
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ case "$1" in
zfs list -H -o name $ZPOOL >/dev/null 2>&1
[ $? -eq 0 ] && setup_manifests

# Create directory for zone sockets
mkdir -m755 -p /var/zonecontrol

egrep -vs '^#|^global:' /etc/zones/index || exit 0 # no local zones

#
Expand Down
1 change: 1 addition & 0 deletions overlay/generic/usr/lib/brand/jcommon/cuninstall
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ fi
[[ -n ${ORIGIN} && ${ORIGIN} != "-" ]] && zfs destroy -F $ORIGIN

rm -rf $ZONEPATH
rm -rf /var/zonecontrol/${ZONENAME}

jcommon_uninstall_hook

Expand Down
3 changes: 3 additions & 0 deletions overlay/generic/usr/lib/brand/jcommon/statechange
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,9 @@ setup_fw()
#
setup_fs()
{
# create directory for metadata socket
mkdir -m755 -p /var/zonecontrol/${ZONENAME}

uname -v > $ZONEPATH/lastbooted
[[ -n "$jst_simplefs" ]] && return

Expand Down
5 changes: 4 additions & 1 deletion overlay/generic/usr/lib/brand/joyent-minimal/platform.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
CDDL HEADER END
Copyright 2015 Joyent, Inc.
Copyright 2016 Joyent, Inc.
DO NOT EDIT THIS FILE.
-->
Expand All @@ -34,6 +34,9 @@
<global_mount special="/dev" directory="/dev" type="dev"
opt="attrdir=%R/root/dev"/>

<global_mount special="/var/zonecontrol/%z" directory="/.zonecontrol"
opt="ro,nodevices,nosetuid,noexec" type="lofs" />

<global_mount special="/lib" directory="/lib"
opt="ro,nodevices" type="lofs" />
<global_mount special="%P/manifests/joyent" directory="/lib/svc/manifest"
Expand Down
4 changes: 3 additions & 1 deletion overlay/generic/usr/lib/brand/joyent/platform.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
CDDL HEADER END
Copyright 2015 Joyent, Inc.
Copyright 2016 Joyent, Inc.
DO NOT EDIT THIS FILE.
-->
Expand All @@ -34,6 +34,8 @@
<global_mount special="/dev" directory="/dev" type="dev"
opt="attrdir=%R/root/dev"/>

<global_mount special="/var/zonecontrol/%z" directory="/.zonecontrol"
opt="ro,nodevices,nosetuid,noexec" type="lofs" />
<global_mount special="/lib" directory="/lib"
opt="ro,nodevices" type="lofs" />
<global_mount special="%P/manifests/joyent"
Expand Down

0 comments on commit 8074b65

Please sign in to comment.