docker-library / docker-library/mongo

forked temporary mongod not shutdown if initdb failing script

Open
#464 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
1.1k
Forks
658
Avg merge
4h 40m
Merged PRs (30d)
1

Description

when any script in /docker-entrypoint-initdb.d/* fails the whole docker-entrypoint.sh fails but without shutting down the temporary forked mongod

https://github.com/docker-library/mongo/blob/9db9e3d4704f5d963e424a3894fa740b8ce4ea70/4.4/docker-entrypoint.sh#L304

	function shutdown {
	     "${mongodHackedArgs[@]}" --shutdown
	      rm -f "$pidfile"
	}
        # hook showtdown
        trap shutdown EXIT

then
https://github.com/docker-library/mongo/blob/9db9e3d4704f5d963e424a3894fa740b8ce4ea70/4.4/docker-entrypoint.sh#L357

	rm -f "$pidfile"
        # reset shutdown
	trap - EXIT

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in 4.4/docker-entrypoint.sh around the shutdown trap near line 304 and the later pidfile cleanup near line 357. Reproduce an initdb script failure and verify that the temporary mongod is shut down and its pidfile is cleaned up when docker-entrypoint.sh exits.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, mongodb, shell
Domain
databases, devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.