:: Re: [DNG] Mosquitto cannot be start…
Forside
Slet denne besked
Besvar denne besked
Skribent: Steffen Dettmer
Dato:  
Til: Ludovic Bellière, dng
CC: Chris Zubrzycki, sergio
Emne: Re: [DNG] Mosquitto cannot be started, because no /var/mosquitto directory (Devuan stable)
Hi,

Thank you so much for your exhaustive answer! The links helped me to
solve my next issue as well, that's great! I thought Debian would
focus on systemd, I better have looked for myself first.

In case someone else faces a similar issue and reads this, I like to
add a detail.

The patch provided by Sergio attached to #993048 is simple and very
elegant, but did not work for me, because mosquitto.conf contains a
pid_file option, too. By this, the directory still is needed.
Additionally, I had to change this option to use a different filename,
otherwise mosquitto tried to overwrite the file created by
start-stop-deamon (user=root) and got EPERM (because user=mosquitto).
Maybe the pid_file option could be removed from the configuration, or
-u mosquitto added to start-stop-deamon, but I did not test this.

Steffen



On Tue, Dec 14, 2021 at 1:59 AM Ludovic Bellière via Dng
<dng@???> wrote:
>
> Hello Steffen,
>
> The systemd service file does create the necessary directories (see:
> https://github.com/eclipse/mosquitto/blob/master/service/systemd/mosquitto.service.simple).
>
> /run/mosquitto not being created is most likely an issue with debian itself.
> Creating the folder from the init file, as per your workaround, is valid. To
> resolve the installation issue would require to file a bug against mosquitto on
> debian BTS. Apparently somebody did just that, and provided a patch to boot:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=993048
>
> See also: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983429
>
> Cheers,
>                  Ludovic

>
> On Mon, 13 Dec 2021, Steffen Dettmer via Dng wrote:
>
> >Hi,
> >
> >mosquitto does not start, because there is no /var/mosquitto directory
> >for its PID file. Actually it cannot even be installed, because dpkg
> >script already wants it.
> >Also creating directory does not solve the problem, because /run is
> >tmpfs, so manually created directory won't be there on next reboot.
> >
> >As workaround, I simply added
> >
> > mkdir -p /run/mosquitto/ ; chown mosquitto /run/mosquitto
> >
> >to /etc/init.d/mosquitto script. I guess this in Debian is done by
> >some systemd magic, which could be needed to be "emulated" in Devuan,
> >so I write here.
> >
> >What should I do?
> >
> _______________________________________________
> Dng mailing list
> Dng@???
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng