emoncms icon indicating copy to clipboard operation
emoncms copied to clipboard

Service file modifications specific to EmonPi

Open borpin opened this issue 7 years ago • 1 comments

The modifications to the service files relating to the log file location cause pain for those not on an RPi as does the user command in service-runner. Specifically these lines need to be commented out for the service to start on a non Raspbian system. The user command can be edited out using systemd edit, but the EXEC lines cannot.

https://github.com/emoncms/emoncms/blob/14218680bebf11962b3888d3bb2f38fbaed069c2/scripts/services/emoncms_mqtt/emoncms_mqtt.service#L50-L57

https://github.com/emoncms/emoncms/blob/14218680bebf11962b3888d3bb2f38fbaed069c2/scripts/services/feedwriter/feedwriter.service#L50-L57

https://github.com/emoncms/emoncms/blob/14218680bebf11962b3888d3bb2f38fbaed069c2/scripts/services/service-runner/service-runner.service#L50

I don't believe that the design should require a non RPi user to edit these files especially as we move to a scripted solution for installation (which otherwise works well).

My Proposal is this;

  1. A systemd drop-in folder is created in GitHub and a drop-in file for the RPi specifc commands created.
  2. This drop-in folder can be symlinked in the same way the service file is.
  3. During scripted install, if the flag is set for it to be an EmonSD install is set, the drop-in folder is symlinked.
  4. An update to the update script will be required.

This solution does not prevent the user form overriding the drop-in it using the systemd structure.

I actually think using tmpfiles.d to ensure the file exists is a better solution to ensuring the log file is there (as proposed in #1351), but that did not seem to meet with universal approval when I floated it before.

@TrystanLea @pb66 @greeebs - as part of the original developers of the service files, what do you think?

Other than this, the install of EmonCMS via the script onto a fresh Ubuntu 18LTS VirtualBox VM worked perfectly.

Couple of references. https://community.openenergymonitor.org/t/better-handling-of-files-in-tmpfs-var-log/9315/24 https://community.openenergymonitor.org/t/var-log-still-filling-up/10921/27?u=borpin

borpin avatar Sep 12 '19 10:09 borpin

The EmonScripts now have a mechanism for creating drop-ins for the relevant services.

Documentation needs to be updated to allow for standalone install. I'll try and get this done.

borpin avatar Oct 11 '19 06:10 borpin