LaunchAgent
Hi everyone!!
I have created a LaunchAgent to run a series of commands when the first user logs in:
Set computer name based off of webpage query
Activate SPSS (statistical program needing first boot activation)
Delete the script and launch agent.
The script looks something like the following:
---------------------------
#!/bin/sh
# Modified 060208
# This script runs on the first login of the machine to finish setting appropriate settings. These are settings
# that could not be done at first boot.
# Call Name Computer Sciprt
/Library/Management/scripts/setcomputername.command
# Activate SPSS 16
cd /Applications/SPSS16/SPSS16.0.app/Contents/bin/
./licenseafter.sh
# Remove Files
rm -R /Library/LaunchAgents/com.gustavus.firstlogin.plist
rm -R /Library/Management/firstlogin
-----------------------------
[b]The problem:
[/b]
I had originally set this up as a LauchDaemon, but these items don't work correctly unless the user is logging in - they work fine as a log in item as well. The problem is that I am unable to properly execute the computer naming script and then delete the LaunchAgent. I suspect that LaunchAgents don't run as root, but LaunchDaemons do. Is this correct and is there any way to make it run as root? I have tried adding sudo and su to the sciprt, but that did not work either.
Let me know if anyone has any ideas!!
thanks!
Steve