diff --git a/Dockerfile b/Dockerfile index f3f150d..6011e79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,9 +8,9 @@ RUN microdnf install -y epel-release \ && microdnf remove -y \ libsemanage \ shadow-utils \ - && mkdir /var/run/{nut,upsmon} \ - && chown nut /var/run/{nut,upsmon} \ - && chmod o-rwx /var/run/{nut,upsmon} \ + && mkdir /etc/nut /var/run/{nut,upsmon} \ + && chown nut /etc/nut /var/run/{nut,upsmon} \ + && chmod o-rwx /etc/nut /var/run/{nut,upsmon} \ && chmod a-s \ /usr/bin/* \ /usr/sbin/* \ diff --git a/README.md b/README.md index 9a53c53..ea64f88 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ ## Usage -Run it as you please. Not that this image does not generate any automated configuration. +Run it as you please. + +Note that this image does not generate any automated configuration. You can inject config by putting it into the `/var/tmp/nut-config/` directory which gets copied to `/etc/nut` during startup. ## Release Management diff --git a/entrypoint.sh b/entrypoint.sh index 15f19d2..7de7fe4 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,6 +5,10 @@ readonly GROUP=nut set -xe +if [[ -d "/var/tmp/nut-config" ]]; then + cp /var/tmp/nut-config/* /etc/nut/ +fi + /sbin/upsdrvctl -u root start /sbin/upsd ls -al /run/nut