Commit 9b766f5f authored by Leigh B. Stoller's avatar Leigh B. Stoller

More work on previous revision.

parent f5dbc8b0
......@@ -3543,6 +3543,9 @@ sub AddInternalProgramAgent($$)
my $eid = $self->eid();
my $idx = $self->idx();
#
# This addresses the agent itself.
#
DBQueryWarn("replace into virt_agents ".
" (exptidx, pid, eid, vname, vnode, objecttype) ".
" select '$idx', '$pid', '$eid', ".
......@@ -3558,8 +3561,27 @@ sub AddInternalProgramAgent($$)
" '__${vhost}_program-agent')")
or return -1;
#
# And this is a generic program that can used.
#
DBQueryWarn("replace into virt_agents ".
" (exptidx, pid, eid, vname, vnode, objecttype) ".
" select '$idx', '$pid', '$eid', ".
" '${vhost}_program', '$vhost', ".
" idx from event_objecttypes where ".
" event_objecttypes.type='PROGRAM'")
or return -1;
DBQueryWarn("replace into virt_programs ".
" (exptidx, pid, eid, vname, vnode, command) ".
" values ('$idx', '$pid', '$eid', ".
" '${vhost}_program', '$vhost', ".
" '/bin/echo ready >>& /dev/null')")
or return -1;
return 0;
}
sub DeleteInternalProgramAgents($)
{
my ($self, $vhost) = @_;
......@@ -3593,6 +3615,18 @@ sub DeleteInternalProgramAgents($)
" group_name='__all_program-agents' and ".
" agent_name='__${vhost}_program-agent'")
or return -1;
DBQueryWarn("delete from virt_agents ".
"where exptidx='$idx' and ".
" vname='${vhost}_program' and ".
" vnode='$vhost'")
or return -1;
DBQueryWarn("delete from virt_programs ".
"where exptidx='$idx' and ".
" vname='${vhost}_program' and ".
" vnode='$vhost'")
or return -1;
}
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment