Another detail.pkgutil --expand and --flatten to remove the cert on the package does allow it to install correctly via munki.
Yes, I know :)But why the discrepancy between the munki installation and the GUI / command-line installation in the first place?
And here's the fish...just don't know exactly kind it is:Stripped it down to something to do with the environment variable "HOME"This works:env_vars = os.environ.copy()job = launchd.Job(cmd, environment_vars=env_vars)job.start()This doesn't:env_vars = os.environ.copy()env_vars['HOME'] = userinfo.pw_dirjob = launchd.Job(cmd, environment_vars=env_vars)job.start()So, env_vars['HOME'] defaults to '/var/root' and setting it to a real, other than root home directory makes things work, but what does that have to do with a certificate?I've gone ahead with adding the following to pkginfo: (this works)<key>installer_environment</key><dict><key>USER</key><string>CURRENT_CONSOLE_USER</string></dict>
Thank you for fishing. Comments below.On Jul 26, 2012, at 2:48 PM, Heig Gregorian wrote:And here's the fish...just don't know exactly kind it is:Stripped it down to something to do with the environment variable "HOME"This works:env_vars = os.environ.copy()job = launchd.Job(cmd, environment_vars=env_vars)job.start()This doesn't:env_vars = os.environ.copy()env_vars['HOME'] = userinfo.pw_dirjob = launchd.Job(cmd, environment_vars=env_vars)job.start()So, env_vars['HOME'] defaults to '/var/root' and setting it to a real, other than root home directory makes things work, but what does that have to do with a certificate?I've gone ahead with adding the following to pkginfo: (this works)<key>installer_environment</key><dict><key>USER</key><string>CURRENT_CONSOLE_USER</string></dict>That, of course, will not do the right thing if no user is logged in at the console -- in that case, HOME will once again be /var/root.
Setting USER and HOME in the installer_environment was added at some point last year to work around common failures in package scripts that were poorly tested and assumed that packages would only be installed when a GUI user was logged in.It was suggested that there would be no harm in setting these values, and the benefit would be that poorly-written/poorly-tested package scripts would now magically work with Munki.Hah.See this discussion: https://groups.google.com/forum/?fromgroups#!searchin/munki-dev/installer$20environment/munki-dev/4-MQweQOnmU/A5gytbX5SYsJI notice you (Heig) were involved in that particular thread...So: how should this be addressed?
However, what's the connection between a package's cert and, in this case, the environment variable 'HOME'? Remember, when I stripped the cert, everything was peachy, even with 'HOME' set to '/var/root'. I fished, and now I have more questions than I started with!
I'm sorry, but I suppose I've said something confusing somewhere...del env_vars['HOME'] does NOT work. As far as I can tell $HOME needs to be set to a valid user home that's not root.
This works:env_vars = os.environ.copy()
job = launchd.Job(cmd, environment_vars=env_vars)job.start()This doesn't:env_vars = os.environ.copy()env_vars['HOME'] = userinfo.pw_dirjob = launchd.Job(cmd, environment_vars=env_vars)job.start()
On Jul 26, 2012, at 5:29 PM, Heig Gregorian wrote:I'm sorry, but I suppose I've said something confusing somewhere...del env_vars['HOME'] does NOT work. As far as I can tell $HOME needs to be set to a valid user home that's not root.Quoting you from earlier:This works:env_vars = os.environ.copy()SO WHAT IS env_vars['HOME'] SET TO HERE?
Here's some more fun...I wrote a haiku:You're so smart, wise guy...Do you have an idea?Where's the Greg I knew...