I'm using Ansible to start the mongod service on a Centos 6.8 VM. The task is pretty straightforward:
- name: Start mongod service
service:
state: started
name: mongod
However the service fails to start, and in /var/log/messages
I see
Jun 26 15:40:18 server1 ansible-service: Invoked with name=mongod pattern=None enabled=None state=started sleep=None arguments= runlevel=default
Jun 26 15:40:18 server1 init: mongod main process (4133) terminated with status 1
Jun 26 15:40:18 server1 init: mongod main process ended, respawning
Jun 26 15:40:18 server1 init: mongod main process (4143) terminated with status 1
Jun 26 15:40:18 server1 init: mongod main process ended, respawning
Jun 26 15:40:18 server1 init: mongod main process (4145) terminated with status 1
Jun 26 15:40:18 server1 init: mongod main process ended, respawning
Jun 26 15:40:18 server1 init: mongod main process (4147) terminated with status 1
Jun 26 15:40:18 server1 init: mongod main process ended, respawning
Jun 26 15:40:18 server1 init: mongod main process (4149) terminated with status 1
Jun 26 15:40:18 server1 init: mongod main process ended, respawning
Jun 26 15:40:18 server1 init: mongod main process (4151) terminated with status 1
Jun 26 15:40:18 server1 init: mongod main process ended, respawning
Jun 26 15:40:18 server1 init: mongod main process (4153) terminated with status 1
Jun 26 15:40:18 server1 init: mongod main process ended, respawning
Jun 26 15:40:18 server1 init: mongod main process (4155) terminated with status 1
Jun 26 15:40:18 server1 init: mongod main process ended, respawning
Jun 26 15:40:18 server1 init: mongod main process (4157) terminated with status 1
Jun 26 15:40:18 server1 init: mongod main process ended, respawning
Jun 26 15:40:18 server1 init: mongod main process (4159) terminated with status 1
Jun 26 15:40:18 server1 init: mongod main process ended, respawning
Jun 26 15:40:18 server1 init: mongod main process (4161) terminated with status 1
Jun 26 15:40:18 server1 init: mongod respawning too fast, stopped
In /var/log/mongodb/mongod.log
I see that the process received a SIGTERM
2020-06-25T18:57:21.842+0000 I NETWORK [conn1] end connection 127.0.0.1:49576 (0 connections now open)
2020-06-25T18:57:41.815+0000 I CONTROL [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
But I don't know what is sending this to the process, presumably init?
Now the really strange thing is that when I log on to the VM manually and start the mongod service, using service mongod start
, it's perfectly happy and starts up normally.
Any ideas how I can track this one down, and find out why my process is being killed when starting via Ansible?