[SERVER-28525] SystemD services depending on mongod will be started before mongo is ready to take connections Created: 28/Mar/17 Updated: 21/Sep/17 Resolved: 07/Apr/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Packaging |
| Affects Version/s: | 3.4.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Stephen Lynx | Assignee: | Mark Agarunov |
| Resolution: | Done | Votes: | 0 |
| Labels: | init-script, systemd | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Centos 7. |
||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: | Make a systemD script that is set to start after mongod. |
||||||||
| Participants: | |||||||||
| Description |
|
I have the following systemD script for my software:
See "After=mongod.service". Because of that, my software expects mongo to be ready to take connections when it is booted by this init script. However, for 3.4, mongo is not ready yet to take connections when my software runs. I just tested with 3.2 and everything works as expected, my service is always able to connect to mongo when the system boots. |
| Comments |
| Comment by Stephen Lynx [ 08/Sep/17 ] | ||||||||||||||
|
Changed my init script to
Still not starting on boot. | ||||||||||||||
| Comment by Mark Agarunov [ 04/Apr/17 ] | ||||||||||||||
|
Hello stephenlynx, Looking over the unit file you've provided, you may get the desired behavior by adding Requires=mongod.service or Wants=mongod.service to the [Unit] section of your service. The systemd documentation has a bit more info on these parameters. Thanks, | ||||||||||||||
| Comment by Ramon Fernandez Marina [ 04/Apr/17 ] | ||||||||||||||
|
Thanks for your report stephenlynx, we can reproduce the behavior you describe and are investigating. |