Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to mount /etc/apcupsd/ as a volume #1

Closed
AndreaPro opened this issue Jul 10, 2021 · 4 comments
Closed

Unable to mount /etc/apcupsd/ as a volume #1

AndreaPro opened this issue Jul 10, 2021 · 4 comments

Comments

@AndreaPro
Copy link

Hello, I wanted to mount /etc/apcupsd as a volume.
This is the docker-compose that I am using:

services:
  apcupsd:
    container_name: apcupsd
    devices:
    - /dev/bus/usb/001/006
    environment:
      TZ: Europe/Rome
    image: gregewing/apcupsd:latest
    ports:
    - published: 3551
      target: 3551
    privileged: true
    volumes:
    - /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket:rw
    - /apps/apcupsd/config:/etc/apcupsd:rw
version: '3.3'

This is the error that I see if I run docker-compose logs -f

Attaching to apcupsd
apcupsd    | 0.005 apcupsd: drivers.c:182 Warning: no UPS driver found (ups->mode.type=0).
apcupsd    | apcupsd FATAL ERROR in apcupsd.c at line 196
apcupsd    | Apcupsd cannot continue without a valid driver.
apcupsd exited with code 1

If I remove - /apps/apcupsd/config:/etc/apcupsd:rw from the compose file I have a working container without errors but I have to reconfigure it every time and is not very pratical to use it in this way

@gregewing
Copy link
Owner

Hi, thanks for trying out my container.

Removing the ‘confit’ volume will mean that you don’t get persistent configuration. What I’d recommend here is to run it once without the volume, configure it and then copy the resultant config file out from the running container. Then put that config file in the folder on the host and re-add the volume list e to your compose. This should mean that you get your customised config file each time the container starts.

@AndreaPro
Copy link
Author

Yes, I know that without mounting the volume the configuration won't survive a container recreation, I've created the issue because on other containers I am able to mount the directory on the host from the first start and I am able to manage all the configurations from there without getting errors. I will try your suggestion and let you know.
Nice work with this container btw, I was exactly looking at something like this

@gregewing
Copy link
Owner

Hi, just wanted to check if you were able to resolve the problem ?

@gregewing
Copy link
Owner

Closing issue as there have been no updated in a month.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants