<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-guide.
</pre>
<p><a href="https://github.com/macports/macports-guide/commit/3c2814e1068a4e0ef14237dbe6ac6837767b5b1f">https://github.com/macports/macports-guide/commit/3c2814e1068a4e0ef14237dbe6ac6837767b5b1f</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 3c2814e guide: using: add info for "port load" and "port unload"
</span>3c2814e is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 3c2814e1068a4e0ef14237dbe6ac6837767b5b1f
</span>Author: Herby Gillot <herby.gillot@gmail.com>
AuthorDate: Sat Aug 22 12:33:31 2020 -0400
<span style='display:block; white-space:pre;color:#404040;'> guide: using: add info for "port load" and "port unload"
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://trac.macports.org/ticket/60636
</span>---
guide/xml/using.xml | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 56 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/guide/xml/using.xml b/guide/xml/using.xml
</span><span style='display:block; white-space:pre;color:#808080;'>index e6629cf..9397eec 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/guide/xml/using.xml
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/guide/xml/using.xml
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1018,6 +1018,62 @@ Warning: no license set
</span> </varlistentry>
</variablelist>
</section>
<span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <section xml:id="using.port.load">
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <title>port load</title>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <para>Some ports install software that is meant to run as a daemon. Or in other words, a long-running
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ background process.</para>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <para>Examples of this are database servers like MySQL or PostgreSQL.</para>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <para>On macOS, <command>launchd</command> is primarily responsible for starting, stopping, and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ managing long-running services.</para>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <para>Ports that want to run daemon processes can install their own <filename>.plist</filename> file(s)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ into <command>launchd</command>. These files will allow <command>launchd</command> to start and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ manage the port's daemon processes.</para>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <para>So once a port is installed, the <option>load</option> action can be used to do the above
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ and activate the port's <command>launchd</command> service(s):</para>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <programlisting><prompt>$ </prompt><userinput>sudo port load prometheus</userinput></programlisting>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <screen>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---> Loading startupitem 'prometheus' for prometheus</screen>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <para>Now the port's service(s) should be running in <command>launchd</command>. This can be verified with
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ the <command>launchctl</command> command:</para>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <programlisting><prompt>$ </prompt><userinput>sudo launchctl list | grep macports</userinput></programlisting>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <screen>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+49119 0 org.macports.prometheus</screen>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <para>To stop the daemon service and mark it as disabled for <command>launchd</command>, use
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ the <link linkend="using.port.unload"><command>port unload</command></link> command.</para>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ </section>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <section xml:id="using.port.unload">
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <title>port unload</title>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <para>As discussed in the <link linkend="using.port.load"><command>port load</command></link> section, the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <command>port load</command> command can be used to install and activate a port's daemon service(s) in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <command>launchd</command>.</para>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <para>The <option>unload</option> action reverses this.</para>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <para><command>port unload</command> will stop the port's daemon processes, and mark the port's service
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <filename>.plist</filename> as disabled:</para>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <programlisting><prompt>$ </prompt><userinput>sudo port unload prometheus</userinput></programlisting>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <screen>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+---> Unloading startupitem 'prometheus' for prometheus</screen>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ <para>The port's service(s) should no longer be present in <command>launchctl list</command>.</para>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ </section>
</span> </section>
<section xml:id="using.variants">
</pre><pre style='margin:0'>
</pre>