Application Agent PID file quesiton
I have created a unix scirpt to do some task and enf of the task it will create a local file in /var/lock/abcd.lock file.
I created a application resource and put /var/lock/abcd.lock for PidFiles attribute. The lock file is creating, but not resouce is not making as fault.
I am not sure why it is making as fault. If the lock file is there, applicaiton agent shouln't bring the resouce up?
You have not said if the lock file is being created on shared storage that moves with the Service Group.
If the lock file is not on shared storage, if NodeA panics/crashes whilst the SG was up on it, then...:
1. The SG fails-over to NodeB. (OK so far...)
2. Some time later NodeA comes back online, and VCS runs the monitor entry point for all resources, in order to determine whether these are online or offline on NodeA.
3. Because the lock file still exists locally on NodeA, your Application resource is considered online on NodeA.
4. But it is also online on NodeB, and so then VCS complains about a Concurrency Violation (where a resource is in a non-Parellel service group, and is online on more than one node).
This will require administrative action to resolve -- you would need to manually remove the lock file on NodeA.
Usually, "one time" operations are done via the PreOnline and/or PostOnline triggers. This also avoids the overhead of the node running the monitor routine every MonitorInterval seconds.
Otherwise, if this task needs to be done before another resource is brought online, then often it could/should be implemented in that resource's "start up procedures".
So the question is:
Does the task need to be performed after some resource comes online (such as the Disk Group resource) AND prior to another resource coming online? If so, can you add this task to be performed by modifying that resource's online procedures?
At the end of the day, you need to test the various failure cases (server, applicaiton, network, etc) to see how your implementation behaves...