It looks like this is as a result of moving from /etc/init.d/ service to the systemd service.
I have tried adding a standard output definition but cant seem the get it to log:
The changes to emoncms/config mentioned by @TrystanLea are now committed in the stable branch of this module.
However I’m having an issue adding www-data to the systemd-journal via the update scripts.
Executing in a shell
sudo usermod -a -G systemd-journal www-data
works fine but when it’s in the emonhub update script it does’t seem to work, just failes with no error. I think this could be a permission issue, however all other sudo commands e.g sudo apt-get update work fine via the script. Any ideas?
We have also fixed the emonHub restart button to restart the systemd service.
The only thing remaining (apart from fixing the group add issue mentioned above) is to fix the emonHub log Download button. This is currently broken. I propose when a user clicks the download button the journal log is saved to a tmp file which is then downloaded via the browser e.g
@borpin nailed it… needs a newer version of systemd… I ran into the same issue with the service-runner unit file trying to log to its own log file. (I was sure I’d posted about it somewhere either here or in the discussions about the service-runner PR but I can’t find it now!)
[EDIT]
Debian stretch includes v232, buster includes v240… so the StandardOutput feature will become available when we switch to buster (or later) ref
The stretch-backports version is v239, so that would also provide the feature without having to upgrade from stretch. This may be most appropriate for the emonSD image?
A reboot is not required, just a restart of apache2 is fine to apply the group changes. The issue I’m having is I can run the usermod command via sudo in a shell window no problem. However, to be able to roll this out to all emonPi users we need to be able to do it via the emonpi update script. For some reason (I’m not sure why) usemode command does not seem to do anything when ran from a script. Maybe it’s a permission issue? But as I mentioned other sudo commands work fine from the update script.
Ok, this issue has now been fixed. If a users runs emonPi update the emonhub log should start working again. Please let me know if it does. It may require a reboot for changes to take effect.
We just needed to add the www-data users to the systemd-journal group to allow it to read, this has been added to emonPi update and the emonhub config module readme