-
Notifications
You must be signed in to change notification settings - Fork 2.4k
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service will not start without existing /var/log/mosquitto folder (tmpfs /var/log) #821
Comments
I'd like to clarify your intent.
|
A bugfix that would create the logging directory if it doesn't exist post-install (or at least show a decent error message in the logs somewhere without crashing) would be nice, as I've already found out that my fluency with the used programming language is far from being useful. |
I don't think mosquitto should auto-create the logging directory. I tried another famous network software, and confirmed it behaved as same as mosquitto. Regarding error message, you can look the message "Unable to open log file /nodir/mosquitto.log for writing." by running mosquitto on the shell. |
FWIW, a workaround is to add the lines marked with +:
|
Thanks a lot! Solved the problem. But, I think, this is a bug and should be fixed in the standard installation. Otherwise, Mosquitto does not start after reboot. I've installed a fresh oh3 with mosquitto and have had exactly the described issue. |
I run mosquitto on my raspberry pi with /var/log/ as a tmpfs folder; I did this by adding the following line to my /etc/fstab file:
tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0
After a reboot, the mosquitto service won't restart until I manually create the folder /var/log/mosquitto.
Also, it doesn't give any relevant warning message to this issue when I use the systemctl command as stated below, only that is has been started:
Right now, I'm creating the folder after booting and restarting mosquitto, but I think a more elegant solution (in the service script itself) would be better. I'll see if I can come up with something later this week and send in a pull request, but I don't know if I know how to fix this in the most compatible way (with other distributions than just raspbian alone).
The text was updated successfully, but these errors were encountered: