7

mosquitto does not seem to like the following options for persistence.

# Persistence configuration
persistence true
persistence_location /data/qos/
persistent_client_expiration 8h

The /data/qos does exist and permissions have been set.

sudo chown mosquitto:mosquitto /data/qos

The persistence configuration options are in a file persist.conf placed under /etc/mosquitto/conf.d directory. Before copying, I am stopping the broker and starting it again after copying using commands like this:

sudo service mosquitto stop
sudo service mosquitto start

The /var/log/mosquitto/mosquitto.log does not give any clue about what could be the issue.

So, what's wrong with the options provided above for persistence?

  • What happens if you stop the service and manually start su mosquitto -c mosquitto -c /etc/mosquitto/mosquitto.conf – hardillb Jun 27 '18 at 18:46
  • Also are you sure it doesn't start or is it just not creating the persistence file at startup? – hardillb Jun 27 '18 at 20:06
  • @hardillb I do recall starting mosquitto successfully with /usr/bin/mosquitto -c /etc/mosquitto/mosquitto.conf i.e. without the switch user. Yes, mosquitto never started; no processes are listed in ps -ef | grep mosq. BTW, what is procedure in general? Stop broker, copy .conf files into /etc/mosquitto/conf.d folder and then start broker? – cogitoergosum Jun 28 '18 at 1:14
3

As mentioned in the post above, the persistence configuration options were provided in a separate file - persist.conf placed under /etc/mosquitto/conf.d directory. However, there are persistence options already present in /etc/mosquitto/mosquitto.conf. Once I removed these, the settings in persist.conf went through.

It would have been nice of mosquitto to warn of such conflicts.

  • Mosquitto does flag up duplicate values when it fails to start (at least at v1.4.x) Error: Duplicate persistence_file value in configuration. – hardillb Jun 28 '18 at 11:06
  • Hmm...I think I am at 1.4 as I wanted the compiled version of websockets from Ubuntu ppa. Don't recall that message. Maybe I missed? – cogitoergosum Jun 28 '18 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.