Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved the ulimit commands to the start function #363

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

citruspi
Copy link

The placement of the ulimit calls in the current init script for Red Hat systems results in the commands being called every time the script is called. This means that

$ service mongod start
$ service mongod stop
$ service mongod status
$ service mongod restart

all result in the ulimit calls being executed.

As far as I can see, this is unnecessary - they only need to be called when the service is starting.

While this isn't a problem itself, it can lead to some confusion. If a user runs

$ sudo service mongod start
$ service mongo status

he'll receive

/etc/init.d/mongod: line 70: ulimit: open files: cannot modify limit: Operation not permitted
/etc/init.d/mongod: line 72: ulimit: max user processes: cannot modify limit: Operation not permitted
mongod (pid 13466) is running...

MongoDB did start correctly... but the ulimit calls were executed again when the user attempted to get the service's status. Because the user didn't run it with root privileges, the calls failed and resulted in an error. Once again, it's not a problem, but it can be confusing.

@citruspi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant