Re: Odd question relating to preinstall scripts and administrator access
Re: Odd question relating to preinstall scripts and administrator access
- Subject: Re: Odd question relating to preinstall scripts and administrator access
- From: Cameron Pulsford <email@hidden>
- Date: Thu, 31 Jul 2008 17:28:31 -0400
Yes that is a typo, a very bad one at that too, it should have read
unload. Also, this is exclusively for 10.5. Doing an ls -l on a
correctly installed file yields "$USER wheel".
I did a little more experimenting, I tried this just to see if it is
even picking up the right user.
realUserName=`users | grep -v root`
cd /Users/$realUserName/Desktop
echo $realUserName > username.txt
and no file ever shows up, however, other parts of the script are
getting run. So I am not sure what is going on AT ALL. This is very
baffling.
On Jul 31, 2008, at 5:18 PM, Scott Russell wrote:
Ah, forgive me (and thanks for the correction, Stephane),
It's not the $USER part that's failing, it's the actual running of
the line. I suppose if I read the entire message before i replied ...
So have you verified who really owns the installed LaunchAgent? Is
it possible that it's owned by someone other than ${USER}? Is it
possible that if ${USER} doesn't own it that ${USER} can't unload
it? Grasping as I try to help ...
(I assume that the typo "unlead" is only for our benefit and that's
not in your live code.)
Best wishes,
Scott
--
Dr. Scott Russell
IT Support Engineer/Consultant
Arts & Letters Computing, Distributed Support Services,
Office of Information Technologies, University of Notre Dame
Instructor of Horn, University of Notre Dame and Saint Mary's College
Assistant Horn, South Bend Symphony Orchestra
234 Decio Hall
574-631-7021
email@hidden
http://www.nd.edu/~srussel2/
On Jul 31, 2008, at 1:54 PM, Cameron Pulsford wrote:
So I seem to have the opposite problem most people have... I am
installing something that needs administrator access but I need to
run a preinstall script that not only doesn't need these rights, it
can't have these rights. I need to run a script that does stuff
with "launchctl unload" and when that is given root access it
defaults to root, even if the explicit path you give it to unload
is ~/Library/xxx for example. That's at least what I have gathered
after some research.
When I run the script from the terminal it works, but when I run
"sudo thescript" it doesn't work.
I tried modifying my script like this...
realUserName=`echo $USER`
sudo -u $realUserName launchctl unlead $HOME/Library/LaunchAgents/
com.racepoint.*.plist
and in the console I still get the same error message "launchctl:
Dubious ownership on file (skipping) /Users/xxx/Library/
LaunchAgents" and then the installer fails.
Just to test I made a new package that just did some bogus stuff
that didn't need administrator access, and I had it run the same
prelaunch script and it worked great. Sorry if this is confusing
but essentially I need a script to run without super user
privileges but the component thats getting installed after the
prelaunch script does. Any ideas?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden