Yes, I'm using Ubuntu
What am I saying.. It is a RasPi. It is BullsEye.
Sorry, you got me there for a second.
I am not sure if I FOUND the problem or simply FIXED it.
I found a loop between an IN and OUT and broke that.
It isn't a direct look and has worked forever until now.
(Used a gate node)
That stopped it and I got the other (original) problem fixed.
Re-opened the gate and things are working fine.
But I shall note those tips and where to look so next time - Sod's law - I can maybe get to a better resolution.
Sorry, quickie:
How to I make the timestamps on the left human readable?
pi@TimePi:/var/log/mosquitto $ sudo cat mosquitto.log | tai64nlocal
-bash: tai64nlocal: command not found
pi@TimePi:/var/log/mosquitto $
Ok, kinda found that part:
After installing it:
pi@TimePi:/var/log/mosquitto $ sudo apt install daemontools
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
daemontools-run | runit
The following NEW packages will be installed:
daemontools
0 upgraded, 1 newly installed, 0 to remove and 280 not upgraded.
Need to get 48.1 kB of archives.
After this operation, 263 kB of additional disk space will be used.
Get:1 http://mirror.datamossa.io/raspbian buster/main armhf daemontools armhf 1:0.76-7 [48.1 kB]
Fetched 48.1 kB in 1s (47.7 kB/s)
Selecting previously unselected package daemontools.
(Reading database ... 107826 files and directories currently installed.)
Preparing to unpack .../daemontools_1%3a0.76-7_armhf.deb ...
Unpacking daemontools (1:0.76-7) ...
Setting up daemontools (1:0.76-7) ...
Processing triggers for man-db (2.8.5-2) ...
pi@TimePi:/var/log/mosquitto $ sudo cat mosquitto.log | tai64nlocal
1725459570: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
1725461371: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
1725463173: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
1725464973: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
1725466774: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
1725468575: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
1725470376: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
1725472177: Saving in-memory database to /var/lib/mosquitto/mosquitto.db.
All you have to do is to tell mosquitto to format the timestamps as human readable.
Add to this to your mosquitto conf file, which will be either /etc/mosquitto/mosquitto.conf, or a conf file in /etc/mosquitto/conf.d if you have configured it that way.
# human readable timestamps in log
log_timestamp true
log_timestamp_format %Y-%m-%d %H:%M:%S
Then restart mosquitto sudo systemctl restart mosquitto
if I add the line/s as you said Mosquitto won't restart.
-- The unit mosquitto.service has entered the 'failed' state with result 'exit-code'.
Sep 13 17:50:15 TimePi systemd[1]: Failed to start Mosquitto MQTT v3.1/v3.1.1 Broker.
-- Subject: A start job for unit mosquitto.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit mosquitto.service has finished with a failure.
--
-- The job identifier is 13044910 and the job result is failed.
Sep 13 17:50:24 TimePi sudo[20602]: pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/sbin/iwlist wlan0 scan
Sep 13 17:50:24 TimePi sudo[20602]: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep 13 17:50:28 TimePi sudo[20602]: pam_unix(sudo:session): session closed for user root
pi@TimePi:/etc/mosquitto $ cat mosquitto.conf
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
pid_file /var/run/mosquitto.pid
# human readable timestamps in log
#log_timestamp true
#log_timestamp_format %Y-%m-%d %H:%M:%S
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
pi@TimePi:/etc/mosquitto $
The three lines are commented out..
It works.
If I make the 2 lines active, I get the error (well in the log file) I see
--
-- The unit mosquitto.service has entered the 'failed' state with result 'exit-code'.
Sep 13 17:50:15 TimePi systemd[1]: Failed to start Mosquitto MQTT v3.1/v3.1.1 Broker.
-- Subject: A start job for unit mosquitto.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit mosquitto.service has finished with a failure.
Now, after getting it running again, I am being flooded with a LOT of messages.
(Which may be related to another problem with something happening with a lot of messages looping on a MQTT device where I had to stop the loop.
But.... Probably not.
As these are the retained messages. Not so much a loop.)
Try after the log_dest file rather than before, perhaps it doesn't like being told how to format it before being told where to put it. If it still fails, post the failing file, not the working one.
pi@TimePi:/etc/mosquitto $ sudo nano mosquitto.conf
pi@TimePi:/etc/mosquitto $ sudo systemctl stop mosquitto.service
pi@TimePi:/etc/mosquitto $ sudo systemctl start mosquitto.service
Job for mosquitto.service failed because the control process exited with error code.
See "systemctl status mosquitto.service" and "journalctl -xe" for details.
pi@TimePi:/etc/mosquitto $ sudo systemctl start mosquitto.service
Job for mosquitto.service failed because the control process exited with error code.
See "systemctl status mosquitto.service" and "journalctl -xe" for details.
pi@TimePi:/etc/mosquitto $ sudo nano mosquitto.conf
pi@TimePi:/etc/mosquitto $ sudo systemctl start mosquitto.service
pi@TimePi:/etc/mosquitto $
First line, edited the file and saved.
The train then goes off the rails.
Had to go back and edit it and take the lines out.
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
# human readable timestamps in log
#log_timestamp true
#log_timestamp_format %Y-%m-%d %H:%M:%S
pid_file /var/run/mosquitte.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
include_dir /etc/mosquitto/conf.d
# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example
pid_file /var/run/mosquitte.pid
persistence true
persistence_location /var/lib/mosquitto/
log_dest file /var/log/mosquitto/mosquitto.log
# human readable timestamps in log
log_timestamp true
log_timestamp_format %Y-%m-%d %H:%M:%S
include_dir /etc/mosquitto/conf.d
Now, trying to start it:
pi@TimePi:/etc/mosquitto $ sudo systemctl start mosquitto.service
Job for mosquitto.service failed because the control process exited with error code.
See "systemctl status mosquitto.service" and "journalctl -xe" for details.
Doing that (tail only)
pi@TimePi:/etc/mosquitto $ journalctl -xe
Sep 13 18:52:53 TimePi systemd[1]: Starting Time & Date Service...
-- Subject: A start job for unit systemd-timedated.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit systemd-timedated.service has begun execution.
--
-- The job identifier is 13051778.
Sep 13 18:52:53 TimePi dbus-daemon[428]: [system] Successfully activated service 'org.freedesktop.timedate1'
Sep 13 18:52:53 TimePi systemd[1]: Started Time & Date Service.
-- Subject: A start job for unit systemd-timedated.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit systemd-timedated.service has finished successfully.
--
-- The job identifier is 13051778.
Sep 13 18:52:53 TimePi systemd-timedated[29185]: /dev/rtc is busy. Is somebody keeping it open continuously? That's not a good idea... Returning a bogus RTC timestamp.
Sep 13 18:52:53 TimePi sudo[29180]: pam_unix(sudo:session): session closed for user root
Sep 13 18:53:04 TimePi sudo[29188]: pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/sbin/iwlist wlan0 scan
Sep 13 18:53:04 TimePi sudo[29188]: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep 13 18:53:09 TimePi sudo[29188]: pam_unix(sudo:session): session closed for user root
Sep 13 18:53:17 TimePi sudo[29142]: pam_unix(sudo:session): session closed for user root
Sep 13 18:53:23 TimePi systemd[1]: systemd-timedated.service: Succeeded.
-- Subject: Unit succeeded
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit systemd-timedated.service has successfully entered the 'dead' state.
Sep 13 18:53:32 TimePi sudo[29257]: pi : TTY=unknown ; PWD=/home/pi ; USER=root ; COMMAND=/usr/sbin/hwclock -r
Sep 13 18:53:32 TimePi sudo[29257]: pam_unix(sudo:session): session opened for user root by (uid=0)
Sep 13 18:53:33 TimePi dbus-daemon[428]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service' requested by ':1.448877' (uid=1000 pid=29261 comm=
Sep 13 18:53:33 TimePi systemd[1]: Starting Time & Date Service...
-- Subject: A start job for unit systemd-timedated.service has begun execution
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit systemd-timedated.service has begun execution.
--
-- The job identifier is 13051836.
Sep 13 18:53:33 TimePi dbus-daemon[428]: [system] Successfully activated service 'org.freedesktop.timedate1'
Sep 13 18:53:33 TimePi systemd[1]: Started Time & Date Service.
-- Subject: A start job for unit systemd-timedated.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit systemd-timedated.service has finished successfully.
--
-- The job identifier is 13051836.
Sep 13 18:53:33 TimePi systemd-timedated[29262]: /dev/rtc is busy. Is somebody keeping it open continuously? That's not a good idea... Returning a bogus RTC timestamp.
Sep 13 18:53:33 TimePi sudo[29257]: pam_unix(sudo:session): session closed for user root
pi@TimePi:/etc/mosquitto $