[MacPorts] #40364: mongodb can't install into userdir
#40364: mongodb can't install into userdir ---------------------+-------------------------------- Reporter: mtb19@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.0 Keywords: | Port: mongodb ---------------------+-------------------------------- 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.) -- Ticket URL: <https://trac.macports.org/ticket/40364> MacPorts <http://www.macports.org/> Ports system for OS X
#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
#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 | ----------------------+-------------------------- Comment (by ryandesign@…): Thanks for the report but see comment:ticket:40360:5 for why I would want to fix this in a different way than adding a no_root variant. -- Ticket URL: <https://trac.macports.org/ticket/40364#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#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 | ----------------------+-------------------------- Comment (by mtb19@…): I did not mean to be unclear. I am not trying to suggest a particular fix. I only pointed out that this port did not support `+no_root`, and (if it was desirable) `.../dbus/Portfile` provided an example of support for such a variant. Even if I were encouraging a particular approach, my suggestions should be given very little (if any) weight. I am not a maintainer of any ports, I have never written a Portfile, and I do not have the breadth of knowledge regular maintainers do about the direction of MacPorts and changes to strategy, conventions, etc. -- Ticket URL: <https://trac.macports.org/ticket/40364#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#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 | ----------------------+-------------------------- Comment (by larryv@…): Replying to [comment:3 mtb19@…]:
Even if I were encouraging a particular approach, my suggestions should be given very little (if any) weight. I am not a maintainer of any ports, I have never written a Portfile, and I do not have the breadth of knowledge regular maintainers do about the direction of MacPorts and changes to strategy, conventions, etc.
We value contributions from persons with a wide range of experience. Everyone has to start somewhere :) -- Ticket URL: <https://trac.macports.org/ticket/40364#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#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 | ----------------------+-------------------------- Comment (by mtb19@…): Replying to [comment:4 larryv@…]:
We value contributions from persons with a wide range of experience. Everyone has to start somewhere :)
Thanks! :o) By the way, if `+no_root` is a deprecated hack, can anyone speak to what ''is'' the preferred (or at least idiomatic) way to address these types of non-root install issues? I know that MacPorts' own `configure` supports options like: {{{ --with-no-root-privileges --with-install-user=... --with-install-group=... --with-applications-dir=... --with-frameworks-dir=... --with-directory-mode=... ... [no --with-startupitems-dir=... though] }}} Many packages provide a `[pkg]-config` executable for others to discover aspects about how they were configured (where they were installed, etc.) Is there an equivalent for MacPorts itself (`port-config`?) that could signal to the build process what users to use and where to stick stuff, perhaps by parsing `.../etc/macports/macports.conf`? `macports.conf` doesn't appear to capture all configure options...maybe it doesn't need to? -- Ticket URL: <https://trac.macports.org/ticket/40364#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#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 | ----------------------+-------------------------- Comment (by larryv@…): Replying to [comment:5 mtb19@…]:
By the way, if `+no_root` is a deprecated hack, can anyone speak to what ''is'' the preferred (or at least idiomatic) way to address these types of non-root install issues?
If a Portfile must behave differently based on user, it should check the values of `install.user` and `install.group` and automatically do the right thing. (See the `portfile(7)` man page.) -- Ticket URL: <https://trac.macports.org/ticket/40364#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#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 | ----------------------+-------------------------- Comment (by mtb19@…): FYI, I thought I'd add this still happens with 2.3.0. I'd also point out that it *builds* fine. It's in the install phase that it fails (apparently from the add_users/sudo bits). -- Ticket URL: <https://trac.macports.org/ticket/40364#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#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 | ----------------------+-------------------------- Comment (by mtb19@…): Replying to [comment:7 mtb19@…]:
FYI, I thought I'd add this still happens with 2.3.0. I'd also point out that it *builds* fine. It's in the install phase that it fails (apparently from the add_users/sudo bits).
FYI, the same still applies to 2.6.0. -- Ticket URL: <https://trac.macports.org/ticket/40364#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts