Skip to content

Commit

Permalink
Docker/entrypoint: support disk mounting in service container
Browse files Browse the repository at this point in the history
Signed-off-by: Lijin Xiong <[email protected]>
  • Loading branch information
Lijin Xiong committed Mar 3, 2023
1 parent 51f8531 commit aaaffe2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions docker/debian9/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
############################ GLOBAL VARIABLES
g_role=""
g_args=""
g_disk=""
g_prefix=""
g_preexec=""
g_binary=""
g_start_args=""
disk_mount_point=/curvebs/chunkserver/data

############################ BASIC FUNCTIONS
function msg() {
Expand Down Expand Up @@ -52,6 +54,10 @@ function get_options() {
g_args=$2
shift 2
;;
-d|--disk)
g_disk=$2
shift 2
;;
-h)
usage
exit 1
Expand Down Expand Up @@ -81,6 +87,11 @@ function prepare() {
g_start_args="--confPath $conf_path"
;;
chunkserver)
if [ "$g_disk" ]; then
[[ ! -d $disk_mount_point ]] && die "disk mount point $disk_mount_point does not exist.\n"
mount -o rw,errors=remount-ro $g_disk $disk_mount_point
[[ $? -ne 0 ]] && die "mount disk device $g_disk to $disk_mount_point failed.\n"
fi
g_binary="$g_prefix/sbin/curvebs-chunkserver"
g_start_args="--conf=$conf_path"
;;
Expand Down

0 comments on commit aaaffe2

Please sign in to comment.