New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #10879 (closed enhancement: fixed)

Opened 8 years ago

Last modified 3 years ago

RFE: apache2 and other ports won't install as non-root users because of startupitems

Reported by: plambert@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 2.0.0
Component: base Version:
Keywords: Cc: jameskyle@…
Port:

Description

Installed macports from source with --disable-launchd-support and tried to install apache2. The install failed as follows:

--->  Creating systemstarter control script
Error: Target com.apple.destroot returned: could not set owner for file "/ngs/lpp/macports/var/db/dports/build/_ngs_lpp_macports_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dports_www_apache2/work/destroot/Library/StartupItems/apache2": not owner
Warning: the following items did not execute (for apache2): com.apple.activate com.apple.destroot com.apple.install
Error: Status 1 encountered during processing.

There should either be a variant to each port with a startupitem to not create it, or better, 'port' should not attempt to chown startupitems when it's not running as root and not installing as root.

Change History

comment:1 Changed 8 years ago by plambert@…

It looks like the right place to fix this is portstartupitem.tcl.

Ideally, I'd like to have "port install foo" still create the startup script (rcng, systemstarter, or launchd, doesn't matter) but put it in the ${prefix} tree with no special permissions.

But I'm going to try to come up with an interim patch now that just avoids creating startupitems altogether. Hopefully I can figure out how!

comment:2 Changed 8 years ago by plambert@…

OK, I created a (very minor) patch to allow a startupitem type of "none."

No patch yet for documentation, etc. I'll try to get that done soon. Once it's done, I'll upload it here.

comment:3 Changed 7 years ago by imajes@…

  • Status changed from new to assigned
  • Owner changed from darwinports-bugs@… to imajes@…

accepting ticket. let me know when you patch it and i'll test&apply

comment:4 Changed 7 years ago by markd@…

  • Summary changed from apache2 and other ports won't install as non-root users to RFE: apache2 and other ports won't install as non-root users

comment:5 Changed 7 years ago by ryandesign@…

FYI: A +no_startupitem variant was added to apache2 in r22490.

comment:6 Changed 7 years ago by nox@…

  • Priority changed from Expected to Normal
  • Component changed from base to ports
  • Version 1.3.2 deleted
  • Type changed from defect to enhancement
  • Milestone set to Port Enhancements

comment:7 Changed 7 years ago by nox@…

  • Component changed from ports to base
  • Milestone changed from Port Enhancements to MacPorts base enhancements

comment:8 follow-up: ↓ 9 Changed 5 years ago by www.macports.org@…

I have been having a similar problem installing dbus as a non root user since it also installs StartupItems. Editing DESTROOT/share/macports/Tcl/port1.0/portstartupitem.tcl and the dbus Portfile fixed it.

The changes are simple: In portstartupitem.tcl, replace all instances of "root" by "${install.user}" and all instances of "wheel" by "${install.group}". In the dbus portfile, same process. Note that there's a misspelling at some point : "error" is spelled "erorr".

This allows dbus to properly install the Startup Items in the /User/<my-user-name>/Library/StartupItems folders. They run perfectly when activated. Before that, I could only install dbus by selecting the no_root and no_startupitems variants.

However, it is possible that these changes cause a standard MacPorts installation (ie, as root) to break, since the installation user won't be root but most likely a simple administrator. I'll let the experts judge if that's a problem.

comment:9 in reply to: ↑ 8 Changed 5 years ago by ryandesign@…

Replying to www.macports.org@…:

Note that there's a misspelling at some point : "error" is spelled "erorr".

Fixed in r57326.

comment:10 Changed 5 years ago by ryandesign@…

  • Cc jameskyle@… added

Has duplicate #20217.

comment:11 Changed 4 years ago by ryandesign@…

  • Owner changed from imajes@… to macports-tickets@…

James Cox (imajes) retires as MacPorts maintainer (see macports-mgr archives)

comment:12 Changed 3 years ago by jmr@…

  • Status changed from assigned to closed
  • Resolution set to fixed
  • Milestone changed from MacPorts Future to MacPorts 2.0.0

comment:13 Changed 3 years ago by jmr@…

  • Summary changed from RFE: apache2 and other ports won't install as non-root users to RFE: apache2 and other ports won't install as non-root users because of startupitems
Note: See TracTickets for help on using tickets.