kizniche / Mycodo

An environmental monitoring and regulation system
http://kylegabriel.com/projects/
GNU General Public License v3.0
3k stars 500 forks source link

Daemon won't start when influxdb not installed #1293

Closed KShips closed 1 year ago

KShips commented 1 year ago

Describe the problem/bug

Have attempted a couple of fresh installs, I have installed selecting to not install influxdb as pi runs too slowly wth it and want to use external db server, appears to go through install ok but daemon won't startup, status looks like it is waiting for influxdb to start but it isn't installed so hangs?

sudo service mycodo status
● mycodo.service - Mycodo server
     Loaded: loaded (/home/pi/Mycodo/install/mycodo.service; enabled; vendor preset: enabled)
     Active: activating (start-pre) since Mon 2023-04-03 03:01:20 BST; 12min ago
Cntrl PID: 2754 (bash)
      Tasks: 2 (limit: 529)
        CPU: 29.656s
     CGroup: /system.slice/mycodo.service
             ├─2754 /bin/bash /var/mycodo-root/install/influxdb_wait_until_running.sh
             └─4285 sleep 1

Running manually appears to get up and running:

sudo /var/mycodo-root/env/bin/python /var/mycodo-root/mycodo/mycodo_daemon.py --debug 2023-04-03 02:58:29,891 Mycodo daemon v8.15.7 starting 2023-04-03 02:58:29,900 Refreshing misc settings 2023-04-03 02:58:30,105 Anonymous statistics enabled 2023-04-03 02:58:30,115 Starting Pyro5 daemon Object <main.PyroServer object at 0xb46af778>: uri = PYRO:mycodo.pyro_server@0.0.0.0:9080 Pyro daemon running. 2023-04-03 02:58:32,204 Starting Output Controller 2023-04-03 02:58:32,631 Initializing Outputs 2023-04-03 02:58:35,625 Outputs Initialized 2023-04-03 02:58:35,632 Activated in 3420.9 ms 2023-04-03 02:58:36,136 Output Controller fully started 2023-04-03 02:58:36,143 Starting all activated Conditional controllers 2023-04-03 02:58:36,151 All activated Conditional controllers started 2023-04-03 02:58:36,157 Starting all activated Trigger controllers 2023-04-03 02:58:36,165 All activated Trigger controllers started 2023-04-03 02:58:36,172 Starting all activated Input controllers 2023-04-03 02:58:36,178 All activated Input controllers started 2023-04-03 02:58:36,185 Starting all activated PID controllers 2023-04-03 02:58:36,192 All activated PID controllers started 2023-04-03 02:58:36,199 Starting all activated Function controllers 2023-04-03 02:58:36,206 All activated Function controllers started 2023-04-03 02:58:36,212 Starting Widget Controller 2023-04-03 02:58:36,805 Initializing Widgets 2023-04-03 02:58:37,163 Widgets Initialized 2023-04-03 02:58:37,171 Activated in 949.2 ms 2023-04-03 02:58:37,674 Widget Controller fully started 2023-04-03 02:58:38,182 Mycodo daemon started in 8.283 seconds 2023-04-03 02:58:38,552 47.12 MB RAM in use 2023-04-03 03:00:40,134 Requested http://ipinfo.io/json 2023-04-03 03:00:41,278 Sent anonymous usage statistics 2023-04-03 03:00:56,701 Received command to terminate daemon 2023-04-03 03:00:57,339 Stopping all running controllers 2023-04-03 03:00:57,344 All Function controllers stopped 2023-04-03 03:00:57,350 All PID controllers stopped 2023-04-03 03:00:57,355 All Input controllers stopped 2023-04-03 03:00:57,360 All Trigger controllers stopped 2023-04-03 03:00:57,365 All Conditional controllers stopped 2023-04-03 03:00:57,402 Deactivated in 31.5 ms 2023-04-03 03:00:57,622 Deactivated in 213.1 ms 2023-04-03 03:00:57,628 Mycodo daemon terminated in 0.927 seconds

Versions:

kizniche commented 1 year ago

Just pushed a potential fix, if you would like to test.

KShips commented 1 year ago

Thanks for the quick fix :) I have run upgrade from Master and daemon is now working:

pi@mycodo:~ $ sudo service mycodo status
● mycodo.service - Mycodo server
     Loaded: loaded (/home/pi/Mycodo/install/mycodo.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2023-04-03 07:16:47 BST; 1h 15min ago
   Main PID: 312 (python)
      Tasks: 11 (limit: 529)
        CPU: 19min 55.901s
     CGroup: /system.slice/mycodo.service
             └─312 /var/mycodo-root/env/bin/python /var/mycodo-root/mycodo/mycodo_daemon.py