Skip to content

Commit

Permalink
fix: copy config on start (#2)
Browse files Browse the repository at this point in the history
NUT does not seem to like ConfigMaps
  • Loading branch information
hairmare authored Apr 1, 2024
1 parent ada646d commit 82dd9f6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/* \
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 82dd9f6

Please sign in to comment.