launchd plist -- userid, home directory

Craig Treleaven ctreleaven at macports.org
Thu Feb 4 06:15:46 PST 2016


Hi:

I was looking at modifying the buildbot / buildbot-slave ports to include a sample launchd plist.  I would like to be able to default the UserName and WorkingDirectory keys for the userid that is installing the port.

<key>UserName</key>
<string>@someusername@</string>
<key>WorkingDirectory</key>
<string>/Users/@someusername@/buildarea</string>

For example, if I’m installing the port and my userid is ‘wct’, I’d like to s/@someusername@/wct’/g .  

Within the portfile, how can I determine the userid that invoked ‘port install …'?

Craig

(I realize that some folks may want a different userid to run this system.  This is going to be a _sample_ plist; the user will always have to fill in the directory name for the master or slave.)



More information about the macports-dev mailing list