You can easily run as another user with sudo -u
like so:
#!/bin/sh
UZER=jsmith
sudo -u "$UZER" /path/to/program/you/want/to/run
exit 0
Just change 'jsmith' to the appropriate short user name, and then save that as a script somewhere, and call from /Library/LaunchDaemons
Remember that all files in /Library/LaunchDaemons must be owned by root to be run.
(I think this is what bmike was suggesting)
Another option
However, I wrote up a HOWTO for making auto-login more secure:
Terminally Geeky: use automatic login more securely
The executive summary is this:
- Turn on Automatic login
- Put this launchd plist in ~/Library/LaunchAgents
- Reboot
What it does:
As soon as you login, launchd will throw you back to the login screen using:
"/System/Library/CoreServices/Menu Extras/User.menu/Contents/Resources/CGSession" -suspend
Note that is all one long line.
Considering that someone with physical access to your computer has a lot of potential exploits, I consider this relatively safe, but of course everyone has to make their own determination. I run this in my small office, but my iMac is in my private office which I can lock when I'm not there.
Also note that automatic login doesn't work with FileVault 2.
While still not understanding the reason this occurred, I was able to make the problem go away by explicitly adding the user to the inherited group in Workgroup Manager, verifying it with dsmemberutil
, reconnecting to the AFP share, disconnecting, and then removing the explicit group assignment. After all that, dsmemberutil
still shows that the user is in the group.
Best Answer
Ref : XAMPP on Mac OSX: Why running as 'daemon'?
In /Applications/XAMPP/xamppfiles/etc/httpd.conf change
to
Fixed!