Here's a snippet from another port that might help:
startupitem.create yes
startupitem.netchange yes
if {[getuid] == 0} {
startupitem.executable ${prefix}/sbin/asterisk -d -U asterisk -G asterisk
} else {
startupitem.executable ${prefix}/sbin/asterisk -d
}
and there is a discussion in the mailing list about this from years gone by
the might be worth reading if that doesn't happen:
<https://lists.macosforge.org/pipermail/macports-dev/2007-September/002669.html>
Hope this helps.
ken
On 2016-09-17, at 8:12 AM, Javier Alcázar wrote:
> Hi people,
>
> I'm creating a new Portfile with startupitem.executable, and wondering what
> is the best way to execute the command with a specific user.
>
> I tried using "su -c executable args" but with this approach launchd ends up
> monitoring the "su" process instead of the "executable"
>
> What would you recommend to do so launchd looks at the "executable" process?
>
>
>
>
>
> Cheers
>
>
> --
> Javier
> _______________________________________________
> macports-users mailing list
> [email protected]
> https://lists.macosforge.org/mailman/listinfo/macports-users
_______________________________________________
macports-users mailing list
[email protected]
https://lists.macosforge.org/mailman/listinfo/macports-users