8

When you install server software via MacPorts, when the installation is finished it prints some instructions about enabling the server via launchd.

I promptly hit ⌘K on the Terminal and forget about it.

Days later I want to actually enable said server.

Is there any way to get those instructions again[1]?

update:

I wrote about launchd, and port load is great for that, but some ports have other instructions. I''d welcome a general answer. For example, git-core will print bash-completion setup instructions.

Bonus question: On port load, is there a way to list which ports have launchd items?


[1]: Without going through uninstall and reinstall, obviously.

6

Generally, you can load it with the port load command, in MacPorts 1.8. It takes the format port load $package. For example, to load the PostgreSQL server from the postgresql83-server port:

$ sudo port load postgresql83-server

For some older ports, the name of the port does not correspond to its associated launchd config file, and port load will fail (happens rarely, but occasionally). In this case,

$ sudo launchctl load -w /Library/LaunchDaemons/$config_file_to_load

will do the trick.

1
  • Package LaunchDaemons are generally located in /opt/local/etc/LaunchDaemons/org.macports.<package>/org.macports.<package>.plist – Ryan Schumacher Apr 23 '13 at 22:20
6

EDIT
Just to update on my general method for showing instructions for a given port, I just learned that you can type

port notes slocate

which returns:

slocate's database should be updated on a regular basis. In
/opt/local/etc/daily.slocate, you'll find some lines to put in
/etc/daily.local to update the database on a daily basis (for example).
If you want to disable the weekly update of the system's built-in locate,
edit the file /etc/weekly.

OLD
A very crude way of doing is by reading the Portfile directly, and looking at the post-install section. Using slocate as an example:

port cat slocate | grep ui_msg

returns:

ui_msg "\nslocate's database should be updated on a regular basis. In"
ui_msg "${prefix}/etc/daily.slocate, you'll find some lines to put in"
ui_msg "/etc/daily.local to update the database on a daily basis (for example)."
ui_msg "If you want to disable the weekly update of the system's built-in locate,"
ui_msg "edit the file /etc/weekly.\n"

As you can see, the output from port cat is not formatted as nicely BUT should give you enough information. Hope this helps!

1
  • This is very useful information. – Ryan Schumacher Apr 23 '13 at 22:18
3

Starting with MacPorts 1.8.2 (that is, you must use the trunk version presently) there is a logging mechanism. You are able to reference everything that was printed in log files.

port log is available, and has switches for showing phases among other things. Please check the man page when you've installed the trunk version of MacPorts.

Also, this might point to what port owns what Launchd plist file:

for i in /Library/LaunchDaemons/*; do echo -n "$i: "; port provides "$i"; done

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.