[ Moving to pkg-discuss ]

On Fri, Mar 06, 2009 at 01:34:31AM -0800, Vikash Tulsiyan wrote:

> I am writing a script which first sets a depot server, start the pkg
> service in that server. Now i am banking on the output of pkg refresh to
> know whether the pkg service has been successfully started or not. 
> First i tried the return code of pkg refresh command. It  did not help
> since ?pkg refresh tries to refresh all depot server and its return code
> will be non zero even if it is unable to refresh one of the available
> depot servers.
> 
> Hence i tried the other way, trying to grep the depot server name and
> then grep for 'Connection refused' message from the pkg refresh output.
> This worked for a while. However 'Connection refused'  is not the only
> error  message that can come out of pkg refresh.
> 
> Is there any reliable way i can know that i have successfully started pkg
> service in remote/localhost?

There are no public interfaces to do that, though we have some Python
routines we use for the testsuite that do this.

You probably should just be running the depot as an SMF service
(pkg/server), and checking whether the service is online or not.

> Also is it possible to refresh only a particular depot server

"pkg refresh" appears to take an authority name, so you could give that a
try.

Danek
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to