The PreOnline can used to make a decision about whether to online the service group, so suppose EV will not work without Z been mounted then the code can be something like:
$return_code=0;
$group = $ARGV[1];
if ($group eq "EV") {
$return_code=VCSAG_SYSTEM("net use Z: \\server3\fileshare");
}
if ($return_code eq 0) {
if (defined $ARGV[3]) {
`\"$vcs_home\\bin\\hagrp\" -online -nopre $ARGV[1] -sys $ARGV[0] -checkpartial $ARGV[3]`;
exit;
}
`\"$vcs_home\\bin\\hagrp\" -online -nopre $ARGV[1] -sys $ARGV[0]`;
}
else {
VCSAG_LOG_MSG ("E", "Mount of Z: failed, so not onlining EV",9000 )
}
exit;
So that is why Preonline requires "hagrp -online -nopre" in the code and why if you run manually the group will be onlined. All other trigger scripts just run and do not effect onlining or offlining service groups, so don't required any "hagrp" commands which is why if you run a postoffline manually, it will not offline the group.
The difference in running script manually and through VCS, is that manually you are running script as a "logged in user" to your session, whereas when VCS runs it, it is being run by the "non-logged in user" that the "had" service runs as.
I have seen before that if you are using Terminal services that if a drive is assigned by VCS, My Computer doesn't see it but it is there and if you log out of terminal services session and back in, then it sees it. I guess this is an issue with terminal services, something like, where it doesn't expect a drive to arrive where a command was not issued in it's session. I think when a drive is assigned via the MountV resource, Terminal serivce DOES see it, so there is probably some extra coding to make this happen in the MountV agent.
Mike