Iothermostat backend offline

this is probably a question for @janbonne
several times in the past month Ive had issues when the thermostat looks ok in the gui but will not control the heater

on inspection the backend status is no longer active and I need to ssh in and reboot

ok bit more to this as it stopped again tonight

Last login: Sun May 10 17:00:20 2020 from 192.168.1.197
[iothermostat@iothermostat ~]$ systemctl status iothermostat.service
● iothermostat.service - IOThermostat Backend Service
Loaded: loaded (/etc/systemd/system/iothermostat.service; enabled; vendor pr>
Active: failed (Result: exit-code) since Sun 2020-05-10 23:28:06 CEST; 6min >
Process: 362 ExecStart=/usr/bin/python -u /home/iothermostat/iothermostat-pyt>
Main PID: 362 (code=exited, status=1/FAILURE)

so did this and it come back

[iothermostat@iothermostat ~]$ systemctl restart iothermostat.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ====
Authentication is required to restart ‘iothermostat.service’.
Authenticating as: root
Password:
==== AUTHENTICATION COMPLETE ====
[iothermostat@iothermostat ~]$ systemctl status iothermostat.service
● iothermostat.service - IOThermostat Backend Service
Loaded: loaded (/etc/systemd/system/iothermostat.service; enabled; vendor pr>
Active: active (running) since Sun 2020-05-10 23:37:41 CEST; 11s ago
Main PID: 636 (python)
Tasks: 3 (limit: 1108)
CGroup: /system.slice/iothermostat.service
└─636 /usr/bin/python -u /home/iothermostat/iothermostat-python/ioth>
lines 1-7/7 (END)

Hi,

Could you post the results of the following command? The backend should write messages to system log.

journalctl -r -b

it happened again tonight here are the logs

May 24 01:12:56 iothermostat su[9854]: pam_unix(su-l:session): session closed for user root
May 24 01:12:56 iothermostat sshd[9850]: Disconnected from user iothermostat 192.168.1.197 port 51764
May 24 01:12:56 iothermostat sshd[9850]: Received disconnect from 192.168.1.197 port 51764:11: disconnected by user
May 24 01:09:02 iothermostat su[9854]: pam_unix(su-l:session): session opened for user root by iothermostat(uid=1001)
May 24 01:09:02 iothermostat su[9854]: (to root) iothermostat on pts/0
May 16 15:13:55 iothermostat sshd[4543]: Disconnected from user iothermostat 192.168.1.197 port 33888
May 16 15:13:55 iothermostat sshd[4543]: Received disconnect from 192.168.1.197 port 33888:11: disconnected by user
May 12 11:25:44 iothermostat sshd[1744]: Disconnected from user iothermostat 192.168.1.22 port 61581
May 12 11:25:44 iothermostat sshd[1744]: Received disconnect from 192.168.1.22 port 61581:11: disconnected by user
May 12 11:22:41 iothermostat sshd[1762]: Disconnected from user iothermostat 192.168.1.22 port 61602
May 12 11:22:41 iothermostat sshd[1762]: Received disconnect from 192.168.1.22 port 61602:11: disconnected by user
May 11 18:47:29 iothermostat sshd[1298]: Disconnected from user iothermostat 192.168.1.22 port 58536
May 11 18:47:29 iothermostat sshd[1298]: Received disconnect from 192.168.1.22 port 58536:11: disconnected by user
May 11 12:11:22 iothermostat su[1027]: pam_unix(su-l:session): session closed for user root
May 11 10:46:04 iothermostat su[1027]: pam_unix(su-l:session): session opened for user root by iothermostat(uid=1001)
May 11 10:46:04 iothermostat su[1027]: (to root) iothermostat on pts/0
May 11 00:33:39 iothermostat sshd[689]: Disconnected from user iothermostat 192.168.1.22 port 49806
May 11 00:33:39 iothermostat sshd[689]: Received disconnect from 192.168.1.22 port 49806:11: disconnected by user
May 10 23:55:10 iothermostat sshd[601]: Disconnected from user iothermostat 192.168.1.197 port 49588
May 10 23:55:10 iothermostat sshd[601]: Received disconnect from 192.168.1.197 port 49588:11: disconnected by user
May 10 17:25:48 iothermostat su[403]: pam_unix(su-l:session): session closed for user root
May 10 17:25:48 iothermostat sshd[371]: Disconnected from user iothermostat 192.168.1.197 port 51424
May 10 17:25:48 iothermostat sshd[371]: Received disconnect from 192.168.1.197 port 51424:11: disconnected by user
May 10 17:19:54 iothermostat su[403]: pam_unix(su-l:session): session opened for user root by iothermostat(uid=1001)
May 10 17:19:54 iothermostat su[403]: (to root) iothermostat on pts/0
May 10 17:19:20 iothermostat sudo[402]: pam_unix(sudo:auth): authentication failure; logname=iothermostat uid=1001 euid=0 tty=/dev/pts/0 ruser=iothermostat rhost= user=iothermostat
May 10 16:56:36 iothermostat at-spi-bus-launcher[314]: SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
May 10 16:56:36 iothermostat at-spi-bus-launcher[314]: dbus-daemon[320]: Successfully activated service ‘org.a11y.atspi.Registry’
May 10 16:56:36 iothermostat at-spi-bus-launcher[314]: dbus-daemon[320]: Activating service name=‘org.a11y.atspi.Registry’ requested by ‘:1.0’ (uid=1001 pid=309 comm="/usr/bin/midori -e Fullscreen -a http://localhost/")
May 10 16:56:35 iothermostat systemd[244]: Started Accessibility services bus.
May 10 16:56:35 iothermostat dbus-daemon[312]: [session uid=1001 pid=312] Successfully activated service ‘org.a11y.Bus’
May 10 16:56:35 iothermostat systemd[244]: Starting Accessibility services bus…
May 10 16:56:35 iothermostat dbus-daemon[312]: [session uid=1001 pid=312] Activating via systemd: service name=‘org.a11y.Bus’ unit=‘at-spi-dbus-bus.service’ requested by ‘:1.2’ (uid=1001 pid=309 comm="/usr/bin/midori -e Fullscreen -a http://localhost/")
May 10 16:56:31 iothermostat systemd[244]: Started D-Bus User Message Bus.
May 10 16:56:18 iothermostat systemd[244]: Startup finished in 1.636s.
May 10 16:56:18 iothermostat systemd[244]: Reached target Default.
May 10 16:56:18 iothermostat systemd[244]: Reached target Basic System.
May 10 16:56:18 iothermostat systemd[244]: Reached target Sockets.
May 10 16:56:18 iothermostat systemd[244]: Listening on D-Bus User Message Bus Socket.
May 10 16:56:18 iothermostat systemd[244]: Listening on GnuPG cryptographic agent (ssh-agent emulation).
May 10 16:56:18 iothermostat systemd[244]: Reached target Timers.
May 10 16:56:18 iothermostat systemd[244]: Reached target Paths.
May 10 16:56:18 iothermostat systemd[244]: Listening on GnuPG cryptographic agent and passphrase cache.
May 10 16:56:18 iothermostat systemd[244]: Starting D-Bus User Message Bus Socket.
May 10 16:56:17 iothermostat systemd[244]: Listening on p11-kit server.
May 10 16:56:17 iothermostat systemd[244]: Listening on GnuPG cryptographic agent and passphrase cache (access for web browsers).
May 10 16:56:17 iothermostat systemd[244]: Listening on GnuPG cryptographic agent and passphrase cache (restricted).
May 10 16:56:17 iothermostat systemd[244]: Listening on GnuPG network certificate management daemon.

strangle there is nothing in there from the 16th to today when I did an ssh in

You could try this instead:

systemctl stop iothermostat.service

restart the process, by running it from terminal:

/usr/bin/python -u /home/iothermostat/iothermostat-python/iothermostat.py >> /home/iothermostat/iothermostat-python.log

followed by ctrl-z and bg and disown which pauses the back-end, continues it in background and than decouples it from the current terminal so it will keep running if you logout. Just look in the log file to check the process.