I am using the latest Emoncms docker container alexjunk/emoncms at https://hub.docker.com/r/alexjunk/emoncms.
I wanted to add the Account module to Emoncms. Before modifying and rebuilding the image, I decided to manually install the module from within the running container. The module code was installed using the typical git process and was in the correct location but Emoncms did not detect it.
Eventually, I discovered the /opt/openenergymonitor/Emoncms/update/service-runner-update.sh script failed. After fixing this the module was successfully included. My hunch is the failure was causing the system to not detect the additional module correctly.
Investigation revealed a problem in line 25. The container uses Alpine and BusyBox (v1.36.1) and the included df command does not support the --output=avail option. A simple change to the script fixed the problem. Details follow:
Original: varlog_available=$(df --output=avail /var/log | tail -n 1)
Modified: varlog_available=$(df /var/log | awk '{print $4}' | tail -n 1)
Perhaps the modified version is more suitable to ensure compatibility with docker containers? However, I don't know if there are other systems which might fail with this syntax.
Regards
Paul
I am using the latest Emoncms docker container alexjunk/emoncms at https://hub.docker.com/r/alexjunk/emoncms.
I wanted to add the Account module to Emoncms. Before modifying and rebuilding the image, I decided to manually install the module from within the running container. The module code was installed using the typical git process and was in the correct location but Emoncms did not detect it.
Eventually, I discovered the /opt/openenergymonitor/Emoncms/update/service-runner-update.sh script failed. After fixing this the module was successfully included. My hunch is the failure was causing the system to not detect the additional module correctly.
Investigation revealed a problem in line 25. The container uses Alpine and BusyBox (v1.36.1) and the included df command does not support the --output=avail option. A simple change to the script fixed the problem. Details follow:
Original: varlog_available=$(df --output=avail /var/log | tail -n 1)
Modified: varlog_available=$(df /var/log | awk '{print $4}' | tail -n 1)
Perhaps the modified version is more suitable to ensure compatibility with docker containers? However, I don't know if there are other systems which might fail with this syntax.
Regards
Paul