startupitems arcanery
Eric Cronin
ecronin at gizmolabs.org
Thu Mar 29 10:05:52 PDT 2007
They are shell commands, executed by /bin/[ (see man test). First
one checks that ${prefix}/sbin/dhcpd exists and is +x, the second
that the PID file exists and is readable... The escapes are needed
to protect [ and $ from tcl (${prefix} is a tcl variable evaluated
when the Portfile runs, ${PID} is a sh variable evaluated each time
the startupitem runs.
Thanks,
Eric
On Mar 29, 2007, at 12:04 PM, markd at macports.org wrote:
> I am trying to understand the startupitems in the dhcp port because
> I want
> to do somewthing similar in another port. Can someone explain what
> the
> escapes, brackets, "-x", and "-r" do? And what interprets the "-x"
> and
> "-r"? The shell?
>
> startupitem.create yes
> startupitem.name dhcpd
> startupitem.init "PID=/var/run/dhcpd.pid"
> startupitem.start "\[ -x ${prefix}/sbin/dhcpd \] &&
> ${prefix}/sbin/dhcpd -cf ${prefix}/etc/dhcp/dhcpd.conf -lf
> ${prefix}/var/db/dhcpd/dhcpd.leases"
> startupitem.stop "\[ -r \${PID} \] && kill \$(cat \${PID})"
>
> Mark
>
> _______________________________________________
> macports-dev mailing list
> macports-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo/macports-dev
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 478 bytes
Desc: This is a digitally signed message part
Url : http://lists.macosforge.org/pipermail/macports-dev/attachments/20070329/5bf50eb7/PGP.bin
More information about the macports-dev
mailing list