pcp
[Top] [All Lists]

Exit status from PMDA Install/Remove scripts

To: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Subject: Exit status from PMDA Install/Remove scripts
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Sun, 10 Jul 2016 21:13:57 -0400 (EDT)
Cc: PCP <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <1800194914.5043029.1468198673333.JavaMail.zimbra@xxxxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: m1JzaIkyUNgRa3ClDPsQ5RwOP0pMKw==
Thread-topic: Exit status from PMDA Install/Remove scripts
Hi Ken, all,

Marko noticed an interesting phenomenon, which is that failures
within PMDA Install scripts are not always being propogated out
to the shell.

>From a bit of digging into it, I think the problem scenario is a
PMDA which calls "exit 1" in the Install script itself (i.e. not
pmdaproc.sh - auditing pmdaproc.sh, everything looks OK wrt trap
handling and its __sts use).

But this may be causing the problem - because the pmdaproc.sh is
registering its trap handler(s), and using __sts at the exit code,
if an Install script attempts to directly "exit 1" then the 1 code
will end up dropped on the floor (because pmdaproc.sh trap handler
is called, and it uses __sts).

Hmm, how to fix this?  We could propagate use of __sts up into the
Install scripts too.  Should we make this a non-double-underscore
variable, if we go that route?

Or we could introduce trap handling into the top level scripts,
and try to make them play nice with the conflicting trap calls in
pmdaproc.sh.

Or something else.  Any thoughts / preferences?

cheers.

--
Nathan

<Prev in Thread] Current Thread [Next in Thread>