Skip to content

Commit

Permalink
Merge pull request #45 from peng9808/main
Browse files Browse the repository at this point in the history
fix nsenter bug
  • Loading branch information
peng9808 authored Jan 15, 2024
2 parents bfa6fbf + 4a768fe commit 49d3252
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 2 additions & 0 deletions docker-drbd9/Dockerfile.rhel7
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ RUN ln -vs /usr/bin/python /usr/bin/python3 && \
ln -vs /usr/bin/python /usr/bin/python3.6 && \
yum install -y hostname && yum clean all -y

RUN yum install -y util-linux

ENTRYPOINT /entry.sh
2 changes: 2 additions & 0 deletions docker-drbd9/Dockerfile.rhel8
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ RUN chmod +x /entry.sh
# add python2 hostname
RUN yum install -y python2 hostname && yum clean all -y

RUN yum install -y util-linux

ENTRYPOINT /entry.sh
2 changes: 2 additions & 0 deletions docker-drbd9/Dockerfile.rhel9
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ RUN chmod +x /entry.sh
# add hostname
RUN yum install -y hostname && yum clean all -y

RUN yum install -y util-linux

ENTRYPOINT /entry.sh
21 changes: 12 additions & 9 deletions docker-drbd9/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,15 @@ if [ "$substr" != "deb" ]; then
if [[ -n "$drbd_rpm" && -n "$utils_rpm" ]]; then
cp $drbd_rpm /pkgs_root/drbd.rpm
cp $utils_rpm /pkgs_root/drbd_utils.rpm
nsenter -t 1 -n -u -i -m -- ls /root/
nsenter -t 1 -n -u -i -m -- rpm -ivh /root/drbd.rpm
nsenter -t 1 -n -u -i -m -- rpm -ivh /root/drbd_utils.rpm
ls /root/
nsenter --version
nsenter --target 1 --mount --uts --ipc --net --pid ls /root/
nsenter --target 1 --mount --uts --ipc --net --pid rpm -ivh /root/drbd.rpm
nsenter --target 1 --mount --uts --ipc --net --pid rpm -ivh /root/drbd_utils.rpm
exit_code=$?
if [ $exit_code -eq 0 ]; then
nsenter -t 1 -n -u -i -m -- modprobe drbd
nsenter -t 1 -n -u -i -m -- modprobe drbd_transport_tcp
nsenter --target 1 --mount --uts --ipc --net --pid modprobe drbd
nsenter --target 1 --mount --uts --ipc --net --pid modprobe drbd_transport_tcp
exit_code=$?
if [ $exit_code -eq 0 ]; then
#Notify shipper that installation is complete
Expand All @@ -277,12 +279,13 @@ else
if [[ -n "$drbd_rpm" && -n "$utils_rpm" ]]; then
cp $drbd_deb /pkgs_root/drbd.deb
cp $utils_deb /pkgs_root/drbd_utils.deb
nsenter -t 1 -n -u -i -m -- apt install -y /root/drbd.deb
nsenter -t 1 -n -u -i -m -- apt install -y /root/drbd_utils.deb
nsenter --target 1 --mount --uts --ipc --net --pid ls /root/
nsenter --target 1 --mount --uts --ipc --net --pid rpm -ivh /root/drbd.deb
nsenter --target 1 --mount --uts --ipc --net --pid rpm -ivh /root/drbd_utils.deb
exit_code=$?
if [ $exit_code -eq 0 ]; then
nsenter -t 1 -n -u -i -m -- modprobe drbd
nsenter -t 1 -n -u -i -m -- modprobe drbd_transport_tcp
nsenter --target 1 --mount --uts --ipc --net --pid modprobe drbd
nsenter --target 1 --mount --uts --ipc --net --pid modprobe drbd_transport_tcp
exit_code=$?
if [ $exit_code -eq 0 ]; then
export DRBD_RMP_INSTALL='yes'
Expand Down

0 comments on commit 49d3252

Please sign in to comment.