[MacPorts] #40364: mongodb can't install into userdir
MacPorts
noreply at macports.org
Tue Sep 3 10:42:07 PDT 2013
#40364: mongodb can't install into userdir
----------------------+--------------------------
Reporter: mtb19@… | Owner: ryandesign@…
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.2.0
Resolution: | Keywords:
Port: mongodb |
----------------------+--------------------------
Changes (by macsforever2000@…):
* cc: ryandesign@… (removed)
* owner: macports-tickets@… => ryandesign@…
Old description:
> Much like [https://trac.macports.org/ticket/40360 ticket # 40360],
> mongodb Staging mongodb fails on attempt to set group in non-root
> install. main.log is attached. Relevant part:
> {{{
> :debug:destroot Executing proc-post-org.macports.destroot-destroot-0
> :info:destroot xinstall:
> chdir([__MACPORTS_ROOT__]/var/macports/build/[__MACPORTS_ROOT__]_var_macports_sources_rsync.macports.org_release_tarballs_ports_databases_mongodb/mongodb/work
> /mongodb-src-r2.4.6)
> :info:destroot xinstall: mongobridge ->
> [__MACPORTS_ROOT__]/var/macports/build/[__MACPORTS_ROOT__]_var_macports_sources_rsync.macports.org_release_tarballs_ports_databases_mongodb/mongodb/work/destroot[__MACPORTS_ROOT__]/bin/mongobridge
> :error:destroot org.macports.destroot for port mongodb returned:
> xinstall: Unknown group _mongo
> :debug:destroot Error code: NONE
> :debug:destroot Backtrace: xinstall: Unknown group _mongo
> while executing
> "$post $targetname"
> }}}
> The `Portfile` does not appear to offer a `+no_root` variant. The
> following work-around seems to get it built and installed:
> {{{
> ---
> [__MACPORTS_ROOT__]/var/macports/sources/rsync.macports.org/release/tarballs/ports/databases/mongodb/Portfile.orig
> 2013-08-29 16:01:28.000000000 -0700
> +++
> [__MACPORTS_ROOT__]/var/macports/sources/rsync.macports.org/release/tarballs/ports/databases/mongodb/Portfile
> 2013-09-03 08:41:20.000000000 -0700
> @@ -84,8 +84,8 @@
>
> set dbdir ${prefix}/var/db/mongodb
> set logdir ${prefix}/var/log/mongodb
> -set mongouser _mongo
> -add_users ${mongouser} group=${mongouser} realname=MongoDB\
> Server
> +set mongouser [__USER__]
> +#add_users ${mongouser} group=${mongouser} realname=MongoDB\
> Server
>
> post-destroot {
> if {[variant_isset universal]} {
> @@ -102,7 +102,7 @@
> }
>
> startupitem.create yes
> -startupitem.executable sudo -u ${mongouser} ${prefix}/bin/mongod
> --dbpath ${dbdir} --logpath ${logdir}/mongodb.log --logappend
> +startupitem.executable ${prefix}/bin/mongod --dbpath ${dbdir} --logpath
> ${logdir}/mongodb.log --logappend
>
> if {${os.platform} eq "darwin" && ${os.major} < 10} {
> depends_build
> }}}
> (Where "`[__USER__]`" is the installer's username. See
> .../devel/dbus/Portfile as a decent example of supporting +no_root with
> LaunchDaemons.)
New description:
Much like ticket:40360, mongodb Staging mongodb fails on attempt to set
group in non-root install. main.log is attached. Relevant part:
{{{
:debug:destroot Executing proc-post-org.macports.destroot-destroot-0
:info:destroot xinstall:
chdir([__MACPORTS_ROOT__]/var/macports/build/[__MACPORTS_ROOT__]_var_macports_sources_rsync.macports.org_release_tarballs_ports_databases_mongodb/mongodb/work
/mongodb-src-r2.4.6)
:info:destroot xinstall: mongobridge ->
[__MACPORTS_ROOT__]/var/macports/build/[__MACPORTS_ROOT__]_var_macports_sources_rsync.macports.org_release_tarballs_ports_databases_mongodb/mongodb/work/destroot[__MACPORTS_ROOT__]/bin/mongobridge
:error:destroot org.macports.destroot for port mongodb returned: xinstall:
Unknown group _mongo
:debug:destroot Error code: NONE
:debug:destroot Backtrace: xinstall: Unknown group _mongo
while executing
"$post $targetname"
}}}
The `Portfile` does not appear to offer a `+no_root` variant. The
following work-around seems to get it built and installed:
{{{
---
[__MACPORTS_ROOT__]/var/macports/sources/rsync.macports.org/release/tarballs/ports/databases/mongodb/Portfile.orig
2013-08-29 16:01:28.000000000 -0700
+++
[__MACPORTS_ROOT__]/var/macports/sources/rsync.macports.org/release/tarballs/ports/databases/mongodb/Portfile
2013-09-03 08:41:20.000000000 -0700
@@ -84,8 +84,8 @@
set dbdir ${prefix}/var/db/mongodb
set logdir ${prefix}/var/log/mongodb
-set mongouser _mongo
-add_users ${mongouser} group=${mongouser} realname=MongoDB\
Server
+set mongouser [__USER__]
+#add_users ${mongouser} group=${mongouser} realname=MongoDB\
Server
post-destroot {
if {[variant_isset universal]} {
@@ -102,7 +102,7 @@
}
startupitem.create yes
-startupitem.executable sudo -u ${mongouser} ${prefix}/bin/mongod
--dbpath ${dbdir} --logpath ${logdir}/mongodb.log --logappend
+startupitem.executable ${prefix}/bin/mongod --dbpath ${dbdir} --logpath
${logdir}/mongodb.log --logappend
if {${os.platform} eq "darwin" && ${os.major} < 10} {
depends_build
}}}
(Where "`[__USER__]`" is the installer's username. See
.../devel/dbus/Portfile as a decent example of supporting +no_root with
LaunchDaemons.)
--
--
Ticket URL: <https://trac.macports.org/ticket/40364#comment:1>
MacPorts <http://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list