(nodes_e, nodes_s, nodes_x) = separate_nodes(node_list);
@@ -76,7 +77,11 @@ define exclusive_prioritize(svc, node_list)
% If we've got an exclusive service, only allow it to start on
% empty nodes.
%
- return nodes_e;
+ notice("Starting ", svc, " on ", nodes_e);
+ nowner = service_start(svc, nodes_e);
+ if ((nowner > 0) or (nowner != FAIL)) {
+ return nowner;
+ }
}
if (length(nodes_x) == 0) {
@@ -85,7 +90,7 @@ define exclusive_prioritize(svc, node_list)
% and no empty nodes, the service can not be started
%
notice("No empty / exclusive nodes available; cannot restart ", svc);
- return nodes_x;
+ return ERR_DOMAIN;
}
@@ -504,6 +512,38 @@ define default_service_event_handler()
()=service_stop(services[x]);
}
}
+
+ %
+ % Try to restart exclusive service which might have been recently
+ % stopped in order to make room for other exclusive services.
+ %
+ % Note that as a side effect, exclusive services (>=2) can't be
+ % stopped with clusvcadm -s; they will just pop right back - you
+ % must disable them if want them to stay stopped.
+ %
+ % This code has a side effect of brute-forcing the lowest-priority
+ % exclusive service offline in a cascaded fashion.
+ %
+ for (x = 0; x < len; x++) {
+ if (service_name == services[x]) {
+ % don't do anything to ourself!
+ continue;
+ }
+
+ excl = atoi(service_property(services[x], "exclusive"));
+ % non-exclusive or highest-prio (1) shouldn't get here
+ if ((excl == 0) or (excl == 1)) {
+ continue;
+ }
+
+ (,,, owner, state) = service_status(services[x]);
+ if (state == "stopped") {
+ info("Restarting stopped exclusive priority ",
+ excl, " service ", services[x]);
+ nodes = allowed_nodes(services[x]);
+ ()=move_or_start(services[x], nodes);
+ }
+ }
}