Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 511452 - =dev-db/mongodb-2.6.1 runs as root instead of mongodb:mongodb
Summary: =dev-db/mongodb-2.6.1 runs as root instead of mongodb:mongodb
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Ultrabug
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-25 13:55 UTC by Adrian
Modified: 2014-05-26 08:05 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian 2014-05-25 13:55:37 UTC
dev-db/mongodb-2.6.1 (~) starts as root although it should be running as mongodb:mongodb as indicated in the conf.d script:

# - user : the user used to run your mongodb instance (default : mongodb)
# - group : the group used to run your mongodb instance (default : mongodb)

According to an echo in the init.d script $user and $group are set propertly. Not sure where the bug is. Maybe in runscript assuming that's what provides the start function if there's none in the init script?

Reproducible: Always

Steps to Reproduce:
1. Install mongodb 2.6
2. Start it
Comment 1 Adrian 2014-05-25 14:06:27 UTC
Right now I'm using this workaround to get it running as the correct user:

start() {
    ebegin "Starting MongoDB"
    start-stop-daemon --start --user "${user}" --group "${group}" --exec "${command}" -- ${command_args} --fork --pidfilepath "${pidfile}"
    return $?
}
Comment 2 Ultrabug gentoo-dev 2014-05-26 08:05:23 UTC
thanks mate, it's fixed in tree now

+*mongodb-2.6.1-r1 (26 May 2014)
+
+  26 May 2014; Ultrabug <ultrabug@gentoo.org> -mongodb-2.6.1.ebuild,
+  +mongodb-2.6.1-r1.ebuild, files/mms-agent.initd-r2, files/mongodb.initd-r2,
+  files/mongos.initd-r2:
+  fix init script user and group execution
+