May 16, 2018
Recently we experienced issue in Solaris 11 when running pkgadd to install FNMS 2021 R2 agent. We have no issue in running following, but with issue in running it inside a shell script. Any idea of why pkgadd failed when running inside a script?
-bash-5.1# /usr/sbin/pkgadd -n -a admin -r /dev/null -d managesoft-*.sparc.pkg ManageSoft(C) 2021 Flexera Software LLC. All rights reserved. Protected by US patents6,006,034 and 6,360,366; patents pending. Previous versions of ManageSoftwere known as NETDEPLOY GLOBAL. ManageSoft Corp was previously known asOpen Software Associates. NETDEPLOY, NETDEPLOY GLOBAL, ManageSoft, and theManageSoft logo are trademarks or registered trademarks of ManageSoft Corp.Other product names are trademarks of their respective owners and are usedto their credit.Configuring ManageSoft for Managed Devices ...Installation directory: "/opt/managesoft"Data directory: "/var/opt/managesoft"Created /etc/managesoft.iniUpdating configuration with defaults: DoneApplying bootstrap answer file "/var/tmp/mgsft_rollout_response" ...Starting ManageSoft services...Starting ndtask: successfulStarting mgsusageag: successfulSetting heartbeat schedule: DoneManageSoft was configured using an answer file.Removing legacy files: DoneInstallation of <ManageSoft> was successful.-bash-5.1#
When running inside a script called unix-setup-m.sh, we got following error.
+ [ sparc '=' sparc ]+ /usr/sbin/pkgadd -n -a admin -r /dev/null -d managesoft-17.0.1.sparc.pkg ManageSoftpkgadd: ERROR: unable to make temporary directory to unpack datastream: No such file or directory+ ret=1
@Woo_Lam - it seems unlikely that it would simply be the fact that the command is executed from a script that would cause the difference here. Maybe there is something about the environment that the script sets up before running the pkgadd command that results in the different behavior you are seeing.
Our SA ran the install script on /var/tmp and got install error, but no error when running pkgadd outside of the install script.
-bash-5.1# sh -x unix-setup-m.sh qidc-flexera+ dirname unix-setup-m.sh+ BASEDIR=.+ [ 1 '=' 0 ]+ beaconsvr=qidc-flexera+ echo 'qidc-flexera will be used as default Beacon'qidc-flexera will be used as default Beacon+ TMPDIR=/var/tmp/tempdir.26045.22400.10523+ umask 077+ mkdir /var/tmp/tempdir.26045.22400.10523+ cat+ 0<< \EOF
# The initial download location(s) for the installation.# For example, http://myhost.mydomain.com/ManageSoftDL/# Refer to the documentation for further details.#MGSFT_BOOTSTRAP_DOWNLOAD=http://beacon.mydomain.com:8080/ManageSoftDL/MGSFT_BOOTSTRAP_DOWNLOAD=https://qidc-flexera/ManageSoftDL/
# The initial reporting location(s) for the installation.# For example, http://myhost.mydomain.com/ManageSoftRL/# Refer to the documentation for further details.#MGSFT_BOOTSTRAP_UPLOAD=http://beacon.mydomain.com:8080/ManageSoftRL/MGSFT_BOOTSTRAP_UPLOAD=https://qidc-flexera/ManageSoftRL/
# The initial proxy configuration. Uncomment these to enable proxy configuration.# Note that setting values of NONE disables this feature.#MGSFT_HTTP_PROXY=http://webproxy.local:3128#MGSFT_HTTPS_PROXY=https://webproxy.local:3129#MGSFT_PROXY=socks:socks.socksproxy.local:19121,direct#MGSFT_NO_PROXY=internal1.local,internal2.local
# Check the HTTPS server certificate's existence, name, validity period,# and issuance by a trusted certificate authority (CA). This is enabled# by default and can be disabled with false.#MGSFT_HTTPS_CHECKSERVERCERTIFICATE=trueMGSFT_HTTPS_CHECKSERVERCERTIFICATE=false
# Check that the HTTPS server certificate has not been revoked. This is# enabled by default and can be disabled with false.#MGSFT_HTTPS_CHECKCERTIFICATEREVOCATION=trueMGSFT_HTTPS_CHECKCERTIFICATEREVOCATION=falseEOF1> /var/tmp/tempdir.26045.22400.10523/mgsft_rollout_response+ uname -s+ [ SunOS '=' SunOS ]+ chown install /var/tmp/tempdir.26045.22400.10523/mgsft_rollout_response+ 2> /dev/null+ chown nobody /var/tmp/tempdir.26045.22400.10523/mgsft_rollout_response+ 2> /dev/null+ ret=0+ mv -f /var/tmp/tempdir.26045.22400.10523/mgsft_rollout_response /var/tmp/mgsft_rollout_response+ rm -rf /var/tmp/tempdir.26045.22400.10523+ [ 0 -ne 0 ]+ echo 'Installing the FlexNet inventory agent'Installing the FlexNet inventory agent+ uname -s+ [ SunOS '=' SunOS ]+ TMP1=/var/tmp+ cat+ 0<< \EOFconflict=nochecksetuid=nocheckaction=nocheckpartial=nocheckEOF1> /var/tmp/admin.10523+ uname -p+ [ sparc '=' i386 ]+ uname -p+ [ sparc '=' i586 ]+ uname -p+ [ sparc '=' i686 ]+ uname -p+ [ sparc '=' sparc ]+ /usr/sbin/pkgadd -n -a /var/tmp/admin.10523 -r /dev/null -d managesoft-17.0.1.sparc.pkg ManageSoftpkgadd: ERROR: unable to make temporary directory to unpack datastream: No such file or directory+ ret=1+ rm -f /var/tmp/admin.10523+ [ 1 -ne 0 ]+ echo+ 1>& 2
+ echo 'ERROR: Failed to install the FlexNet inventory agent'+ 1>& 2ERROR: Failed to install the FlexNet inventory agent+ exit 1
I see there are a few things that your script is doing that may be different from when you are attempting the install manually:
I don't know which of these things might make a difference (although the directory removal noted in #1 above looks suspicious), but I'd be starting by playing around with them to see if any of these actions done by the script causing a problem.
I'm not sure it will be related to your current issue, but in case you're not aware: the contents that the script puts into the /var/tmp/admin.10523 file do not match what is suggested for putting in that file by the following page: Agent Third-Party Deployment: Installing FlexNet inventory agent on UNIX.
1)-3) TMPDIR is used to create mgsft_rollout_response. After it is created, we don't need TMPDIR anymore.
mv -f $TMPDIR/mgsft_rollout_response /var/tmp/mgsft_rollout_response || ret=1rm -rf $TMPDIR
4) The script created
if [ "`uname -s`" = "SunOS" ]; thenTMP1=/var/tmpcat <<EOF >$TMP1/admin.$$conflict=nochecksetuid=nocheckaction=nocheckpartial=nocheckEOF
I also have tried the followings in admin file, but still got the same error.