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

Missing DB File by using Docker From Ubuntu:20.04 #2403

Open
dzygann opened this issue Dec 12, 2021 · 0 comments
Open

Missing DB File by using Docker From Ubuntu:20.04 #2403

dzygann opened this issue Dec 12, 2021 · 0 comments

Comments

@dzygann
Copy link

dzygann commented Dec 12, 2021

Hi,

I don't see the mosquitto.db when I build a ubuntu dockerfile with a running mosquitto instance in it.
I would expect to see it in the /var/log/mosquitto, but it isn't there. Do I have to activate it firstly?
Here's my dockerfile:

From ubuntu:20.04
  
RUN apt-get update -y && apt-get install -y \
        openssl \
        mosquitto \
        apt-utils


EXPOSE 1883

RUN echo "\npersistence_file mosquitto.db" >> /etc/mosquitto/mosquitto.conf
RUN echo "\nlog_type all" >> /etc/mosquitto/mosquitto.conf

ENTRYPOINT ["mosquitto"]

CMD ["-c", "/etc/mosquitto/mosquitto.conf"]

This is the log from the docker:

root@d83f5d541aae:/# tail -f /var/log/mosquitto/mosquitto.log 
1639319954: mosquitto version 1.6.9 starting
1639319954: Config loaded from /etc/mosquitto/mosquitto.conf.
1639319954: Opening ipv4 listen socket on port 1883.
1639319954: Opening ipv6 listen socket on port 1883.
1639319954: New connection from 172.17.0.1 on port 1883.
1639319954: New client connected from 172.17.0.1 as auto-8CB8460A-A37F-95B8-6E2E-20AEF7B77EF6 (p2, c1, k60).
1639319954: No will message specified.
1639319954: Sending CONNACK to auto-8CB8460A-A37F-95B8-6E2E-20AEF7B77EF6 (0, 0)
1639319954: Received SUBSCRIBE from auto-8CB8460A-A37F-95B8-6E2E-20AEF7B77EF6
1639319954:     /home/sensors/temp/# (QoS 0)
1639319954: auto-8CB8460A-A37F-95B8-6E2E-20AEF7B77EF6 0 /home/sensors/temp/#
1639319954: Sending SUBACK to auto-8CB8460A-A37F-95B8-6E2E-20AEF7B77EF6
1639319978: New connection from 172.17.0.1 on port 1883.
1639319978: New client connected from 172.17.0.1 as auto-61D83116-7A64-5E1A-3F73-F7B745C31596 (p2, c1, k60).
1639319978: No will message specified.
1639319978: Sending CONNACK to auto-61D83116-7A64-5E1A-3F73-F7B745C31596 (0, 0)
1639319978: Received PUBLISH from auto-61D83116-7A64-5E1A-3F73-F7B745C31596 (d0, q0, r0, m0, '/home/sensors/temp/kitchen', ... (26 bytes))
1639319978: Sending PUBLISH to auto-8CB8460A-A37F-95B8-6E2E-20AEF7B77EF6 (d0, q0, r0, m0, '/home/sensors/temp/kitchen', ... (26 bytes))
1639319978: Received DISCONNECT from auto-61D83116-7A64-5E1A-3F73-F7B745C31596
1639319978: Client auto-61D83116-7A64-5E1A-3F73-F7B745C31596 disconnected.
1639319980: New connection from 172.17.0.1 on port 1883.
1639319980: New client connected from 172.17.0.1 as auto-C401567A-1516-8A54-5822-E7C9B42D1C01 (p2, c1, k60).
1639319980: No will message specified.

If I run mosquitto locally I can see the following entry in the log file:

1639217975: mosquitto version 2.0.14 running
1639219775: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.
1639221576: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.
1639223377: Saving in-memory database to /var/lib/mosquitto//mosquitto.db.

Do I have to configure something else to trigger the DB?

Thanks in advance.

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

1 participant