From 837a4358b82f4c0a2fe82ca3381afdd929979d09 Mon Sep 17 00:00:00 2001 From: Dominik Meyer Date: Sun, 18 Aug 2024 13:10:41 +0200 Subject: [PATCH] feat: support dump and recovery mode --- server/Containerfile | 4 +++- server/inetd.conf | 1 + server/scripts/entryPoint.sh | 12 ++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 server/inetd.conf diff --git a/server/Containerfile b/server/Containerfile index dcb3a08..a17b589 100644 --- a/server/Containerfile +++ b/server/Containerfile @@ -22,7 +22,7 @@ FROM debian:stable-slim RUN apt-get -qy update && apt-get -qy upgrade RUN apt-get -qy install git libssl3 bash perl libglib2.0 swig libtirpc3 libreadline8 \ libxslt1.1 libxml-simple-perl libjson-perl procps -RUN apt-get -qy install tini +RUN apt-get -qy install tini openbsd-inetd COPY --from=builder /usr/local/ /usr/local/ @@ -34,6 +34,8 @@ ENV LD_LIBRARY_PATH /usr/local/share/perl5/site_perl/auto/Amanda/Debug/ ADD scripts/entryPoint.sh /entryPoint.sh RUN chmod +x /entryPoint.sh +COPY inetd.conf /etc/inetd.conf + USER backup ENTRYPOINT ["/usr/bin/tini", "--", "/entryPoint.sh"] \ No newline at end of file diff --git a/server/inetd.conf b/server/inetd.conf new file mode 100644 index 0000000..c73453d --- /dev/null +++ b/server/inetd.conf @@ -0,0 +1 @@ +amanda stream tcp nowait backup /usr/local/libexec/amanda/amandad amandad -auth=ssl amindexd amidxtaped \ No newline at end of file diff --git a/server/scripts/entryPoint.sh b/server/scripts/entryPoint.sh index 6c19d2e..7ce1410 100644 --- a/server/scripts/entryPoint.sh +++ b/server/scripts/entryPoint.sh @@ -5,9 +5,21 @@ if [ -z ${AMANDA_CONFIG} ]; then AMANDA_CONFIG="server" fi +if [ -z ${AMANDA_MODE} ]; then + AMANDA_MODE="dump" +fi + +if [ "${AMANDA_MODE}" == "dump" ]; then + amcleanup -k ${AMANDA_CONFIG} amcheck ${AMANDA_CONFIG} amdump ${AMANDA_CONFIG} amstatus ${AMANDA_CONFIG} +else + inetd -d /etc/inetd.conf +fi + + + exit 0 \ No newline at end of file