Bahmni 0.92 Install on CentOS 7.6 Minimal Fails

@eddyprasetyo I’d like to know the edits too please :slight_smile:

Hello, I am having the exact same issue as reported by @mstreeton, i.e., CentOS 7.6 1810 build minimal. I have tried with CentOS 7.6 1810 build DVD and the same issue arises.

I tried to fire the installation modifying the local inventory without the ERP as in here https://pastebin.com/SLTcb6MS . In this case everything run without any problems. @mstreeton it would be interesting if you could try and see if you get the same result as me when installing without the ERP.

  1. Downgrade systemd to sysvinits seems not to be a good approach in my opinion. Is there any other version of CentOS you could recommend in order to surpass this and in case this is caused by that?

  2. As this happens only when installing ERP (Odoo in this case), could it be caused by it?

I would love to explore Bahmni and I hope someone can help on this.

1 Like

Just to confirm the install inventory you used does work, obviously without Odoo. I still cannot locate the lines to remove that @eddyprasetyo mentioned, will have to wait until someone comes up with a proper solution for this.

@mddubey @bhiravabhatla I see you are involved in some development on this board, is this issue above known about/raised and is someone actually looking into it? As right now clean installs using CentOS 7.6 minimal are not working for those of us wanting to try this.

1 Like

Hello Everyone.

Actually there’s someone who created patch for this. I’ll point out later.

Basically when you run the inventory, and it’s stop at task starting the service (openmrs, bahmni-erp-connect, bahmni-reports, I don’t include elis and dcm4chee so I don’t know if it face the same problems). Open the files in init.d directory, and search for line that contain "su " That’s was the one that create the problems. SysvInit run as root user, and use “su” command to switch user and run the services. This will fail when it’s already run as the designed user, and that was Sysmted does to the service that imported from sysvinit.

The “su” command exist in if-fi conditional block in the script. As far as I know there’s two of them in those 3 init script. This is the first :

You can either remove just the “su” part, or you can modify the conditional block to just run the “else” part. This means to remove the line start with if, then, su, else, fi in those block, and leave the line “sh $OPENMRS_SERVER_RUN” line.

This is the 2nd.

The same goes to the 2nd part, and for other two services (bahmni-erp-connect and bahmni-reports).

For odoo start service error, it’s different problem. As far as I know, for fresh centos 7.6 installing bahmni 0.92, its the problems with python binnary that connect with postgres. This will solve with installing “psycopg2-binary” package through pip install

sudo pip install psycopg2-binary

Hope this will help.

Best regards,

Eddy

As I mentioned earlier, theres someone who made a patch about this problem, on this tread post number 3.

Credit goes to original poster @yeowsen

It’s look like openelis service have the same problems.

Hi Mark,

There would be an official patch out for this from product soon. But until then - we have two work arounds.

a) Downgrade systemd and use yum version lock to freeze the version. [ Temporary work around ]
b) Change su -s /bin/bash to runuser -u . [ Patch version would have this as a fix]

Details below :

a) Downgrade systemd

Below steps are tested on Centos Version - CentOS Linux release 7.7.1908 (Core)

Systemd on Centos 7.6/7 has version of 219-67.el7_7.2 or 219-67.el7_7.1. Downgrade it to 219-67.el7. You might have to run dowgrade twice to get to the version 219-67.el7

yum downgrade systemd.x86_64 systemd-libs.x86_64 systemd-sysv.x86_64

Install yum version lock plugin

yum install yum-plugin-versionlock

Lock systemd and libgudev1 [ needed for odoo deployment]

yum versionlock systemd*
yum versionlock libgudev1-219-67.el7

yum versionlock list should show below output:

0:systemd-sysv-219-67.el7.*
0:systemd-219-67.el7.*
0:systemd-libs-219-67.el7.*
0:libgudev1-219-67.el7.*

Then run the installer - Everything should run properly.

b) Change su -s /bin/bash to runuser -u

The root cause of this issue lies around how we start the bahmni services or how we create pid files for the bahmni services.

In the LSB script files of respective services ( ex- /etc/init.d/openmrs) - We would need to replace su -s /bin/bash with runsuser -u in the start() and debug() methods.

Shortcut to do that in all the service configuration files is as belows:

sed -i 's:su -s /bin/bash:runuser -u:g' /etc/init.d/*
systemctl daemon-reload

Note - This has to be done during the installation whenever the installation fails after a service is installed and fails to start/stop. Rerun the installation after changing init script. The service configs come as part of respective rpms - so we cant alter them before running the installer.

1 Like

Hi Santosh,

Thanks for the reply. I just tried option a and that failed on a 7.7 install. Here is the error I got: https://pastebin.com/gXAPuKMk

Hi @bhiravabhatla , thanks for the detailed reply. I tried workaround a) in centOS 7.6 with defaults and I get the same error as described by @mstreeton above. Furthermore, I tried to stop and start the services using bahmni command line, and I get the following error:

TASK [bahmni-odoo : Start Odoo and enable at boot] ***************************** task path: /opt/bahmni-installer/bahmni-playbooks/roles/bahmni-odoo/tasks/main.y ml:112 fatal: [localhost]: FAILED! => {“changed”: false, “msg”: “Could not find the req uested service odoo: host”} to retry, use: --limit @/opt/bahmni-installer/bahmni-playbooks/all.retry

Although all bahmni services (openmrs, open-elis, mysql, postgres, httpd) are running, the page of bahmni, openmrs and openelis do not open in the browser after we stop and start service using bahmni command line. Tried to reboot and I had the same problem, i.e. those services are running but I cannot open the pages in the browser.

Regarding the services of odoo , bahmni-erp-connect and atomfeed-console, they are not found since installation:

[root@localhost ~]# service odoo status Redirecting to /bin/systemctl status odoo.service Unit odoo.service could not be found.

Hi,

My bad, Yum versionlock would not take multiple arguments. We would have to run the command twice to lock the versions of systemd and libgudev1 to respective versions.

I have corrected my response.

Lock systemd and libgudev1 [ needed for odoo deployment]

yum versionlock systemd*
yum versionlock libgudev1-219-67.el7

yum versionlock list should show below output:

0:systemd-sysv-219-67.el7.*
0:systemd-219-67.el7.*
0:systemd-libs-219-67.el7.*
0:libgudev1-219-67.el7.*

1 Like

Can we add ansible task to patch inits files before starting the services?

I was successfully able to use option a after the changes you provided :slight_smile:

1 Like

I guess we could. Just before each service is started. It would require changes in tasks for all the services.

I think we would receive a patch from product by doing exactly that or changing it in the rpms soon enough.

I got the error on downgrade of systemd on Centos 7.6 yum downgrade systemd.x86_64 systemd-libs.x86_64 systemd-sysv.x86_64 --skip-broken Skip-broken could not solve problems Error: Package: libgudev1-219-67.el7_7.2.x86_64 (@updates) Requires: systemd-libs = 219-67.el7_7.2 Removing: systemd-libs-219-67.el7_7.2.x86_64 (@updates) systemd-libs = 219-67.el7_7.2 Downgraded By: systemd-libs-219-67.el7_7.1.x86_64 (updates) systemd-libs = 219-67.el7_7.1 Available: systemd-libs-219-67.el7.i686 (base) systemd-libs = 219-67.el7 You could try running: rpm -Va --nofiles --nodigest

Use centOS version 7.7 build 1908 instead and follow instructions described by @bhiravabhatla post above. I used option a) Downgrade systemd and it worked fine.

Blockquote @bhiravabhatla @angshuonline I install successfully the bahmni 92 on both Centos 7.6 and 7.7. But while I try to run to bahmni -i local start I got the error on services start.The log shown on journalctl -xe…

Nov 12 13:17:25 localhost.localdomain su[2783]: (to bahmni) root on none Nov 12 13:17:25 localhost.localdomain systemd[1]: Started Session c16 of user bahmni. – Subject: Unit session-c16.scope has finished start-up – Defined-By: systemd – Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit session-c16.scope has finished starting up.

– The start-up result is done. Nov 12 13:17:25 localhost.localdomain su[2783]: pam_unix(su:session): session opened for user bahmni by (uid=0) Nov 12 13:17:25 localhost.localdomain su[2783]: pam_unix(su:session): session closed for user bahmni Nov 12 13:17:25 localhost.localdomain systemd[1]: New main PID 2785 does not belong to service, and PID file is not owned by Nov 12 13:17:25 localhost.localdomain systemd[1]: New main PID 2785 does not belong to service, and PID file is not owned by Nov 12 13:17:25 localhost.localdomain systemd[1]: Failed to start LSB: start and stop openmrs system,. – Subject: Unit openmrs.service has failed – Defined-By: systemd – Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit openmrs.service has failed.

– The result is failed. Nov 12 13:17:25 localhost.localdomain systemd[1]: Unit openmrs.service entered failed state. Nov 12 13:17:25 localhost.localdomain systemd[1]: openmrs.service failed. Nov 12 13:18:49 localhost.localdomain su[2937]: (to bahmni) root on pts/0 Nov 12 13:18:49 localhost.localdomain su[2937]: pam_unix(su:session): session opened for user bahmni by root(uid=0) Nov 12 13:18:49 localhost.localdomain su[2937]: pam_unix(su:session): session closed for user bahmni Nov 12 13:18:52 localhost.localdomain su[2980]: (to bahmni) root on pts/0 Nov 12 13:18:52 localhost.localdomain su[2980]: pam_unix(su:session): session opened for user bahmni by root(uid=0) Nov 12 13:18:52 localhost.localdomain su[2980]: pam_unix(su:session): session closed for user bahmni lines 1510-1538/1538 (END)

Greetings,

Here is the result of installing today on a digitalocean Image. This was without making the adjustments that I hadn’t yet read about to Downgrade systemd.

Centos 7.6 x64   
4 vCPUs
8GB / 160GB Disk 

Working

  • https:///:8069
  • https:///bahmni

404

  • https:///dcm4chee-web3
  • https:///event-log-service
  • https:///openelis

Please advise next steps I should take.

Thank you

Jahtoe

TASK [bahmni-erp-connect : Start bahmni-openerp-connect and enable at boot] ******************************************************************
task path: /opt/bahmni-installer/bahmni-playbooks/roles/bahmni-erp-connect/tasks/main.yml:55
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Unable to start service bahmni-erp-connect: Job for bahmni-erp-connect.service failed because a configured resource limit was exceeded. See \"systemctl status bahmni-erp-connect.service\" and \"journalctl -xe\" for details.\n"}
    to retry, use: --limit @/opt/bahmni-installer/bahmni-playbooks/all.retry

PLAY RECAP ***********************************************************************************************************************************
localhost                  : ok=257  changed=168  unreachable=0    failed=1   

Traceback (most recent call last):
  File "/usr/bin/bahmni", line 9, in <module>
    load_entry_point('bahmni==0.1', 'console_scripts', 'bahmni')()
  File "/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "build/bdist.linux-x86_64/egg/bahmni.py", line 79, in install
  File "/usr/lib64/python2.7/subprocess.py", line 542, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'ansible-playbook -i /etc/bahmni-installer/local all.yml -vv  --extra-vars '@/etc/bahmni-installer/rpm_versions.yml' --extra-vars '@/etc/bahmni-installer/setup.yml'' returned non-zero exit status 2
bahmni-emr.noarch                      0.92-183                      @bahmni    
bahmni-erp.noarch                      0.92-133                      @bahmni    
bahmni-erp-connect.noarch              0.92-133                      @bahmni    
bahmni-implementer-interface.noarch    0.92-30                       @bahmni    
bahmni-installer.noarch                0.92-142                      installed  
bahmni-lab.noarch                      0.92-54                       @bahmni    
bahmni-lab-connect.noarch              0.92-183                      @bahmni    
bahmni-reports.noarch                  0.92-25                       @bahmni    
bahmni-web.noarch                      0.92-183                      @bahmni    


[root@GHOMM ~]# systemctl status bahmni-erp-connect.service
● bahmni-erp-connect.service - (null)
   Loaded: loaded (/etc/rc.d/init.d/bahmni-erp-connect; bad; vendor preset: disabled)
   Active: failed (Result: resources) since Mon 2019-12-02 15:02:15 IST; 3min 9s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 3487 ExecStart=/etc/rc.d/init.d/bahmni-erp-connect start (code=exited, status=0/SUCCESS)

Dec 02 15:02:20 GHOMM bahmni-erp-connect[3487]: Dec 02, 2019 3:02:20 PM org.apache.catalina.core.ApplicationContext log
Dec 02 15:02:20 GHOMM bahmni-erp-connect[3487]: INFO: No Spring WebApplicationInitializer types detected on classpath
Dec 02 15:02:20 GHOMM bahmni-erp-connect[3487]: Dec 02, 2019 3:02:20 PM org.apache.catalina.core.ApplicationContext log
Dec 02 15:02:20 GHOMM bahmni-erp-connect[3487]: INFO: Initializing log4j from [/opt/bahmni-erp-connect/bahmni-erp-connect/WEB-INF/cl...4j.xml]
Dec 02 15:02:20 GHOMM bahmni-erp-connect[3487]: Dec 02, 2019 3:02:20 PM org.apache.catalina.core.ApplicationContext log
Dec 02 15:02:20 GHOMM bahmni-erp-connect[3487]: INFO: Initializing Spring root WebApplicationContext
Dec 02 15:02:23 GHOMM bahmni-erp-connect[3487]: Dec 02, 2019 3:02:23 PM org.apache.catalina.core.ApplicationContext log
Dec 02 15:02:23 GHOMM bahmni-erp-connect[3487]: INFO: Initializing Spring FrameworkServlet 'openerp-feed-service'
Dec 02 15:02:23 GHOMM bahmni-erp-connect[3487]: Dec 02, 2019 3:02:23 PM org.apache.coyote.AbstractProtocol start
Dec 02 15:02:23 GHOMM bahmni-erp-connect[3487]: INFO: Starting ProtocolHandler ["http-nio-8053"]
Hint: Some lines were ellipsized, use -l to show in full.


[root@GHOMM ~]# journalctl -xe
Dec 02 15:02:15 GHOMM systemd[1]: Refusing to accept PID outside of service control group, acquired through unsafe symlink chain: /var/run/bah
Dec 02 15:02:15 GHOMM systemd[1]: Failed to start (null).
-- Subject: Unit bahmni-erp-connect.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit bahmni-erp-connect.service has failed.
--
-- The result is failed.
Dec 02 15:02:15 GHOMM systemd[1]: Unit bahmni-erp-connect.service entered failed state.
Dec 02 15:02:15 GHOMM systemd[1]: bahmni-erp-connect.service failed.
Dec 02 15:02:16 GHOMM bahmni-erp-connect[3487]: Dec 02, 2019 3:02:16 PM org.apache.coyote.AbstractProtocol init
Dec 02 15:02:16 GHOMM bahmni-erp-connect[3487]: INFO: Initializing ProtocolHandler ["http-nio-8053"]
Dec 02 15:02:16 GHOMM bahmni-erp-connect[3487]: Dec 02, 2019 3:02:16 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
Dec 02 15:02:16 GHOMM bahmni-erp-connect[3487]: INFO: Using a shared selector for servlet write/read
Dec 02 15:02:16 GHOMM bahmni-erp-connect[3487]: Dec 02, 2019 3:02:16 PM org.apache.catalina.core.StandardService startInternal
Dec 02 15:02:16 GHOMM bahmni-erp-connect[3487]: INFO: Starting service Tomcat
Dec 02 15:02:16 GHOMM bahmni-erp-connect[3487]: Dec 02, 2019 3:02:16 PM org.apache.catalina.core.StandardEngine startInternal
Dec 02 15:02:16 GHOMM bahmni-erp-connect[3487]: INFO: Starting Servlet Engine: Apache Tomcat/8.0.12
Dec 02 15:02:16 GHOMM bahmni-erp-connect[3487]: Dec 02, 2019 3:02:16 PM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
Dec 02 15:02:16 GHOMM bahmni-erp-connect[3487]: INFO: No global web.xml found
Dec 02 15:02:20 GHOMM bahmni-erp-connect[3487]: Dec 02, 2019 3:02:20 PM org.apache.catalina.core.ApplicationContext log
Dec 02 15:02:20 GHOMM bahmni-erp-connect[3487]: INFO: No Spring WebApplicationInitializer types detected on classpath
Dec 02 15:02:20 GHOMM bahmni-erp-connect[3487]: Dec 02, 2019 3:02:20 PM org.apache.catalina.core.ApplicationContext log
Dec 02 15:02:20 GHOMM bahmni-erp-connect[3487]: INFO: Initializing log4j from [/opt/bahmni-erp-connect/bahmni-erp-connect/WEB-INF/classes/log4
Dec 02 15:02:20 GHOMM bahmni-erp-connect[3487]: Dec 02, 2019 3:02:20 PM org.apache.catalina.core.ApplicationContext log
Dec 02 15:02:20 GHOMM bahmni-erp-connect[3487]: INFO: Initializing Spring root WebApplicationContext
Dec 02 15:02:23 GHOMM bahmni-erp-connect[3487]: Dec 02, 2019 3:02:23 PM org.apache.catalina.core.ApplicationContext log
Dec 02 15:02:23 GHOMM bahmni-erp-connect[3487]: INFO: Initializing Spring FrameworkServlet 'openerp-feed-service'
Dec 02 15:02:23 GHOMM bahmni-erp-connect[3487]: Dec 02, 2019 3:02:23 PM org.apache.coyote.AbstractProtocol start
Dec 02 15:02:23 GHOMM bahmni-erp-connect[3487]: INFO: Starting ProtocolHandler ["http-nio-8053"]
Dec 02 15:02:29 GHOMM odoo[2917]: Warn: Can't find .pfb for face 'Times-Roman'
Dec 02 15:02:47 GHOMM sshd[3584]: Did not receive identification string from 45.119.212.105 port 59732
Dec 02 15:05:43 GHOMM sshd[4859]: Received disconnect from 45.119.212.105 port 51000:11: Normal Shutdown, Thank you for playing [preauth]
Dec 02 15:05:43 GHOMM sshd[4859]: Disconnected from 45.119.212.105 port 51000 [preauth]

Here is the results of an installation on digital ocean trying the downgrade instructions. Although I’m not sure if those are only for centos minimal.

Centos 7.6 x64   
4 vCPUs
8GB / 160GB Disk 

Result

All systems not available from url.

   yum update
       yum downgrade systemd.x86_64 systemd-libs.x86_64 systemd-sysv.x86_64
       Install yum version lock plugin
       install yum version lock plugin
       yum install yum-plugin-versionlock
       yum versionlock systemd*
       yum versionlock libgudev1-219-67.el7
       yum versionlock list 
       sudo dd if=/dev/zero of=/swapfile bs=1024 count=4096k
       sudo mkswap /swapfile
       sudo swapon /swapfile 
       echo '/swapfile   swap   swap    defaults        0 0' | sudo tee --append /etc/fstab

#Prerequisite for the fresh installation of Bahmni
yum -y install https://kojipkgs.fedoraproject.org//packages/zlib/1.2.11/18.fc30/x86_64/zlib-1.2.11-18.fc30.x86_64.rpm
 
 
# Install the bahmni command line program (Choose the version you want).
yum -y install https://dl.bintray.com/bahmni/rpm/rpms/bahmni-installer-0.92-142.noarch.rpm
 
# Confirm that the bahmni command is correctly installed (you should see a help message for the command)
bahmni --help
  
# Now setup a configuration file for bahmni command in /etc/bahmni-installer.
curl -L https://tinyurl.com/yyoj98df >> /etc/bahmni-installer/setup.yml
  
# Confirm the contents of the file. It should look like this file: (https://goo.gl/R8ekg5)
cat /etc/bahmni-installer/setup.yml
 
# The above setup.yml, has a timezone entry. You can change it to suit your timezone if you like. For valid options
# please read this document: https://bahmni.atlassian.net/wiki/display/BAH/List+Of+Configurable+Installation+Variables
 
# Set the inventory file name to local in BAHMNI_INVENTORY environment variable. This way you won't need to use the '-i local' switch every time you use the 'bahmni' command
#You can also configure custom inventory file instead of local.
echo "export BAHMNI_INVENTORY=local" >> ~/.bashrc
source ~/.bashrc
  
# Now fire the installer
bahmni install 
  
# The installation should be done in about 15 - 30 minutes depending on your internet speed.
# Verify installed components using the command:
yum list installed | grep bahmni





TASK [bahmni-emr : Start openmrs] ************************************************************************************************************
task path: /opt/bahmni-installer/bahmni-playbooks/roles/bahmni-emr/tasks/main.yml:218
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Unable to start service openmrs: Job for openmrs.service failed because a configured resource limit was exceeded. See \"systemctl status openmrs.service\" and \"journalctl -xe\" for details.\n"}
	to retry, use: --limit @/opt/bahmni-installer/bahmni-playbooks/all.retry

PLAY RECAP ***********************************************************************************************************************************
localhost                  : ok=127  changed=85   unreachable=0    failed=1   

Traceback (most recent call last):
  File "/usr/bin/bahmni", line 9, in <module>
load_entry_point('bahmni==0.1', 'console_scripts', 'bahmni')()
  File "/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 717, in main
rv = self.invoke(ctx)
  File "/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
  File "build/bdist.linux-x86_64/egg/bahmni.py", line 79, in install
  File "/usr/lib64/python2.7/subprocess.py", line 542, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'ansible-playbook -i /etc/bahmni-installer/local all.yml -vv  --extra-vars '@/etc/bahmni-installer/rpm_versions.yml' --extra-vars '@/etc/bahmni-installer/setup.yml'' returned non-zero exit status 2
bahmni-emr.noarch                  0.92-183                   @bahmni           
bahmni-installer.noarch            0.92-142                   @/bahmni-installer-0.92-142.noarch
[root@GHOMM2 ~]# systemctl status openmrs.service
● openmrs.service - LSB: start and stop openmrs system,
   Loaded: loaded (/etc/rc.d/init.d/openmrs; bad; vendor preset: disabled)
   Active: failed (Result: resources) since Mon 2019-12-02 16:44:31 IST; 7min ago
 Docs: man:systemd-sysv-generator(8)
  Process: 8590 ExecStart=/etc/rc.d/init.d/openmrs start (code=exited, status=0/SUCCESS)

Dec 02 16:44:30 GHOMM2 systemd[1]: Starting LSB: start and stop openmrs system,...
Dec 02 16:44:31 GHOMM2 openmrs[8590]: Starting openmrs
Dec 02 16:44:31 GHOMM2 su[8605]: (to bahmni) root on none
Dec 02 16:44:31 GHOMM2 systemd[1]: Refusing to accept PID outside of service control group, acquired through unsafe symlink chain: ...nmrs.pid
Dec 02 16:44:31 GHOMM2 systemd[1]: Refusing to accept PID outside of service control group, acquired through unsafe symlink chain: ...nmrs.pid
Dec 02 16:44:31 GHOMM2 systemd[1]: Failed to start LSB: start and stop openmrs system,.
Dec 02 16:44:31 GHOMM2 systemd[1]: Unit openmrs.service entered failed state.
Dec 02 16:44:31 GHOMM2 systemd[1]: openmrs.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
[root@GHOMM2 ~]# journalctl -xe
-- 
-- Unit openmrs.service has begun starting up.
Dec 02 16:44:31 GHOMM2 openmrs[8590]: Starting openmrs
Dec 02 16:44:31 GHOMM2 su[8605]: (to bahmni) root on none
Dec 02 16:44:31 GHOMM2 systemd[1]: Created slice User Slice of bahmni.
-- Subject: Unit user-1001.slice has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit user-1001.slice has finished starting up.
-- 
-- The start-up result is done.
Dec 02 16:44:31 GHOMM2 systemd[1]: Started Session c1 of user bahmni.
-- Subject: Unit session-c1.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit session-c1.scope has finished starting up.
-- 
-- The start-up result is done.
Dec 02 16:44:31 GHOMM2 su[8605]: pam_unix(su:session): session opened for user bahmni by (uid=0)
Dec 02 16:44:31 GHOMM2 su[8605]: pam_unix(su:session): session closed for user bahmni
Dec 02 16:44:31 GHOMM2 systemd[1]: Refusing to accept PID outside of service control group, acquired through unsafe symlink chain: /var/run/op
Dec 02 16:44:31 GHOMM2 systemd[1]: Refusing to accept PID outside of service control group, acquired through unsafe symlink chain: /var/run/op
Dec 02 16:44:31 GHOMM2 systemd[1]: Failed to start LSB: start and stop openmrs system,.
-- Subject: Unit openmrs.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit openmrs.service has failed.
-- 
-- The result is failed.
Dec 02 16:44:31 GHOMM2 systemd[1]: Unit openmrs.service entered failed state.
Dec 02 16:44:31 GHOMM2 systemd[1]: openmrs.service failed.
Dec 02 16:55:31 GHOMM2 sshd[9735]: Did not receive identification string from 41.226.38.33 port 56349

Kindly advise Regards Jahtoe

Hi @jahtoe

Could you please share the current systemd version. (after downgrade)

Thanks Santosh

Hi @bhiravabhatla

Oh I’m seeing that I missed that I need to downgrade a second time. I’ll try that. I had downgraded to 0:219-67.el7_7.1

I’ve corrected that with this installation script that installs without error however openelis is not available.

Installation Script

yum -y update
yum -y downgrade systemd.x86_64 systemd-libs.x86_64 systemd-sysv.x86_64
yum -y downgrade systemd.x86_64 systemd-libs.x86_64 systemd-sysv.x86_64
yum -y install yum-plugin-versionlock
yum versionlock systemd*
yum versionlock libgudev1-219-67.el7
yum versionlock list 


sudo dd if=/dev/zero of=/swapfile bs=1024 count=4096k
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
swapon -s
sysctl vm.swappiness=10
echo 'vm.swappiness = 10' >> /etc/sysctl.conf
echo '/swapfile swap swap defaults 0 0' | tee --append /etc/fstab


#Prerequisite for the fresh installation of Bahmni
yum -y install https://kojipkgs.fedoraproject.org//packages/zlib/1.2.11/18.fc30/x86_64/zlib-1.2.11-18.fc30.x86_64.rpm


# Install the bahmni command line program (Choose the version you want).
yum -y install https://dl.bintray.com/bahmni/rpm/rpms/bahmni-installer-0.92-142.noarch.rpm

# Confirm that the bahmni command is correctly installed (you should see a help message for the command)
bahmni --help

# Now setup a configuration file for bahmni command in /etc/bahmni-installer.
curl -L https://tinyurl.com/yyoj98df >> /etc/bahmni-installer/setup.yml

# Confirm the contents of the file. It should look like this file: (https://goo.gl/R8ekg5)

sed -i 's/Asia/Etc/g' /etc/bahmni-installer/setup.yml
sed -i 's/Kolkata/GMT/g' /etc/bahmni-installer/setup.yml
cat /etc/bahmni-installer/setup.yml

# The above setup.yml, has a timezone entry. You can change it to suit your timezone if you like. For valid options
# please read this document: https://bahmni.atlassian.net/wiki/display/BAH/List+Of+Configurable+Installation+Variables

# Set the inventory file name to local in BAHMNI_INVENTORY environment variable. This way you won't need to use the '-i local' switch every time you use the 'bahmni' command
#You can also configure custom inventory file instead of local.
echo "export BAHMNI_INVENTORY=local" >> ~/.bashrc
source ~/.bashrc

# Now fire the installer
bahmni install 

Result

PLAY RECAP ***********************************************************************************************************************************

localhost : ok=298 changed=202 unreachable=0 failed=0

yum list installed | grep bahmni

atomfeed-console.noarch               1.1-1                      @bahmni        
bahmni-emr.noarch                     0.92-183                   @bahmni        
bahmni-erp.noarch                     0.92-133                   @bahmni        
bahmni-erp-connect.noarch             0.92-133                   @bahmni        
bahmni-implementer-interface.noarch   0.92-30                    @bahmni        
bahmni-installer.noarch               0.92-142                   @/bahmni-installer-0.92-142.noarch
bahmni-lab.noarch                     0.92-54                    @bahmni        
bahmni-lab-connect.noarch             0.92-183                   @bahmni        
bahmni-reports.noarch                 0.92-25                    @bahmni        
bahmni-web.noarch                     0.92-183                   @bahmni  

systemctl status bahmni-erp-connect.service

● bahmni-erp-connect.service - (null)
   Loaded: loaded (/etc/rc.d/init.d/bahmni-erp-connect; bad; vendor preset: disabled)
   Active: inactive (dead) since Wed 2019-12-04 11:20:43 GMT; 3min 34s ago
     Docs: man:systemd-sysv-generator(8)

Dec 04 11:20:43 G2 systemd[1]: Starting (null)...
Dec 04 11:20:43 G2 bahmni-erp-connect[17169]: Starting bahmni-erp-connect
Dec 04 11:20:43 G2 su[17180]: (to bahmni) root on none
Dec 04 11:20:43 G2 systemd[1]: Permission denied while opening PID file or unsafe symlink chain: /var/run/bahmni-erp-connect/bahmn...nnect.pid
Dec 04 11:20:43 G2 bahmni-erp-connect[17185]: Terminating bahmni-erp-connect
Dec 04 11:20:43 G2 systemd[1]: Started (null).

journalctl -xe

Dec 04 11:23:24 G2 yum[21988]: Installed: perl-DBD-Pg-2.19.3-4.el7.x86_64
Dec 04 11:23:24 G2 yum[21988]: Installed: centos-release-scl-2-3.el7.centos.noarch
Dec 04 11:23:24 G2 yum[21988]: Installed: perl-JSON-PP-2.27202-2.el7.noarch
Dec 04 11:23:24 G2 yum[21988]: Installed: perl-JSON-2.59-2.el7.noarch
Dec 04 11:23:26 G2 ansible-command[22054]: Invoked with warn=True executable=None _uses_shell=True _raw_params=wget -q -O - \https://github.co
Dec 04 11:23:26 G2 ansible-command[22054]: [WARNING] Consider using get_url or uri module rather than running wget
Dec 04 11:23:28 G2 ansible-file[22078]: Invoked with directory_mode=None force=False remote_src=None path=/usr/bin/pgbackrest owner=None follo
Dec 04 11:23:29 G2 ansible-file[22096]: Invoked with directory_mode=None force=False remote_src=None path=/usr/bin/pg_backrest owner=None foll
Dec 04 11:23:29 G2 ansible-file[22112]: Invoked with directory_mode=None force=False remote_src=None path=/usr/lib/perl5/BackRest owner=None f
Dec 04 11:23:29 G2 ansible-file[22128]: Invoked with directory_mode=None force=False remote_src=None path=/usr/share/perl5/BackRest owner=None
Dec 04 11:23:30 G2 ansible-file[22144]: Invoked with directory_mode=None force=False remote_src=None path=/usr/lib/perl5/pgbackrest owner=None
Dec 04 11:23:30 G2 ansible-file[22161]: Invoked with directory_mode=None force=False remote_src=None path=/usr/share/perl5/pgBackRest owner=No
Dec 04 11:23:30 G2 ansible-command[22178]: Invoked with warn=True executable=None _uses_shell=False _raw_params=cp -R "/home/bahmni/pgbackrest
Dec 04 11:23:30 G2 ansible-command[22197]: Invoked with warn=True executable=None _uses_shell=True _raw_params=find /usr/share/perl5/pgBackRes
Dec 04 11:23:31 G2 ansible-command[22217]: Invoked with warn=True executable=None _uses_shell=True _raw_params=find /usr/share/perl5/pgBackRes
Dec 04 11:23:31 G2 ansible-command[22238]: Invoked with warn=True executable=None _uses_shell=True _raw_params=cp -R "/home/bahmni/pgbackrest-
Dec 04 11:23:31 G2 ansible-file[22259]: Invoked with directory_mode=None force=False remote_src=None path=/var/log/pgbackrest owner=postgres f
Dec 04 11:23:32 G2 ansible-file[22277]: Invoked with directory_mode=None force=False remote_src=None path=/var/lib/pgbackrest owner=postgres f
Dec 04 11:23:32 G2 ansible-file[22295]: Invoked with directory_mode=None force=False remote_src=None path=/etc/pgbackrest.conf owner=postgres 
Dec 04 11:23:32 G2 ansible-stat[22314]: Invoked with checksum_algorithm=sha1 get_checksum=True path=/etc/pgbackrest.conf checksum_algo=sha1 fo
Dec 04 11:23:33 G2 ansible-copy[22326]: Invoked with directory_mode=None force=True remote_src=None owner=None follow=False local_follow=None 
Dec 04 11:23:33 G2 ansible-systemd[22344]: Invoked with no_block=False name=postgresql-9.6 enabled=None daemon_reload=False state=restarted us
Dec 04 11:23:33 G2 systemd[1]: Stopping PostgreSQL 9.6 database server...
-- Subject: Unit postgresql-9.6.service has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit postgresql-9.6.service has begun shutting down.
Dec 04 11:23:37 G2 systemd[1]: Stopped PostgreSQL 9.6 database server.
-- Subject: Unit postgresql-9.6.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit postgresql-9.6.service has finished shutting down.
Dec 04 11:23:37 G2 systemd[1]: Starting PostgreSQL 9.6 database server...
-- Subject: Unit postgresql-9.6.service has begun start-up
...skipping...
Dec 04 11:23:24 G2 yum[21988]: Installed: centos-release-scl-2-3.el7.centos.noarch
Dec 04 11:23:24 G2 yum[21988]: Installed: perl-JSON-PP-2.27202-2.el7.noarch
Dec 04 11:23:24 G2 yum[21988]: Installed: perl-JSON-2.59-2.el7.noarch
Dec 04 11:23:26 G2 ansible-command[22054]: Invoked with warn=True executable=None _uses_shell=True _raw_params=wget -q -O - \https://github.co
Dec 04 11:23:26 G2 ansible-command[22054]: [WARNING] Consider using get_url or uri module rather than running wget
Dec 04 11:23:28 G2 ansible-file[22078]: Invoked with directory_mode=None force=False remote_src=None path=/usr/bin/pgbackrest owner=None follo
Dec 04 11:23:29 G2 ansible-file[22096]: Invoked with directory_mode=None force=False remote_src=None path=/usr/bin/pg_backrest owner=None foll
Dec 04 11:23:29 G2 ansible-file[22112]: Invoked with directory_mode=None force=False remote_src=None path=/usr/lib/perl5/BackRest owner=None f
Dec 04 11:23:29 G2 ansible-file[22128]: Invoked with directory_mode=None force=False remote_src=None path=/usr/share/perl5/BackRest owner=None
Dec 04 11:23:30 G2 ansible-file[22144]: Invoked with directory_mode=None force=False remote_src=None path=/usr/lib/perl5/pgbackrest owner=None
Dec 04 11:23:30 G2 ansible-file[22161]: Invoked with directory_mode=None force=False remote_src=None path=/usr/share/perl5/pgBackRest owner=No
Dec 04 11:23:30 G2 ansible-command[22178]: Invoked with warn=True executable=None _uses_shell=False _raw_params=cp -R "/home/bahmni/pgbackrest
Dec 04 11:23:30 G2 ansible-command[22197]: Invoked with warn=True executable=None _uses_shell=True _raw_params=find /usr/share/perl5/pgBackRes
Dec 04 11:23:31 G2 ansible-command[22217]: Invoked with warn=True executable=None _uses_shell=True _raw_params=find /usr/share/perl5/pgBackRes
Dec 04 11:23:31 G2 ansible-command[22238]: Invoked with warn=True executable=None _uses_shell=True _raw_params=cp -R "/home/bahmni/pgbackrest-
Dec 04 11:23:31 G2 ansible-file[22259]: Invoked with directory_mode=None force=False remote_src=None path=/var/log/pgbackrest owner=postgres f
Dec 04 11:23:32 G2 ansible-file[22277]: Invoked with directory_mode=None force=False remote_src=None path=/var/lib/pgbackrest owner=postgres f
Dec 04 11:23:32 G2 ansible-file[22295]: Invoked with directory_mode=None force=False remote_src=None path=/etc/pgbackrest.conf owner=postgres 
Dec 04 11:23:32 G2 ansible-stat[22314]: Invoked with checksum_algorithm=sha1 get_checksum=True path=/etc/pgbackrest.conf checksum_algo=sha1 fo
Dec 04 11:23:33 G2 ansible-copy[22326]: Invoked with directory_mode=None force=True remote_src=None owner=None follow=False local_follow=None 
Dec 04 11:23:33 G2 ansible-systemd[22344]: Invoked with no_block=False name=postgresql-9.6 enabled=None daemon_reload=False state=restarted us
Dec 04 11:23:33 G2 systemd[1]: Stopping PostgreSQL 9.6 database server...
-- Subject: Unit postgresql-9.6.service has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit postgresql-9.6.service has begun shutting down.
Dec 04 11:23:37 G2 systemd[1]: Stopped PostgreSQL 9.6 database server.
-- Subject: Unit postgresql-9.6.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit postgresql-9.6.service has finished shutting down.
Dec 04 11:23:37 G2 systemd[1]: Starting PostgreSQL 9.6 database server...
-- Subject: Unit postgresql-9.6.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit postgresql-9.6.service has begun starting up.
Dec 04 11:23:37 G2 postmaster[22362]: LOG:  redirecting log output to logging collector process
Dec 04 11:23:37 G2 postmaster[22362]: HINT:  Future log output will appear in directory "pg_log".
Dec 04 11:23:37 G2 systemd[1]: Started PostgreSQL 9.6 database server.
-- Subject: Unit postgresql-9.6.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit postgresql-9.6.service has finished starting up.
-- 
-- The start-up result is done.
Dec 04 11:23:37 G2 sudo[22388]:     root : TTY=pts/0 ; PWD=/opt/bahmni-installer/bahmni-playbooks ; USER=postgres ; COMMAND=/bin/sh -c echo BE
Dec 04 11:23:37 G2 sudo[22388]: pam_unix(sudo:session): session opened for user postgres by root(uid=0)
Dec 04 11:23:37 G2 ansible-command[22392]: Invoked with warn=True executable=None _uses_shell=True _raw_params=pgbackrest --stanza=bahmni-post
Dec 04 11:23:39 G2 sudo[22388]: pam_unix(sudo:session): session closed for user postgres

Thanks for your support Regards Jahtoe

1 Like

we are trying to get a patch out next week, but in the meantime, you can do the following

  1. edit /etc/init.d/bahmni-erp-connect
  2. change the start() function … and the line

“su -s /bin/bash $BAHMNI_ERP_CONNECT_USER $BAHMNI_ERP_CONNECT_RUN” to runuser -u $BAHMNI_ERP_CONNECT_USER $BAHMNI_ERP_CONNECT_RUN"

  1. save and do

systemctl daemon-reload

  1. restart service

service bahmni-erp-connect start

Similar things need to do be done for bahmni-lab, if you are facing starting “bahmni-lab” service as well.

1 Like