Bahmni installation fails due to upgraded systemd

Description

Env: In CentOS 7.7 and/or Centos 7.6 (latest, and/or with systemd updated)
Context and Analysis:
Most of Bahmni daemon services are run with Sysv init scripts placed under /etc/init.d/
However, with updated CentOS 7.6, Centos7.7, Bahmni installation fails.
See also
1. Links: https://talk.openmrs.org/t/announcing-bahmni-0-92-release-candidate/23758/63
2. Links: https://talk.openmrs.org/t/announcing-bahmni-0-92-release-candidate/23758/87

While starting with "systemctl start <service name>", the logs report
“Systemd Service Fails To Start With 'Refusing to accept PID outside of service control group, acquired through unsafe symlink chain' “

This is relevant to reported bug https://access.redhat.com/solutions/4397951

This happens because we want to start a daemon process for a service with “bahmni” which is a no login user.
service <name> start - works fine because it does not involve the PAM sessions as with systemctl
However for provisioning, since we use the ansible module “systemd” which creates a generated service file under /run/systemd/generator.late/<name.service>
(or identifiable from "systemctl show <service name>, check "fragmentPath")

  • in bash sysvinit scripts - we use “su -s bahmni <command>”

  • This can be rectified by changing the sysv init scripts to use "runuser" instead of “su -s /bin/bash bahmni <command>”.

  • e.g. runuser -u bahmni <command>
    However, instead of updating the scripts (to use runuser) we have decided to introduce service files as part of the RPM.

Resolution:

  • introduce service file as part of the rpm packaging

  • improve sysv init script for the specific services to use
    > sh <command>
    While the owner of the process is mentioned in the service file, using <User>

  • The following services need to be modified.

    • openmrs

    • bahmni-erp-connect

    • bahmni-lab

    • bahmni-reports

    • dcm4chee

    • odoo (may not be required)

    • pacs-integration

  • Generate all rpms again. Release to internal s3

  • Test on different OS and distros (including 7.5, 7.6 and 7.7)

  • Test for each component

  • Upload to bintray post verification

Status

Assignee

Unassigned

Reporter

Angshuman Sarkar

Labels

None

Units

None

PercentDone

None

DueTime

None

Clients

None

External issue ID

None

UAT Assignee

None

Reviewer

None

Sprint

Fix versions

Configure