site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=UbKlsxYsKMdGrfAuS9KRnHu4JkA+YXRsF0Dvjy/2Eqo=; b=DN2daiIFogtuuMKl7oS2TrXyy+jrsWWbFLEMKdJX9S3g9RYoxGsl7IWLSkeLoTP/XW uSsvEB9tsHdx87TpJ6fZ5I6sczW+JMTqWVDru2GUzNI7bdVpJLqgEJtT2GJ3WaiJYhpi vnD4bGtzzcObfqFIBTN3PP0kMQ+4UlbxD7OcY= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=doFBDItQz3AUQUyjtGBipMWp1mUeWoOhbHYj5Q90zx8X/+KEJtUhiNZtMK0GU1HHsB 3oyrEEfRdCyIn/MhO7tLtAVP58RFkPlDxKS/BdE5gpe596ADtd/JSL87rIGvPzs/HoX+ MKcpoNjp/tiDIERuzbvuHBAtA9L+taEPfbhac= sudo shouldn't give you a second user via a "who" command. But a Terminal window (or multiple terminal windows) will: megrez:~ npeelman$ who npeelman console Mar 15 09:06 npeelman ttys000 Mar 16 10:40 megrez:~ npeelman$ sudo who Password: npeelman console Mar 15 09:06 npeelman ttys000 Mar 16 10:40 When you run it from a command line what your script is seeing is the console session and the tty session. When run via ARD, if no users are logged in, that script should run fine (but I still suggest testing it). Short of building an array based on the awk $1 of the who command, my only other suggest would be to grep for "console" between your who and your awk, ie: who | grep console | awk ' { print $1 } '. -nick -- Nick Peelman nick@peelman.us On Mon, Mar 15, 2010 at 5:37 PM, Xochitl Lunde <Xochitl_Lunde@tripplite.com> wrote:
Thanks to some of the earlier discussions here, I have a package which I feel works fantastically with my launchd items. Unfortunately, it now does not work for me on the command line, oops!
xochitl-lundes-imac:installcomponents xlunde$ installer -pkg sda/iceberg/build/PowerAlertSA-12.04.0050.pkg -target /Volumes/SNOWLEOPARD Java Update version is '1'. installer: This package requires authentication to install.
xochitl-lundes-imac:installcomponents xlunde$ sudo installer -pkg sda/iceberg/build/PowerAlertSA-12.04.0050.pkg -target /Volumes/SNOWLEOPARD xlunde is logged in! installer: Error - Too many users are logged in. PowerAlert cannot be installed correctly for all users when multiple users are logged in.
----------------------- Obviously, I did this to myself.
for name in `who | awk {'print $1'}` do if [ ! $name = $USER ] ; then echo "${name} is logged in!" exit 112; fi done
The multi-user check was based on some earlier discussion. Now when I run the installer on the command line using 'sudo', I get a different $USER in my environment. I know this will mess up my launchd agent later on in my preinstall and postinstall.
I'm a little stumped on what direction to think about this. A command line install is required to not annoy the cheezeburgers out of anyone who administrates multiple computers, right? Are we supposed to use 'sudo' for packages that require admin privileges or is there a different way to do this? Is it the right thing to go through my scripts add an 'if $USER == root' for everything?
Xo
_______________________________________________ Do not post admin requests to the list. They will be ignored. Installer-dev mailing list (Installer-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/installer-dev/nick%40peelman.us
This email sent to nick@peelman.us
_______________________________________________ Do not post admin requests to the list. They will be ignored. Installer-dev mailing list (Installer-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/installer-dev/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com