syspatch(8) return values?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

syspatch(8) return values?

Adam Thompson
There's no mention of what syspatch(8) returns, in the manpage.

I can prove quickly enough that it exits(0) when there's nothing to do,
but I'm more interested in knowing (for automation purposes) what the
return values are in other circumstances, and all my systems are already
up to date.  Before standing up yet another system, I figured I'd ask
here.

I can think of four scenarios syspatch(8) perhaps ought to distinguish,
at least I'm interested in these 4 outcomes:
   1. nothing to do
   2. patches waiting, but didn't do anthing
   3. patches applied
   4. something went wrong

Can I reliably tell based on $? or do I have to parse the output?

Thanks,
-Adam

Reply | Threaded
Open this post in threaded view
|

Re: syspatch(8) return values?

Antoine Jacoutot-7
On Fri, Jan 31, 2020 at 09:03:59AM -0600, Adam Thompson wrote:

> There's no mention of what syspatch(8) returns, in the manpage.
>
> I can prove quickly enough that it exits(0) when there's nothing to do, but
> I'm more interested in knowing (for automation purposes) what the return
> values are in other circumstances, and all my systems are already up to
> date.  Before standing up yet another system, I figured I'd ask here.
>
> I can think of four scenarios syspatch(8) perhaps ought to distinguish, at
> least I'm interested in these 4 outcomes:
>   1. nothing to do
>   2. patches waiting, but didn't do anthing
>   3. patches applied
>   4. something went wrong
>
> Can I reliably tell based on $? or do I have to parse the output?

Most likely parse, yes.

"patches waiting, but didn't do anything" might be interesting (i.e patches are
available); dunno...

--
Antoine

Reply | Threaded
Open this post in threaded view
|

Re: syspatch(8) return values?

Allan Streib-2
Antoine Jacoutot <[hidden email]> writes:

> "patches waiting, but didn't do anything" might be interesting (i.e
> patches are available); dunno...

syspatch -c

Allan

Reply | Threaded
Open this post in threaded view
|

Re: syspatch(8) return values?

Adam Thompson
In reply to this post by Antoine Jacoutot-7
On 2020-02-08 06:03, Antoine Jacoutot wrote:

> On Fri, Jan 31, 2020 at 09:03:59AM -0600, Adam Thompson wrote:
>> There's no mention of what syspatch(8) returns, in the manpage.
>>
>> I can prove quickly enough that it exits(0) when there's nothing to
>> do, but
>> I'm more interested in knowing (for automation purposes) what the
>> return
>> values are in other circumstances, and all my systems are already up
>> to
>> date.  Before standing up yet another system, I figured I'd ask here.
>>
>> I can think of four scenarios syspatch(8) perhaps ought to
>> distinguish, at
>> least I'm interested in these 4 outcomes:
>>   1. nothing to do
>>   2. patches waiting, but didn't do anthing
>>   3. patches applied
>>   4. something went wrong
>>
>> Can I reliably tell based on $? or do I have to parse the output?
>
> Most likely parse, yes.
>
> "patches waiting, but didn't do anything" might be interesting (i.e
> patches are
> available); dunno...

Equally if not more interesting would be "I tried to apply patches but
failed somehow".  Which happened to me, and which is why I asked in the
first place.
*sigh*  I'll try to propose some bad diffs [if I'm writing them, they'll
be bad] someday soon.
-Adam

Reply | Threaded
Open this post in threaded view
|

Re: syspatch(8) return values?

Antoine Jacoutot-7
In reply to this post by Allan Streib-2
On Mon, Feb 10, 2020 at 12:12:12PM -0500, Allan Streib wrote:
> Antoine Jacoutot <[hidden email]> writes:
>
> > "patches waiting, but didn't do anything" might be interesting (i.e
> > patches are available); dunno...
>
> syspatch -c

?

--
Antoine