exec: Add support for env STATE_DIRECTORY
Image mode recommendation is to not ship /var/lib subdirectories if
possible and bootc lint produces warning if not. This was the case
also for Corosync.
Simplest possible solution seems to implement support for systemd
unit StateDirectory functionality and not ship /var/lib/corosync
in rpm.
So patch:
- Adds support for reading the environment variable STATE_DIRECTORY which is set by systemd and use it as a default value for system.state_dir configuration option. This is generally useful feature even for non-systemd builds.
- Set StateDirectory in service file
- Drop /var/lib/corosync directory from RPM for systemd builds
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>