While capturing stdout and stderr and automatically logging that to system
logging daemon provides basic information, a lot of information lost in the
process.
This change logs to systemd journal directly so that rich information such as
code file, code function, code line, etc, can be captured in a structured way.
To avoid double logging, discard stdout and stderr in the systemd unit file.
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
We pretty much only run in systemd environment and I don't see that
changing any time soon. By relying on it, we can reduce some burden.
Remove init script.
Daemonizing is not needed for systemd. Remove code related
daemonization.
- When running in an environment without systemd, the changes are completely
ignored.
- When running under systemd, the patch introduces a systemd native service
file to take advantages of nice feature provided by systemd.
- One of the feature currently taken advantage of is the ability to restart the
service automatically if it ever crashes or exits with error.
- Another feature is that when we wish to kill Plinth all the processes under
the cgroup are killed as well.