Re: Another approach to root user?
Re: Another approach to root user?
- Subject: Re: Another approach to root user?
- From: Shaun Wexler <email@hidden>
- Date: Tue, 28 Mar 2006 09:11:45 -0800
On Mar 28, 2006, at 7:29 AM, Ethan Funk wrote:
By running the server as root, via sudo in the above terminal
example, I can get around things, but it sure would be nice to get
launchd to do it with out the need for a startup script with the
root password in it!
That doesn't sound correct. You need to create a plist in /Library/
LaunchDaemons:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://
www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.redmountainradio.arserverd</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/path/to/arserverd</string>
</array>
</dict>
</plist>
Your daemon will be launched as root when the system is booted. You
can also enable/disable the process from Terminal or sh (sudo ensures
it runs in the global bootstrap with ppid=1, otherwise it runs as a
child of a new launchd process in the console session):
sudo launchctl load /Library/LaunchDaemons/
com.redmountainradio.arserverd.plist
sudo launchctl unload /Library/LaunchDaemons/
com.redmountainradio.arserverd.plist
You can also make a handy post-flight script build phase to restart
the daemon when built (albeit with an embedded admin pw):
if echo myAdminP@sSw0rD | sudo -S launchctl list | grep
com.redmountainradio.arserverd; then
sudo launchctl stop com.redmountainradio.arserverd
fi
HTH~
--
Shaun Wexler
MacFOH
http://www.macfoh.com
"No problem is so formidable that you can't walk away from it." -
Charles Schulz
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden