I originally installed EmonCMS on my local server and the shared host by unpacking the ZIP file. I used GIT for the 10.1.10 install. I’m not sure I will be able to install redis on the shared host, and I’ll have another crack at getting all the modules installed. redis-server is installed via apt, but obviously there is more required. If redis is now required then I guess I’m stuck on 10.1.6. I hope there are really good reasons for this and it isn’t a minor convenience.
Having another go … using steps at https://github.com/emoncms/emoncms/blob/master/docs/LinuxInstall.md#install-php-pecl-dependencies
Got this far:
install ok: channel://pecl.php.net/redis-5.0.2
configuration option "php_ini" is not set to php.ini location
You should add "extension=redis.so" to php.in
For some reason, even though pecl install redis 5.0.2 the version that is running is 3.0.6. My RPI is running 3.2.6, so hopefully 3.0.6 is good enough. I’ve tried a ‘apt remove redis*’ and it looks like it wants to remove some other software that I run on the computer (ntop). Dependency hell!
I’ve added the “extension=redis.so” to /etc/php/7.0/mods-available/redis.ini and restarted apache. EmonCMS at least runs now, and shows redis running on the Admin status page.
When I try and do an update all I get is a quick flash of:
service-runner trigger sent
Have now removed ntopng and redis from apt, and am installing redis from source with instructions from https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-redis-on-ubuntu-16-04
A check of systemctl shows
systemctl status service-runner.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
Oh dear. That is going to slow things down isn’t it?
Have followed the instructions at https://github.com/emoncms/emoncms/blob/master/scripts/services/install-service-runner-update.md
[email protected]:/$ systemctl status service-runner.service
● service-runner.service - Emoncms service-runner Input Script
Loaded: loaded (/var/www/html/emoncms/scripts/services/service-runner/service-runner.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Mon 2019-10-28 19:56:40 AEST; 18s ago
Process: 27310 ExecStart=/usr/bin/python /var/www/emoncms/scripts/services/service-runner/service-runner.py (code=exited, status=2)
Main PID: 27310 (code=exited, status=2)
Oct 28 19:56:40 YYY systemd: service-runner.service: Unit entered failed state.
Oct 28 19:56:40 YYY systemd: service-runner.service: Failed with result 'exit-code'.
journalctl -f -u service-runner yields:
Oct 28 19:58:41 YYY service-runner: /usr/bin/python: can't open file '/var/www/emoncms/scripts/services/service-runner/service-runner.py': [Errno 2] No such file or directory
No surprise, as my install is in /var/www/html/emoncms. The hardcoding of locations is breaking things.
A quick tweak to service-runner.service to give me:
And now I am getting a python error:
ImportError: No module named redis
‘pip install redis’ gives me:
Requirement already satisfied: redis in /usr/local/lib/python3.5/dist-packages (3.3.11)
I downloaded the redis python source installed in manually with
sudo python setup.py install
Now the service-runner service is all good!
On the admin page of EmonCMS I get:
service-runner Active Running
redis-server Active Running
Now to try the update again …
And the error is
/bin/sh: 1: /opt/openenergymonitor/emonpi/service-runner-update.sh: not found
This seems to be an emonpi thing, and the contents at https://github.com/openenergymonitor/emonpi/blob/master/service-runner-update.sh don’t make a lot of sense to me.
I know this is a very long winded post, but I thought it might help someone else that is trying to get the service-runner and redis running on a standalone server. I’m learning more about services, python modules etc than I planned on!
[edited to put code blocks in]