Opened 7 years ago

Closed 3 years ago

Last modified 3 years ago

#44496 closed defect (fixed)

startupitem_install not respected when installing from binary archive

Reported by: ora.et.labora@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 2.5.0
Component: base Version: 2.3.1
Keywords: Cc:
Port:

Description

The documentation at https://guide.macports.org/chunked/installing.macports.html states:

After installing the second instance you might need to add startupitem_install no to $MP_PREFIX/etc/macports/macports.conf to avoid conflicts in /Library/LaunchAgents.

The documentation is probably not entirely precise as I assume, that nothing should be installed outside of ${MP_PREFIX-/opt/local} if this option is set to "no". Cause it does not only conflict in /Library/LaunchAgents but also in /Library/LaunchDaemons or any other "shared" place.

However, even with startupitem_install no a conflict is created as the following session demonstrates:

$ port version
Version: 2.3.1

$ fgrep startupitem /opt/local/etc/macports/macports.conf
[..]
startupitem_type    default
startupitem_install no

# check whether installed (-L to list sym links)
$ find -L /Library/Launch* ~/Library/Launch* -type f | fgrep -i mysql

$ sudo port install mysql56-server
[..]

# bingo!
$ find -L /Library/Launch* ~/Library/Launch* -type f | fgrep -i mysql
/Library/LaunchDaemons/org.macports.mysql56-server.plist

Change History (6)

comment:1 Changed 7 years ago by larryv (Lawrence Velázquez)

Are you installing from a binary archive? Can you try forcing a build from source?

sudo port uninstall mysql56-server
sudo port -s install mysql56-server

comment:2 in reply to:  1 ; Changed 7 years ago by ora.et.labora@…

Replying to larryv@…:

Are you installing from a binary archive? Can you try forcing a build from source?

sudo port uninstall mysql56-server
sudo port -s install mysql56-server

Using port -s install .. did the job. This behaviour needs proper documentation or should work independent of -s | -b.


Side issue: Having disable startup symlinking in /Library/Launch* renders port load|unload unusable:

$ sudo port -s install mysql56-server
$ find -L /Library/Launch* ~/Library/Launch* -type f | fgrep -i mysql         # ok, no symlink created!
# Am I still able to start my server in background for the purpose of testing???
$ sudo port load mysql56-server
Error: org.macports.load for port mysql56-server returned: Launchd plist /Library/LaunchDaemons/org.macports.mysql56-server.plist was not found

comment:3 in reply to:  2 Changed 7 years ago by larryv (Lawrence Velázquez)

Component: guidebase
Owner: changed from markd@… to macports-tickets@…
Summary: startupitem_install not working as expectedstartupitem_install not respected when installing from binary archive

Replying to ora.et.labora@…:

Using port -s install .. did the job. This behaviour needs proper documentation or should work independent of -s | -b.

Okay, the problem is that we build binary archives with default settings (including startupitem_install yes), so they always contain plists if a port creates them. Since installing from an archive basically consists of extracting a tarball, the plists get installed regardless of the local setting of startupitem_install.

A workaround for now is to set buildfromsource always.

Side issue: Having disable startup symlinking in /Library/Launch* renders port load|unload unusable:

$ sudo port -s install mysql56-server
$ find -L /Library/Launch* ~/Library/Launch* -type f | fgrep -i mysql         # ok, no symlink created!
# Am I still able to start my server in background for the purpose of testing???
$ sudo port load mysql56-server
Error: org.macports.load for port mysql56-server returned: Launchd plist /Library/LaunchDaemons/org.macports.mysql56-server.plist was not found

#44497

comment:4 in reply to:  2 Changed 7 years ago by larryv (Lawrence Velázquez)

I’ve updated the comments in r122832.

comment:5 Changed 3 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

In 3dde77d7d6c66dbb8fcc1d4b1b4972a2ac8b1947/macports-base:

Honour startupitem.install at activation time

When activating files, move plists from /Library/Launch* to
${prefix}/etc/Launch* if the port was built with startupitem_install
on but it is currently off, and vice versa in the opposite case.

Fixes: #44496

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

Milestone: MacPorts 2.5.0
Note: See TracTickets for help on using tickets.