<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#333333">
<p><font face="Arial">Thanks Josh! That looks interesting.</font><br>
</p>
Yes, keep it as a file is prob the best, but if using puts, for the
example.<br>
<br>
Something like this then (based on the dbus example)?<br>
<pre><pre>set daemon_uniquename org.macports.${name}
startupitem.type launchd
startupitem.create no
startupitems name dbus-system \
location LaunchDaemons \
uniquename ${daemon_uniquename} \
plist ${daemon_uniquename}.plist</pre></pre>
<pre><pre>post-destroot {
xinstall -d -m 0755 ${destroot}${prefix}/etc/LaunchDaemons/${daemon_uniquename}
set plist [open <font class="pastecode">"${destroot}${prefix}/etc/LaunchDaemons/${daemon_uniquename}/${daemon_uniquename}.plist"</font> w 0644]
puts ${plist} <font class="pastecode">"<?xml version='1.0' encoding='UTF-8'?>"</font>
puts ${plist} <font class="pastecode">"<!DOCTYPE plist PUBLIC \"</font>-<font class="pastecode">//Apple Computer//DTD PLIST 1.0//EN\<font class="pastecode">""</font></font>
puts ${plist} <font class="pastecode">"\"</font>http:<font class="pastecode">//www.apple.com/DTDs/PropertyList-1.0.dtd\<font class="pastecode">">"</font></font>
puts ${plist} <font class="pastecode">"<plist version='1.0'>"</font>
puts ${plist} <font class="pastecode">"<dict>"</font>
puts ${plist} " <font class="pastecode"><key>Label</key>"</font>
puts ${plist} <font class="pastecode">" <string>${daemon_uniquename}</string>"</font>
puts ${plist} <font class="pastecode">" <key>ProgramArguments</key>"</font>
puts ${plist} <font class="pastecode">" <array>"</font>
puts ${plist} <font class="pastecode">" <string>${prefix}/sbin/${name}</string>"</font>
puts ${plist} <font class="pastecode">" </array>"</font>
puts ${plist} <font class="pastecode">" <key>StartCalendarInterval</key>"</font>
puts ${plist} <font class="pastecode">" <dict>"</font>
puts ${plist} <font class="pastecode">" <key>Day</key>"</font>
puts ${plist} <font class="pastecode">" <integer>20</integer>"</font>
puts ${plist} <font class="pastecode">" <key>Hour</key>"</font>
puts ${plist} <font class="pastecode">" <integer>10</integer>"</font>
puts ${plist} <font class="pastecode">" <key>Minute</key>"</font>
puts ${plist} <font class="pastecode">" <integer>10</integer>"</font>
puts ${plist} <font class="pastecode">" </dict>"</font>
puts ${plist} <font class="pastecode">"</dict>"</font>
puts ${plist} <font class="pastecode">"</plist>"</font>
close ${plist}
xinstall -d -m 0755 ${destroot}/Library/LaunchDaemons
ln -s ${prefix}/etc/LaunchDaemons/${daemon_uniquename}/${daemon_uniquename}.plist ${destroot}/Library/LaunchDaemons
}</pre></pre>
<br>
…where <i>“startupitem.create no”</i> doesn't create anything, but
the additional info makes it work within the system (ie. using port
load)? Or did I misunderstand the usage?<br>
<br>
If I want to add logs? I can just use
“/${prefix}/var/log/${name}/${name}.log"?<br>
<br>
· Eric<br>
<br>
<div class="moz-cite-prefix">On 1/21/19 7:59 , Joshua Root wrote:<br>
</div>
<blockquote
cite="mid:ba8fec75-02b1-46be-a638-145d4e773e63@macports.org"
type="cite">
<pre wrap="">The startupitem.* options don't offer a lot of the options of launchd.
If you need something like StartCalendarInterval, the best way is
probably to create the plist and put it in the port's files directory.
You then have to install it in the right place and set a couple options
so 'port load' will find it.
See the dbus port for an example of this. It actually installs 2 plists,
one LaunchDaemon and one LaunchAgent. The former is generated in the
Portfile with puts, I think because some of the content varies depending
on OS version. The latter is from the dbus distfile.
- Josh
</pre>
</blockquote>
</body>
</html>