-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 1.3.1
-
Component/s: None
-
None
-
Environment:Ubuntu
The file debian/init.d has some issues:
- The name is set to "MongoDB". By convention this should be all lower case
- DAEMONUSER is set to a hard coded value after /etc/default/$NAME has been read which makes it impossible to override the user
- DAEMON_OPTS should be composed after /etc/default/$NAME is read (and only if $DAEMON_OPTS is not already set). That would allow default to set things like the data directory easily (the single most likely thing someone would want to set)
- DAEMONUSER is explicitly set and is a failure if not existing. Later on there are codepaths for it being set or not. Make your mind up
- Part of that checking sets DAEMONUID/GID but never uses them. The other tools used such as start_stop_daemon use the textual name and report errors, so leave all this user stuff up to them.
- For reload_server, the comment says SIGHUP is sent but the code sends USR1. The comment has no value and should be removed
- The main switch/case loop has a bunch of commented out code for reload. Delete it. Also reload_server() exists, so use it!