mike vorisis
mike vorisis

Reputation: 2832

Hivemq closes after some time

I installed HiveMQ on my Ubuntu 16.04 server (dropped the zip file inside my server and unzip it) then I started it via terminal (with SSH connection) and I connected a client all was good. Then I closed the terminal to see if I would able to connect again and I would, I could also connect after 2 hours but suddenly I couldn't.

Is there any command to use to keep it always on?

Thanks in advance

Upvotes: 1

Views: 242

Answers (1)

fraschbi
fraschbi

Reputation: 533

Check this list on the HiveMQ User Guide. Starting at point 10 describes, how to run HiveMQ from a run script.

Install the init script (optional)

For Debian-based linux like Debian, Ubuntu, Raspbian using init.d scripts

cp /opt/hivemq/bin/init-script/hivemq-debian /etc/init.d/hivemq
chmod +x /etc/init.d/hivemq

For Debian-based linux like Debian, Ubuntu, Raspbian using systemd

cp /opt/hivemq/bin/init-script/hivemq.service /etc/systemd/system/hivemq.service

Modify /etc/init.d/hivemq (optional)

Set the HIVEMQ_HOME and the HIVEMQ_USER variable to the correct values for your system.

By default this would be:

HIVEMQ_HOME=/opt/hivemq

HIVEMQ_USER=hivemq

If you installed HiveMQ to a different directory than /opt/hivemq please point the HIVEMQ_HOME in your init script to the correct directory. Otherwise the daemon will not start correctly.

Start HiveMQ on boot (optional)

For Debian-based linux like Debian, Ubuntu, Raspbian

update-rc.d hivemq defaults

For Debian-based linux like Debian, Ubuntu, Raspbian using systemd

systemctl enable hivemq

Upvotes: 3

Related Questions