FS#24983 - [mongodb] Init script issues, default data directory

Attached to Project: Community Packages
Opened by Dan McGee (toofishes) - Friday, 01 July 2011, 16:53 GMT
Last edited by Thomas Dziedzic (tomd123) - Saturday, 02 July 2011, 05:06 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Thomas Dziedzic (tomd123)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

1. The init script always returns success, even if mongodb fails to start correctly. To reproduce, set dbpath in /etc/mongodb.conf to something bogus, or something the mongodb user doesn't have permissions on, and run the script.
2. The init script has a messy su -> bash -> mongod call chain, which is totally unnecessary. Use --fork instead of "/bin/bash .. &". It looks like the reason this is needed is due to the user having a shell of /bin/false; the user should have a shell of /bin/bash instead since they are not allowed as a login user anyway.
3. Instead of redirection of output, use "--logpath /var/log/mongodb/mongod.log --logappend", and don't suppress any stderr output of mongod. The log has to be in a subdirectory with mongodb user permissions.
4. "/var/state/mongodb" is very odd as a default dbpath. /var/state/ is not in the FHS (http://www.pathname.com/fhs/pub/fhs-2.3.html), this should be "/var/lib/mongodb".
5. Never ever stop a daemon. Ever.
6. Install messages are annoying, be brief and don't show them on upgrade if unnecessary.

Patch attached for all of this. Unfortunately it isn't all perfectly backward compatible, but adjusting shouldn't be too tough for existing users (dbpath change, logpath change + permissions).
This task depends upon

Closed by  Thomas Dziedzic (tomd123)
Saturday, 02 July 2011, 05:06 GMT
Reason for closing:  Fixed
Additional comments about closing:  pkgrel 2
Comment by Thomas Dziedzic (tomd123) - Saturday, 02 July 2011, 05:06 GMT
I love bug reports with patches attached!

Loading...