Skip to content

Commit

Permalink
Merge pull request #74 from peng9808/main
Browse files Browse the repository at this point in the history
fix drbd config file not exits sometimes
  • Loading branch information
peng9808 authored Apr 25, 2024
2 parents 9679e30 + 8ee10c3 commit 5c3b600
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 5 deletions.
1 change: 1 addition & 0 deletions docker-drbd9/Dockerfile.bionic
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RUN apt-get update && apt-get install -y kmod gnupg wget make gcc patch curl &&
COPY /drbd.tar.gz /

COPY /pkgs /pkgs
COPY /config-drbd.sh /
COPY /entry.sh /
RUN chmod +x /entry.sh

Expand Down
1 change: 1 addition & 0 deletions docker-drbd9/Dockerfile.flatcar
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ MAINTAINER Roland Kammerer <[email protected]>

COPY /drbd.tar.gz /
COPY /entry.sh /
COPY /config-drbd.sh /
RUN chmod +x /entry.sh
ENTRYPOINT /entry.sh

Expand Down
2 changes: 1 addition & 1 deletion docker-drbd9/Dockerfile.focal
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y kmod gnupg wget make gcc patch curl &&
COPY /drbd.tar.gz /

COPY /pkgs /pkgs

COPY /config-drbd.sh /
COPY /entry.sh /
RUN chmod +x /entry.sh

Expand Down
2 changes: 1 addition & 1 deletion docker-drbd9/Dockerfile.jammy
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN apt-get update && apt-get install -y kmod gnupg wget make gcc patch elfutils
COPY /drbd.tar.gz /

COPY /pkgs /pkgs

COPY /config-drbd.sh /
COPY /entry.sh /
RUN chmod +x /entry.sh
ENTRYPOINT /entry.sh
Expand Down
1 change: 1 addition & 0 deletions docker-drbd9/Dockerfile.kylin10
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ RUN wget --no-check-certificate https://pkg.linbit.com/downloads/drbd/"$([[ $DRB
COPY /pkgs /pkgs
COPY /drbdUtils.tar.gz /
COPY /install-drbdutils.sh /
COPY /config-drbd.sh /
COPY /entry.sh /
RUN chmod +x /entry.sh
ENTRYPOINT /entry.sh
2 changes: 1 addition & 1 deletion docker-drbd9/Dockerfile.rhel7
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN wget --no-check-certificate https://pkg.linbit.com/downloads/drbd/"$([[ $DRB
# =lbbuild COPY /drbd.tar.gz /

COPY /pkgs /pkgs

COPY /config-drbd.sh /
COPY /entry.sh /
RUN chmod +x /entry.sh

Expand Down
2 changes: 1 addition & 1 deletion docker-drbd9/Dockerfile.rhel8
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ RUN wget --no-check-certificate https://pkg.linbit.com/downloads/drbd/"$([[ $DRB

# these are now the kmod pkgs:
COPY /pkgs /pkgs

COPY /config-drbd.sh /
COPY /entry.sh /
RUN chmod +x /entry.sh

Expand Down
2 changes: 1 addition & 1 deletion docker-drbd9/Dockerfile.rhel9
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUN curl -fsSL https://pkg.linbit.com/downloads/drbd/"$([[ $DRBD_VERSION =~ ^9.0

# these are now the kmod pkgs:
COPY /pkgs /pkgs

COPY /config-drbd.sh /
COPY /entry.sh /
RUN chmod +x /entry.sh

Expand Down
13 changes: 13 additions & 0 deletions docker-drbd9/config-drbd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

conf_file="/etc/drbd.conf"
example_file="/usr/share/doc/drbd.../drbd.conf.example"
content_to_append="include \"/etc/drbd.d/global_common.conf\";\ninclude \"/etc/drbd.d/*.res\";"
echo -e "# You can find an example in $example_file\n$content_to_append" > "$conf_file"
echo "Content successfully written to $conf_file."

conf_file2="/etc/drbd.d/global_common.conf"
content_to_write2="global { usage-count no; }"
mkdir -p "$(dirname "$conf_file2")"
echo "$content_to_write2" > "$conf_file2"
echo "Content successfully written to $conf_file2."
5 changes: 5 additions & 0 deletions docker-drbd9/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -371,4 +371,9 @@ else
fi

grep -q '^drbd_transport_tcp' /proc/modules || die "Could not load DRBD kernel modules"

cp /config-drbd.sh /pkgs_root/config-drbd.sh
nsenter --target 1 --mount --uts --ipc --net --pid chmod +x /root/config-drbd.sh
nsenter --target 1 --mount --uts --ipc --net --pid /root/config-drbd.sh

print_drbd_version_and_exit
Binary file not shown.

0 comments on commit 5c3b600

Please sign in to comment.