cancel
Showing results for 
Search instead for 
Did you mean: 

CleanProgram Attribute for Application Resource

sanderfiers
Level 3
Partner Accredited

Hi,

I am in need for more detailed information on the CleanProgram Attribute for the Application Resource.

I could not find any information in the documentation (including the Application Agent Configuration Guide) regarding this topic.
Is there any more-detailed information available somewhere?

The Veritas documentation only states:

It's an optional Attribute.
It's an executable file that forcibly kills the application and performs cleanup taks.

In the past I was not using this Attribute. Only the StartProgram Attribute, StopProgram Attribute and a MonitorProgram Attribute. Very recently I was trying to implement this CleanProgram Attribute. The script should kill a certain process and remove a lock-file.

My questions:

  • When does the CleanProgram kicks in?
    Is it only when the StopProgram fails multiple times as definied in the xx?
  • Can I include a new start of my actual application?
    Or will this be done by the StartProgram Attribute?
  • Should you include any Veritas exit code to return the status to Veritas Cluster Server?
    Or can I just trust my MonitorProgram to handle this?
  • Are there any sample CleanPrograms available?

Thanks in advance,

Sander

1 ACCEPTED SOLUTION

Accepted Solutions

Gaurav_S
Moderator
Moderator
   VIP    Certified

Hi,

My answers

  • When does the CleanProgram kicks in?
    Is it only when the StopProgram fails multiple times as definied in the xx?

>> This is right, think of clean like a corrective action. For e.g if stop program is defined to stop an application however agent is still finding that process exists (pid). You can define a clean program to kill the PID. It will come in play only when stoprogram has executed yet VCS monitor script finds that resource is not returning an offline state (status code 100).

  • Can I include a new start of my actual application?
    Or will this be done by the StartProgram Attribute?

>> As mentioned in previous point, after a clean program, a monitor program will execute, it would assume to find an offline state (100), so I would suggest to use StartProgram attribute to start your application once a clean shutdown of application has happened.

  • Should you include any Veritas exit code to return the status to Veritas Cluster Server?
    Or can I just trust my MonitorProgram to handle this?

>> It must have Veritas exit codes (100 & 110)

  • Are there any sample CleanPrograms available?

>> you can create simple 3-4 line clean script .. one e.g. can be found on this link

https://www.veritas.com/community/forums/clean-script-exiting-abnormally-exit-code-0x9

View solution in original post

3 REPLIES 3

Gaurav_S
Moderator
Moderator
   VIP    Certified

Hi,

My answers

  • When does the CleanProgram kicks in?
    Is it only when the StopProgram fails multiple times as definied in the xx?

>> This is right, think of clean like a corrective action. For e.g if stop program is defined to stop an application however agent is still finding that process exists (pid). You can define a clean program to kill the PID. It will come in play only when stoprogram has executed yet VCS monitor script finds that resource is not returning an offline state (status code 100).

  • Can I include a new start of my actual application?
    Or will this be done by the StartProgram Attribute?

>> As mentioned in previous point, after a clean program, a monitor program will execute, it would assume to find an offline state (100), so I would suggest to use StartProgram attribute to start your application once a clean shutdown of application has happened.

  • Should you include any Veritas exit code to return the status to Veritas Cluster Server?
    Or can I just trust my MonitorProgram to handle this?

>> It must have Veritas exit codes (100 & 110)

  • Are there any sample CleanPrograms available?

>> you can create simple 3-4 line clean script .. one e.g. can be found on this link

https://www.veritas.com/community/forums/clean-script-exiting-abnormally-exit-code-0x9

sanderfiers
Level 3
Partner Accredited

Hi Gaurav,

Thank you for your reply.

  • CleanProgram
    Yes, my understanding of the CleanProgram seems to be correct. If the StopProgram is executed and the MonitorProgram still sees my Resource as online,
    the application will be force-stopped via the CleanProgram.

 

  • a new start of my application
    So it's not needed to start the application inside the CleanProgram, since I already have a StartProgram in place for the same Resource?
    VCS will execute the StartProgram immediatly after the CleanProgram to bring the Resource back online.
     
  • exit code inside my CleanProgram script
    My MonitorProgram does include exit codes. But should I include it in the CleanProgram also?

My MonitorProgram currently does this:

  • Search for the PID of my application.
  • If there is no PID to be found, it sends a Veritas offline exit code.
  • If the is a PID to be found, a functional test is done (a querry via the application to return date and time)
  • If the functional test is a success, it sends a Veritas online exit code. If not, it sends a Veritas offline exit code.

My CleanProgram currently does this:

  • Search for the PID of my application.
  • Kill the process with that PID.
  • Remove a lock-file.

Is it wise to include a 4th line in the CleanProgram to send a Veritas offline exit code? I understand that the MonitorProgram will kick in after the CleanProgram.
But is it called right away after the CleanProgram or on the next monitor cycle? Because if it is when the next monitor cycle kicks in,
it might be wise to include the offline exit code inside the CleanProgram already, so VCS knows the offline state way faster.

 

  • sample CleanPrograms
    Thanks, I noticed that thread earlier on. However I was looking for some more detailled scripts.

 

 

Gaurav_S
Moderator
Moderator
   VIP    Certified

For start of application, yes, once clean is executed, monitor script will detect the status & report to HAD. Basis on group policy (depending on factors like critical resources in path etc), next action will be taken by VCS.

I would recomment to bring in VCS exit codes in cleanscript as well. Reason is, Application agent has a code about clean script, in simple words application agent / VCS would know what clean script is & I am sure exit codes would be consistent across. HAD would only understand VCS exit codes.


G