[launchd-dev] Launchd and logging and users and groups

Scott Haneda talklists at newgeo.com
Wed Jul 15 13:06:45 PDT 2009


Please be gentle, this is outside my comfort level in launchd.

I have a spam proxy written in perl that needs to be started by launchd.

When it starts, a few 100 lines of startup data is sent to whatever  
started it.  If I start with with launchd, all that data will end up  
in /var/log/system.log

I set the 'StandardOutPath'
	<key>StandardOutPath</key>
	<string>/dev/null</string>
but I am not sure that is the correct way to deal with this.  All the  
startup data is also sent to the proxy's log file, so to me, it seems  
redundant.  However, I think the above StandardOutPath change may also  
mask away some important bits of launchd that may be desirable to be  
seen.

All the files the proxy uses are owned by _assp:_assp, so I set:
	<key>UserName</key>
	<string>_assp</string>
according to the docs, I need not se the group, it will auto set to  
the user.  When I do that, launchd restarts repeatedly, and the logs  
that the perl file logs to aka: the proxy logs, will get this line  
repeated:

Jul-14-09 23:58:03 Requested to switch to user/group '_assp/_assp' but  
cannot set effective uid to 0 -- quitting; uid is 504

If the proxy is automatically dropping into the correct user and  
group, then does that mean there is no need to run with the lunachd  
settings for UserName?

Can I get some guidance on the best way to deal with this?  Any  
suggestions on how this should be set up to be most ideal, is most  
appreciated.
-- 
Scott * If you contact me off list replace talklists@ with scott@ *



More information about the launchd-dev mailing list