Opened 10 years ago

Closed 6 years ago

Last modified 6 years ago

#10879 closed enhancement (fixed)

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 (13)

comment:1 Changed 10 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 10 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 10 years ago by imajes@…

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

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

comment:4 Changed 10 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 9 years ago by ryandesign (Ryan Schmidt)

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

comment:6 Changed 9 years ago by nox@…

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

comment:7 Changed 9 years ago by nox@…

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

comment:8 follow-up: Changed 8 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 7 years ago by ryandesign (Ryan Schmidt)

Replying to www.macports.org@…:

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

Fixed in r57326.

comment:10 Changed 7 years ago by ryandesign (Ryan Schmidt)

  • Cc jameskyle@… added

Has duplicate #20217.

comment:11 Changed 6 years ago by ryandesign (Ryan Schmidt)

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

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

comment:12 Changed 6 years ago by jmroot (Joshua Root)

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

comment:13 Changed 6 years ago by jmroot (Joshua Root)

  • 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.