We are noticing that there has been multiple reports of Openmrs service not starting up after the upgrade to first patch of 0.92 (0.92-147) released in Feb, 2020. The error is seen when the user used “service openmrs start” instead of “systemctl start openmrs”. The recommendation from 0.92 patch release onwards is to strictly use Systemctl command instead of service command to start/stop Bahmni services. The resolution below applies to both 0.92-147 as well as 0.92-155 patch releases.
The major change that was incorporated in the patch release was the move to Systemd service files. We have identified the following sequence of steps as a workaround to restart openmrs in case service command was used:
- mv /opt/openmrs/log /opt/openmrs/log-backup
- rm /var/log/openmrs (without ‘/’ at the end, we want to remove only the symlink)
- rm /var/run/openmrs (without ‘/’ at the end, we want to remove only the symlink)
- mkdir /opt/openmrs/log
- chown bahmni:bahmni /opt/openmrs/log
- ln -s /opt/openmrs/log /var/log/openmrs
- chown -R bahmni:bahmni /var/log/openmrs
To prevent use of service command (out of habit) to restart openmrs we have provided an optional suggestion in the release notes of 0.92 Patch released in June 2020.