LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 02-14-2024, 04:56 AM   #1
Peterken
Member
 
Registered: Apr 2007
Location: Belgium
Distribution: Debian
Posts: 68

Rep: Reputation: 20
Question Trying to get MQTT broker on Alpine running => keeps crashing


Hi, I'm trying to get Eclipse MQTT broker to work in a Alpine Linux LXC (on Proxmox).

I'm not very skilled with Linux, use it now with a Debian LXC because there is just more information about Debian.
Recently I discovered Alpine, managed to get WireGuard running on it and I'm very surprised of the speed/small footprint.
So now I'm trying to do the same with MQTT but I'm struggling for hours and hours to get it working and cannot find a lot of information about this combo.

Any help to get this working is highly appreciated!
P.
 
Old 02-14-2024, 05:04 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,304

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Ok, I've replied. Now we use the information you provide in most cases to diagnose your problem(s). You've given us nothing, so that ends there.

What's your pc spec & distro? It's on github, so how did the compile go? Errors? What errors (copy & paste message or log snippet)
 
Old 02-14-2024, 05:32 AM   #3
Peterken
Member
 
Registered: Apr 2007
Location: Belgium
Distribution: Debian
Posts: 68

Original Poster
Rep: Reputation: 20
Hi, thanks for jumping in!

I do not have much details since I don't know that much about Linux, and even less about Alpine.
Do you think that my HW has a role in this issue?
My Proxmox is up-to-date with Bookworm and the LXC Alpine v3.19.1

As you can see from the link that I posted, there is a package for mosquitto, so I didn't compile it myself.

Last edited by Peterken; 02-14-2024 at 05:40 AM.
 
Old 02-14-2024, 06:50 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,304

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
What have you done, and what goes wrong? Describe how you got the package installed, and what it said when you tried to run it. What's mosquito? What's Alpine? What installer do they use? I'm going away if I can't get some sense of what your problem. Read post #2 again. Then answer my questions.
 
Old 02-14-2024, 05:00 PM   #5
Peterken
Member
 
Registered: Apr 2007
Location: Belgium
Distribution: Debian
Posts: 68

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by business_kid View Post
What have you done,
Installed Eclipse MQTT broker

Quote:
Originally Posted by business_kid View Post
and what goes wrong?
From the topic title: Keeps crashing

Quote:
Originally Posted by business_kid View Post
Describe how you got the package installed,
'apk add mosquitto'

Quote:
Originally Posted by business_kid View Post
and what it said when you tried to run it.
Nothing, just found out that the service has the crashed state

Quote:
Originally Posted by business_kid View Post
What's mosquito?
'Eclipse Mosquitto is an open source (EPL/EDL licensed) message broker that implements the MQTT protocol versions 5.0, 3.1.1 and 3.1. Mosquitto is lightweight and is suitable for use on all devices from low power single board computers to full servers.'

Quote:
Originally Posted by business_kid View Post
What's Alpine?
First line of my OP: 'Alpine Linux'

Quote:
Originally Posted by business_kid View Post
What installer do they use?
Dunno

Quote:
Originally Posted by business_kid View Post
I'm going away if I can't get some sense of what your problem. Read post #2 again. Then answer my questions.
Quote:
Originally Posted by business_kid View Post
What's your pc spec & distro? It's on github, so how did the compile go? Errors? What errors (copy & paste message or log snippet)
Pc spec: it's an i5, but since it's a virtual environment I think it's of no importance.
Distro: from my OP, Proxmox (Debian based), Alpine Linux container.
 
Old 02-15-2024, 06:28 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,304

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Don't decide for me what's important or not. In a virtual environment, The assigned cores, ram, swap & disk space could all be important.

Find the main binary or binaries, probably in /usr/bin. Then run
Code:
ldd /path/to/binary |grep found
The correct output shoule be nothing.

Then run the main binary or it's startup script by hand in a terminal, and post any output that comes up.
 
Old 02-16-2024, 05:50 AM   #7
Peterken
Member
 
Registered: Apr 2007
Location: Belgium
Distribution: Debian
Posts: 68

Original Poster
Rep: Reputation: 20
So I have nailed it down.

The pid file could not be written because of a directory not being created.
I created it manually with:
Code:
sudo mkdir /var/run/mosquitto/ && sudo chown mosquitto: /var/run/mosquitto
and when I restart the service, everything works!

But, after a reboot this directory gets deleted.
Any idea why this happens?
 
Old 02-16-2024, 12:04 PM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,304

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Good.

As for the directory, probably everything in /var/run is deleted during shutdown in case there's some stray stuff hanging about. So why not recreate it in rc.local or some other startup script?
Code:
install -o mosquitto -d /var/run/mosquitto
Er, on 2nd thoughts, better create the directory before running mosquitto
 
  


Reply

Tags
alpine, mosquitto, mqtt



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to Install Mosquitto MQTT Message Broker on Debian 11 LXer Syndicated Linux News 0 11-25-2022 03:54 AM
LXer: How to Install and Secure the Mosquitto MQTT Messaging Broker on Ubuntu 20.04 LXer Syndicated Linux News 0 03-21-2022 10:27 AM
Apache server, mqtt broker, red node question caslor Linux - Server 0 05-17-2020 02:45 PM
CUPS (ALPINE) - CUPS claiming print job completed despite printing nothing, How to debug the issue? (network printer, Alpine, Linux, Docker) vinnu543 Linux - Networking 1 11-01-2018 03:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 03:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration