Checking before the operation would allow any script to verify whether the 
publisher was reachable and exit gracefully with a "Network is unreachable" 
message.  This is a very realistic scenario.

Otherwise we get "Installing", "Failed", (figure it out) "Network is 
Unreachable" and a much more unpleasant user experience.  Our methodology is to 
do all possible to guarantee that an action will succeed before we attempt it.  
It's the same as checking whether a packages dependencies are there instead of 
installing it to find out what is missing.

--Steve

-----Original Message-----
From: Shawn Walker [mailto:[email protected]] 
Sent: Wednesday, March 14, 2012 8:00 AM
To: Ervin Yan
Cc: [email protected]; Venkatesha M.G.; Steve Sundstrom
Subject: Re: [pkg-discuss] How to validate whether a publisher is reachable or 
not

On 03/14/12 02:20, Ervin Yan wrote:
> Hi,
>
> Recently, we happened to find 'pkg install' totally failed due to a network 
> issue, the error looks like:
>
> ==========
> Framework error: code: 7 reason: Failed to connect to 156.151.58.21: Network 
> is unreachable
> URL: 'http://pkg.oracle.com/solaris/release/versions/0/'.
> ==========
>
>
> So does 'pkg' command have any options to verify whether the configured 
> publishers are reachable or not,
> or something other issues which would cause 'pkg install' fail?

No, because it could become unreachable at any point during the 
operation, so checking ahead of time would be pointless.

> We just want to check it in advanced, and ask user to correct the publisher 
> configuration before our utility run  'pkg install' truly.

The right way to handle this is to perform the install, check the exit 
code, and if it isn't zero, assume failure of the operation.

-Shawn
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to