log
1669305336: mosquitto version 1.6.12 starting
1669305336: Config loaded from /etc/mosquitto/mosquitto.conf.
1669305336: Opening ipv4 listen socket on port 1883.
1669305336: Error: Address already in use
1669305336: mosquitto version 1.6.12 starting
1669305336: Config loaded from /etc/mosquitto/mosquitto.conf.
1669305336: Opening ipv4 listen socket on port 1883.
1669305336: Error: Address already in use
1669305337: mosquitto version 1.6.12 starting
1669305337: Config loaded from /etc/mosquitto/mosquitto.conf.
1669305337: Opening ipv4 listen socket on port 1883.
1669305337: Error: Address already in use
1669305337: mosquitto version 1.6.12 starting
1669305337: Config loaded from /etc/mosquitto/mosquitto.conf.
1669305337: Opening ipv4 listen socket on port 1883.
1669305337: Error: Address already in use
1669305337: mosquitto version 1.6.12 starting
1669305337: Config loaded from /etc/mosquitto/mosquitto.conf.
1669305337: Opening ipv4 listen socket on port 1883.
1669305337: Error: Address already in use
1669393843: mosquitto version 1.6.12 starting
1669393843: Config loaded from /etc/mosquitto/mosquitto.conf.
1669393843: Opening ipv4 listen socket on port 1883.
1669393843: Error: Address already in use
1669393844: mosquitto version 1.6.12 starting
1669393844: Config loaded from /etc/mosquitto/mosquitto.conf.
1669393844: Opening ipv4 listen socket on port 1883.
1669393844: Error: Address already in use
1669393844: mosquitto version 1.6.12 starting
1669393844: Config loaded from /etc/mosquitto/mosquitto.conf.
1669393844: Opening ipv4 listen socket on port 1883.
1669393844: Error: Address already in use
1669393844: mosquitto version 1.6.12 starting
1669393844: Config loaded from /etc/mosquitto/mosquitto.conf.
1669393844: Opening ipv4 listen socket on port 1883.
1669393844: Error: Address already in use
1669393844: mosquitto version 1.6.12 starting
1669393844: Config loaded from /etc/mosquitto/mosquitto.conf.
1669393844: Opening ipv4 listen socket on port 1883.
1669393844: Error: Address already in use
1669394062: mosquitto version 1.6.12 starting
1669394062: Config loaded from /etc/mosquitto/mosquitto.conf.
1669394062: Opening ipv4 listen socket on port 1883.
1669394062: Error: Address already in use
sudo service mosquitto restart
Job for mosquitto.service failed because the control process exited with error code.
See "systemctl status mosquitto.service" and "journalctl -xe" for details.
You have new mail in /var/mail/pi
pi@raspberrypi:/var/log/mosquitto $
Apparently you have other mosquitto process already started/running and using port 1883 when you try to start mosquitto.service in parallel and fails because the port is already in use. Try to identify service which started the process using port 1883:
Check the content of /etc/rc.local file. Maybe you have a command to start mosquitto in it. In that case system tries to start one mosquitto by rc-local.service and another mosquitto by mosquitto.service. If it mosquitto command is present in /etc/rc.local comment it out or remove the line. Then do:
ferrosk wrote: ↑Sunday 18 December 2022 13:43
hello,
Check the content of /etc/rc.local file. Maybe you have a command to start mosquitto in it. In that case system tries to start one mosquitto by rc-local.service and another mosquitto by mosquitto.service. If it mosquitto command is present in /etc/rc.local comment it out or remove the line. Then do:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
/usr/sbin/mosquitto -d
exit 0
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
#/usr/sbin/mosquitto -d
exit 0
1671284179: mosquitto version 2.0.12 starting
1671284179: Config loaded from /etc/mosquitto/mosquitto.conf.
1671284179: Starting in local only mode. Connections will only be possible from clients running on this machine.
1671284179: Create a configuration file which defines a listener to allow remote access.
1671284179: For more details see https://mosquitto.org/documentation/authentication-methods/
1671284179: Opening ipv4 listen socket on port 1883.
1671284179: Error: Address already in use
1671284179: Opening ipv6 listen socket on port 1883.
1671284179: Error: Address already in use
1671284180: mosquitto version 2.0.12 starting
1671284180: Config loaded from /etc/mosquitto/mosquitto.conf.
1671284180: Starting in local only mode. Connections will only be possible from clients running on this machine.
1671284180: Create a configuration file which defines a listener to allow remote access.
1671284180: For more details see https://mosquitto.org/documentation/authentication-methods/
1671284180: Opening ipv4 listen socket on port 1883.
1671284180: Error: Address already in use
1671284180: Opening ipv6 listen socket on port 1883.
1671284180: Error: Address already in use
1671284181: mosquitto version 2.0.12 starting
1671284181: Config loaded from /etc/mosquitto/mosquitto.conf.
1671284181: Starting in local only mode. Connections will only be possible from clients running on this machine.
1671284181: Create a configuration file which defines a listener to allow remote access.
1671284181: For more details see https://mosquitto.org/documentation/authentication-methods/
1671284181: Opening ipv4 listen socket on port 1883.
1671284181: Error: Address already in use
1671284181: Opening ipv6 listen socket on port 1883.
1671284181: Error: Address already in use
1671284181: mosquitto version 2.0.12 starting
1671284181: Config loaded from /etc/mosquitto/mosquitto.conf.
1671284181: Starting in local only mode. Connections will only be possible from clients running on this machine.
1671284181: Create a configuration file which defines a listener to allow remote access.
1671284181: For more details see https://mosquitto.org/documentation/authentication-methods/
1671284181: Opening ipv4 listen socket on port 1883.
1671284181: Error: Address already in use
1671284181: Opening ipv6 listen socket on port 1883.
1671284181: Error: Address already in use
1671284181: mosquitto version 2.0.12 starting
1671284181: Config loaded from /etc/mosquitto/mosquitto.conf.
1671284181: Starting in local only mode. Connections will only be possible from clients running on this machine.
1671284181: Create a configuration file which defines a listener to allow remote access.
1671284181: For more details see https://mosquitto.org/documentation/authentication-methods/
1671284181: Opening ipv4 listen socket on port 1883.
1671284181: Error: Address already in use
1671284181: Opening ipv6 listen socket on port 1883.
1671284181: Error: Address already in use
1671284181: Opening ipv6 listen socket on port 1883.
1671284181: Error: Address already in use
1671284181: mosquitto version 2.0.12 starting
1671284181: Config loaded from /etc/mosquitto/mosquitto.conf.
1671284181: Starting in local only mode. Connections will only be possible from clients running on this machine.
1671284181: Create a configuration file which defines a listener to allow remote access.
1671284181: For more details see https://mosquitto.org/documentation/authentication-methods/
1671284181: Opening ipv4 listen socket on port 1883.
1671284181: Error: Address already in use
1671284181: Opening ipv6 listen socket on port 1883.
1671284181: Error: Address already in use
1671284181: mosquitto version 2.0.12 starting
1671284181: Config loaded from /etc/mosquitto/mosquitto.conf.
1671284181: Starting in local only mode. Connections will only be possible from clients running on this machine.
1671284181: Create a configuration file which defines a listener to allow remote access.
1671284181: For more details see https://mosquitto.org/documentation/authentication-methods/
1671284181: Opening ipv4 listen socket on port 1883.
1671284181: Error: Address already in use
1671284181: Opening ipv6 listen socket on port 1883.
1671284181: Error: Address already in use
1671284181: mosquitto version 2.0.12 starting
1671284181: Config loaded from /etc/mosquitto/mosquitto.conf.
1671284181: Starting in local only mode. Connections will only be possible from clients running on this machine.
1671284181: Create a configuration file which defines a listener to allow remote access.
1671284181: For more details see https://mosquitto.org/documentation/authentication-methods/
1671284181: Opening ipv4 listen socket on port 1883.
1671284181: Error: Address already in use
1671284181: Opening ipv6 listen socket on port 1883.
1671284181: Error: Address already in use
1671284340: mosquitto version 2.0.12 starting
1671284340: Config loaded from /etc/mosquitto/mosquitto.conf.