<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/e70a512aa45b88b8c1bc126fd1a67d0b68c1fdd9">https://github.com/macports/macports-base/commit/e70a512aa45b88b8c1bc126fd1a67d0b68c1fdd9</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit e70a512aa45b88b8c1bc126fd1a67d0b68c1fdd9
</span>Author: Christopher Nielsen <mascguy@github.com>
AuthorDate: Sun Aug 20 07:59:48 2023 -0400
<span style='display:block; white-space:pre;color:#404040;'> startupitem: add new option startupitem.logfile.stderr
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Fixes: https://trac.macports.org/ticket/67955
</span>---
src/port1.0/portstartupitem.tcl | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portstartupitem.tcl b/src/port1.0/portstartupitem.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 69ebb1b21..98c561bf4 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portstartupitem.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portstartupitem.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -53,8 +53,15 @@
</span> # We create and destroy the pidfile to track the pid we receive from the executable
#
# startupitem.logfile logpath
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# Log to the specified file -- if not specified then output to /dev/null
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# - for launchd, just set this as the standard out key
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Log stdout to the specified logfile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# - If not specified, then output to /dev/null
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# - For launchd, set the stdout plist key
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# startupitem.logfile.stderr logpath
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Log stderr to the specified logfile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# - If not specified, defaults to startupitem.logfile
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# - If cleared, disables stderr logging
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# - For launchd, set the stderr plist key
</span> #
# startupitem.logevents yes/no
# Log events to the log
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -84,7 +91,8 @@ options startupitems startupitem.autostart startupitem.debug \
</span> startupitem.create startupitem.custom_file \
startupitem.executable startupitem.group \
startupitem.init startupitem.install startupitem.location \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- startupitem.logevents startupitem.logfile startupitem.name \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ startupitem.logevents startupitem.logfile \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ startupitem.logfile.stderr startupitem.name \
</span> startupitem.netchange startupitem.pidfile startupitem.plist \
startupitem.requires startupitem.restart startupitem.start \
startupitem.stop startupitem.type startupitem.uniquename \
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -100,6 +108,7 @@ default startupitem.install {$system_options(startupitem_install)}
</span> default startupitem.location LaunchDaemons
default startupitem.logevents no
default startupitem.logfile ""
<span style='display:block; white-space:pre;background:#e0ffe0;'>+default startupitem.logfile.stderr {${startupitem.logfile}}
</span> default startupitem.name {${subport}}
default startupitem.netchange no
default startupitem.pidfile ""
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -143,8 +152,8 @@ proc portstartupitem::get_startupitem_type {} {
</span> proc portstartupitem::foreach_startupitem {body} {
global startupitems
set vars [list autostart create custom_file debug executable group \
<span style='display:block; white-space:pre;background:#ffe0e0;'>- init install location logevents logfile name netchange \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- pidfile plist requires restart start stop type \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ init install location logevents logfile logfile.stderr \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ name netchange pidfile plist requires restart start stop type \
</span> uniquename user daemondo.verbosity]
array set startupitems_dict {}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -491,6 +500,10 @@ proc portstartupitem::startupitem_create_darwin_launchd {attrs} {
</span> puts ${plist} "<key>StandardOutPath</key><string>$si(logfile)</string>"
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$si(logfile.stderr) ne ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts ${plist} "<key>StandardErrorPath</key><string>$si(logfile.stderr)</string>"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> if {$si(debug)} {
puts ${plist} "<key>Debug</key><true/>"
}
</pre><pre style='margin:0'>
</pre>