<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"><blockquote type="cite">I would like to define multiple startup items (each of which will use an executable with multiple arguments) using the startupitems keyword. </blockquote></div><div dir="ltr"><br></div><div dir="ltr">Could be a bug. Widespread practice is to code around it and edit the launchd .plist’s in the post-activate block. You can use tcl’s reinplace or sh’s plutil as necessary to edit the .plists.</div><div dir="ltr"><br></div><div dir="ltr">Example Portfiles that do this extensively:</div><div dir="ltr"><br></div><div dir="ltr">• <a href="https://github.com/macports/macports-ports/blob/master/net/calendar-contacts-server/Portfile">https://github.com/macports/macports-ports/blob/master/net/calendar-contacts-server/Portfile</a></div><div dir="ltr">• <a href="https://github.com/macports/macports-ports/blob/master/sysutils/clamav-server/Portfile">https://github.com/macports/macports-ports/blob/master/sysutils/clamav-server/Portfile</a></div><div dir="ltr">• <a href="https://github.com/macports/macports-ports/blob/master/mail/mail-server/Portfile">https://github.com/macports/macports-ports/blob/master/mail/mail-server/Portfile</a></div><div dir="ltr"><br></div><div dir="ltr"><br><blockquote type="cite">On Jun 14, 2020, at 12:45, Ryan Schmidt <ryandesign@macports.org> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><span>Using the startupitem.executable keyword, one can specify multiple arguments.</span><br><span></span><br><span>https://guide.macports.org/#reference.startupitems.executable</span><br><span></span><br><span>The example from the guide is:</span><br><span></span><br><span>startupitem.executable ${prefix}/sbin/vm-pop3d -d 10 -t 600</span><br><span></span><br><span>This will end up constructing a launchd plist containing:</span><br><span></span><br><span><key>ProgramArguments</key></span><br><span><array></span><br><span> <string>/opt/local/bin/daemondo</string></span><br><span> <string>--label=myport</string></span><br><span> <string>--start-cmd</string></span><br><span> <string>/opt/local/sbin/vm-pop3d</string></span><br><span> <string>-d</string></span><br><span> <string>10</string></span><br><span> <string>-t</string></span><br><span> <string>600</string></span><br><span> <string>;</string></span><br><span></span><br><span>etc.</span><br><span></span><br><span></span><br><span>I would like to define multiple startup items (each of which will use an executable with multiple arguments) using the startupitems keyword. Its documentation says:</span><br><span></span><br><span>"Used when a port needs to install more than one StartupItem, this option consists of a list where alternating elements represent keys and values."</span><br><span></span><br><span>The example given is:</span><br><span></span><br><span>startupitems name myport-system \</span><br><span> location LaunchDaemons \</span><br><span> executable ${prefix}/sbin/myportd \</span><br><span> name myport-session \</span><br><span> location LaunchAgents \</span><br><span> executable ${prefix}/bin/myport-agent</span><br><span></span><br><span>How then can one use this to specify multiple executable arguments?</span><br><span></span><br><span>The obvious answers don't work:</span><br><span></span><br><span>startupitems name myport \</span><br><span> executable "${prefix}/sbin/vm-pop3d -d 10 -t 600"</span><br><span></span><br><span>startupitems name myport \</span><br><span> executable [list ${prefix}/sbin/vm-pop3d -d 10 -t 600]</span><br><span></span><br><span>Either way, this ends up creating a launchd plist where everything is in a single string:</span><br><span></span><br><span><key>ProgramArguments</key></span><br><span><array></span><br><span> <string>/opt/local/bin/daemondo</string></span><br><span> <string>--label=myport</string></span><br><span> <string>--start-cmd</string></span><br><span> <string>/opt/local/sbin/vm-pop3d -d 10 -t 600</string></span><br><span> <string>;</string></span><br><span></span><br><span>etc.</span><br><span></span><br><span>Is this a bug? Or is there a different way to do it?</span><br><span></span><br></div></blockquote></body></html>