User for startupitem.executable

Russell Jones russell.jones at physics.ox.ac.uk
Wed Sep 21 04:38:36 PDT 2016


Hi Javier,

grep -ril startupitem.executable 
/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/ 
| xargs less

suggests that sudo -u is the way to do it if a program doesn't know how 
to drop privileges. If that doesn't work, I guess several ports have the 
same problem that you describe with su. sudo does fork a process per the 
man page, so they may do.

Russell

(sent to macports-dev)

On 17/09/16 16:12, 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
> macports-users at lists.macosforge.org
> https://lists.macosforge.org/mailman/listinfo/macports-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-dev/attachments/20160921/1544765b/attachment.html>


More information about the macports-dev mailing list