Operating System - HP-UX
1823958 Members
4943 Online
109667 Solutions
New Discussion юеВ

forcing an automated unattended solaris pkgadd

 
SOLVED
Go to solution
harry d brown jr
Honored Contributor

forcing an automated unattended solaris pkgadd


Yes I know this isn't a sun site, but we do have the worlds best unix collective minds here.

I need a little help in trying to do a "forced" automated install, meaning I want to FORCE the install regardless!

what I have found is that some of our sun servers have LAME installs, causing an unattended install from failing. Things like /usr/local/bin not being a directory or the install is asking if its ok to replace an existing library.

What I want is to be able to put this in a script (perl prog) and automate the install to be as brain-dead as possible.

This is the command I'm using (the same format for solaris :

/usr/sbin/pkgadd -n -d /opt/bind-9.2.2-sol7-sparc-local SMCbind

If I get something that really works, then I can update my install script for BIND 9.2.x (works for hpux and solaris).

live free or die
harry
Live Free or Die
8 REPLIES 8
James R. Ferguson
Acclaimed Contributor

Re: forcing an automated unattended solaris pkgadd

Hi Harry:

If the utility expects "yes" or "no" responses, and "yes" is what you want, perhaps redirecting '/usr/bin/yes' to its stdin would help. If you have mixed responses, but know a priori the responses needed, build those into a file which is redirected.

Regards!

...JRF...
Natasha L.
Advisor

Re: forcing an automated unattended solaris pkgadd

Hi,

I've heard that expect is a good tool for this purpose. It is a program for controlling interactive apps. Have been meaning to try it out for awhile. You need tcl, tk and gcc for it too.

http://www.sunfreeware.com/programlistsparc8.html#expect

good luck!
Natasha
Robert-Jan Goossens
Honored Contributor
Solution

Re: forcing an automated unattended solaris pkgadd

Hai Nguyen_1
Honored Contributor

Re: forcing an automated unattended solaris pkgadd

Harry,

Use:
# /usr/sbin/pkgadd -d /opt/bind-9.2.2-sol7-sparc-local -r response.txt SMCbind

to record the responses in interactive mode to the file response.txt. Then use the command below for your non-interactive install:

# /usr/sbin/pkgadd -n -d /opt/bind-9.2.2-sol7-sparc-local -r /full_path/response.txt SMCbind

Hai

Hai Nguyen_1
Honored Contributor

Re: forcing an automated unattended solaris pkgadd

Harry,

Sorry for a mistake. My first command should have read "pkgask" instead of "pkgadd".

Hai
harry d brown jr
Honored Contributor

Re: forcing an automated unattended solaris pkgadd

Thanks everyone. I really don't want to use "expect/tk/tcl" because I can't assume that it is available on the servers the code is being installed on. Hell, I can barely have expectations that perl is installed!

Robert-Jan. Thanks for the links it reassured some of my digging into the responsefile option.

What I found is you can have ONE entry in the RESPONSEFILE: action=nocheck

Which appears to force a reinstall or an override . I have to test the OVERRIDE theory, but the FORCE install worked.

I did this:

/usr/sbin/pkgadd -n -a /tmp/STUPIDTHINGS -d /opt/DNSCACHE_INSTALLDIR/bind-9.2.2-sol7-sparc-local SMCbind

where /tmp/STUPIDTHINGS has
action=nocheck

thanks everyone! If it does do OVERRIDE's, I'll update everyone.

live free or die
harry
Live Free or Die
harry d brown jr
Honored Contributor

Re: forcing an automated unattended solaris pkgadd

Actually SOLARIS SUCKS! I'm wondering if solaris isn't afterbirth of M$

I renamed the directory /usr/local/bin to /usr/local/OLDbin.

I then created a file called "bin":

# touch /usr/local/bin
# ls -l /usr/local/bin
-rw-r--r-- 1 root other 0 Aug 6 15:35 /usr/local/bin
#

I then decided to use pkgask:

# rm /tmp/STUPIDTHINGS
# /usr/sbin/pkgask -r /tmp/STUPIDTHINGS -d /opt/DNSCACHE_INSTALLDIR/bind-9.2.2-sol7-s>

Processing package instance from

bind
(sparc) 9.2.2
ISC
pkgask: ERROR: package does not contain an interactive request script

Processing of request script failed.
No changes were made to the system.
#


Seriously, solaris just plain sucks! Maybe SCO and SUN can merge and rename their company to blackhole??


live free or die
harry
Live Free or Die
harry d brown jr
Honored Contributor

Re: forcing an automated unattended solaris pkgadd

Maybe solaris doesn't suck as much as I thought? We can debate that issue for years :-)))

I changed my "admin"/"response" file to this:

mail=
instance=unique
partial=nocheck
runlevel=nocheck
idepend=nocheck
rdepend=nocheck
space=nocheck
setuid=nocheck
conflict=nocheck
action=nocheck
basedir=default

With the /usr/local/bin being a file and not a directory and it actually just blew away the file and created the directory - JUST WHAT I WANTED!

Thanks everyone!

live free or die
harry
Live Free or Die