[SERVER-4774] Add the `--shutdown` flag to OSX installs Created: 25/Jan/12  Updated: 10/May/22

Status: Backlog
Project: Core Server
Component/s: Internal Code
Affects Version/s: 2.0.2
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Michael A. Fiedler Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Unresolved Votes: 0
Labels: move-sa, shutdown
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Darwin (OSX)
Mongo 2.0.2


Participants:

 Description   

The `--shutdown` flag to the mongod process should be included to allow for script frameworks like launchctl to stop the service cleanly.
More on launchctl here: http://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/launchctl.1.html



 Comments   
Comment by Steven Vannelli [ 10/May/22 ]

Moving this ticket to the Backlog and removing the "Backlog" fixVersion as per our latest policy for using fixVersions.

Comment by Scott Hernandez (Inactive) [ 01/Feb/12 ]

Also worth noting that --shutdown is only available for linux builds ATM (2.0.3/2.1.0).

Comment by Michael A. Fiedler [ 25/Jan/12 ]

On the launchd side of things, here's a plist I put together one that works with load/unload statements:

$ cat org.mongodb.mongod.plist 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
 <key>UserName</key>
 <string>michael</string>
 <key>Label</key>
 <string>org.mongodb.mongod</string>
 <key>EnvironmentVariables</key>
   <dict>
   </dict>
 <key>ProgramArguments</key>
 <array>
 <string>/usr/local/bin/mongod</string>
 <string>--dbpath</string>
 <string>/Users/michael/tmp/demo/data/r1</string>
 <string>--logpath</string>
 <string>/Users/michael/tmp/demo/logs/mongod-r1.log</string>
 </array>
 <key>RunAtLoad</key>
 <true/>
</dict>
</plist>

So we can implement a launchd solution, irrespective of the --shutdown flag. But I think we should have the same flags on all systems for consistency.

Comment by Michael A. Fiedler [ 25/Jan/12 ]

Ok, I revise my statement. The flag is not needed for launchctl.

My statement should rather be: "mongod should respond to a --shutdown command on OSX, like it does on other platforms."

Comment by Scott Hernandez (Inactive) [ 25/Jan/12 ]

There doesn't seem to a way to do this, do you have some way which isn't documented here?
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man5/launchd.plist.5.html

Generated at Thu Feb 08 03:06:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.