Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] How to enable auto restart in config

Hi Alexander,

I order to make your life easier use this project as a reference https://github.com/InfluxCommunity/tiguitto/tree/master/prototype. You will need to have a look at the `mosquitto` directory for your configuration file, passwords etc.

then have a look into `docker-compose.prototype.yml` file wherein you can comment out all the other services except mosquitto and it should bring the default mosquitto container up for you.

In essence if you have a `mosquitto.conf` file in a directory on your machine perform the following command:

    docker run  -d --restart=always --name=my-mqtt -v $(pwd)/mosquitto.conf:/mosquitto/config/mosquitto.conf:ro eclipse-mosquitto:2.0.15

This command will bring up mosquitto with your defined configuration and will make sure that upon reboot of your machine, the mqtt broker is brought up automatically.

If you wish to see the log files

  docker logs -f my-mqtt

will show you the logs.



On Tue, Mar 21, 2023 at 2:19 PM Alexander Komrakov <a.komrakov@xxxxxxxxx> wrote:
Apologies I am new, is there a guide how to achieve this? Without rebuilding the whole container?

Thank you


On Tue, 21 Mar 2023 at 14:16, Shan D <sdes.softdev@xxxxxxxxx> wrote:
if you are using docker add a restart policy set to always. This will let docker know that upon your host restart the mosquitto container should be up and running on reboot.

There is a way to also send a SIGHUP signal to docker that will flush out things in mosquitto and will be able to restart mosquitto for you.



On Tue, Mar 21, 2023 at 2:05 PM Alexander Komrakov <a.komrakov@xxxxxxxxx> wrote:
Hi team,

Is it possible to enable auto restart in the config? mosquitto.conf
Or how do I make this happen when I already installed everything using Docker?

Running on Synology, thank you
_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev
_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev
_______________________________________________
mosquitto-dev mailing list
mosquitto-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/mosquitto-dev

Back to the top