Skip to Content.
Sympa Menu

grouper-users - RE: [grouper-users] Disable loader jobs

Subject: Grouper Users - Open Discussion List

List archive

RE: [grouper-users] Disable loader jobs


Chronological Thread 
  • From: Andrew Morgan <>
  • To: "Hyzer, Chris" <>
  • Cc: "" <>
  • Subject: RE: [grouper-users] Disable loader jobs
  • Date: Fri, 20 Apr 2018 11:54:21 -0700 (PDT)
  • Ironport-phdr: 9a23:jW8SzR19zgLB6wBbsmDT+DRfVm0co7zxezQtwd8ZseIWKvad9pjvdHbS+e9qxAeQG9mDsLQc06L/iOPJYSQ4+5GPsXQPItRndiQuroEopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZvJuTyB4Xek9m72/q99pHPbQhEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfMQA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb7S60/Vza/4KdxUBLmhicJOSAk/m7VicJwgqxUrx29qBFk347YfJ2ZOOZicq7HY98XQ3dKUMZLVyxGB4Oxd5cCD+wcMuZCsYb8qUYFoxy5BQm2C+Pg0DlIjWLx0K0/1OQhCw7G0xYmH98Vt3TUts71NLsIXe+r0abI0CzOYvVL0jnz74jIdwouofCKXb9ocMrRz1UvGB3fjlWWt4PlIy2Z2v4TvGeG8uptU/+khW0/qwxpvzSj2MQhhpPUio8RxF3I7yV0zJwrKdGmSkN3ecOoHIVTui2AKod7Rs0vT3tntSog17ELu4K3cS4Xw5o93RHfceaIc42Q7xLjSumRJTB4iWp+eLK6mxay6VGsyvPkVsWozVpGtDFFktjDtnwX0BzT8NaISvR6/kenwjaPyxrc6v1aLkwui6XUNoMhzqYxlpoVr0vDAjf7lFjogKKVbEko5+yl5ur9brjmvJOQKZF4hwPmPqQrgMO/AOA4MgYUX2ic/OSxzLjj/UrjQLVFlPI2lLLUsJfAJcQAuq61GRFa3Zs+6xqnFTepzMwYnWUbLFJCYB+HgJLpO1bTIPDgE/i/mU2gkCpwx//YJL3hGY7ALnzCkLf6YbZ98FBQxBAyzdBZ+5JbFKsBIPTtVU/tqtDUFAE2PBGpw7WvNNIonKMPS2+VRueyMLnTqhXAsuckI/ieaZU9uS32beU96vjoy3I1hAlOU7Ou2M4+bnyiE+suBkKDbnPqyoMEFn0FtwwWS/bxlBuPXSMFNCX6ZL41+jxuUNHuNozEXI342LE=

I'm running into something which must be simple:

# ./gsh
Using GROUPER_HOME: /private/grouper/api/bin/..
Using GROUPER_CONF: /private/grouper/api/bin/../conf
Using JAVA: /usr/local/java/bin/java
using MEMORY: 64m-1536m
Grouper starting up: version: 2.3.0, build date: null, env: DEV
grouper.properties read from: /private/grouper/api/conf/grouper.properties
Grouper current directory is: /private/grouper/api/bin
log4j.properties read from: /private/grouper/api/conf/log4j.properties
Grouper logs are not using log4j: class
org.apache.commons.logging.impl.SLF4JLocationAwareLog
grouper.hibernate.properties:
/private/grouper/api/conf/grouper.hibernate.properties
grouper.hibernate.properties: <redacted>
subject.properties read from: /private/grouper/api/conf/subject.properties
sources configured in: subject.properties
subject.properties ldap source id: ldap: ldap.properties
subject.properties groupersource id: g:gsa
subject.properties groupersource id: grouperEntities
Type help() for instructions
Groovy Shell (2.4.11, JVM: 1.8.0_121)
Type ':help' or ':h' for help.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
groovy:000> :load /private/grouper/api/conf/groovysh.profile
groovy:000> grouperSession = GrouperSession.startRootSession();
===> c97020b6c5944668848073a3e9ac9c58,'GrouperSystem','application'
groovy:000> StringBuilder result = new StringBuilder();
===>
groovy:000> result.append("test\n");
Unknown property: result


It seems like StringBuilder isn't working??

Thanks,
Andy


On Fri, 20 Apr 2018, Hyzer, Chris wrote:

I added a jira for an enabled/disabled flag on loader jobs:

https://bugs.internet2.edu/jira/browse/GRP-1736

Thanks Chad and Carl for your responses. I made a GSH which generates GSH
for this and put it on the wiki:

https://spaces.internet2.edu/pages/viewpage.action?pageId=14517859

###################### If you run this:

grouperSession = GrouperSession.startRootSession();
sqlLoaderDefName =
AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyGroupType_grouperLoader",
true);
sqlLoaderDefScheduleName =
AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron",
true);
ldapLoaderDefName =
AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoaderLdap",
true);
ldapLoaderDefScheduleName =
AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoaderLdapQuartzCron",
true);
StringBuilder result = new StringBuilder();
result.append("\n\n############ RESTORE OLD SCHEDULES, BOUNCE GROUPER DAEMONS
AFTERWARDS #############\n\ngrouperSession =
GrouperSession.startRootSession();\n");
result.append("sqlLoaderDefName =
AttributeDefNameFinder.findByName(\"etc:legacy:attribute:legacyGroupType_grouperLoader\",
true);\n");
result.append("sqlLoaderDefScheduleName =
AttributeDefNameFinder.findByName(\"etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron\",
true);\n");
result.append("ldapLoaderDefName =
AttributeDefNameFinder.findByName(\"etc:attribute:loaderLdap:grouperLoaderLdap\",
true);\n");
result.append("ldapLoaderDefScheduleName =
AttributeDefNameFinder.findByName(\"etc:attribute:loaderLdap:grouperLoaderLdapQuartzCron\",
true);\n");
attributeAssigns =
GrouperDAOFactory.getFactory().getAttributeAssign().findAttributeAssignments(AttributeAssignType.group,
null, sqlLoaderDefName.getId(), null, null, null, null, null, true, false);
for (AttributeAssign attributeAssign : attributeAssigns) {result.append("group = GroupFinder.findByName(grouperSession, \"" +
attributeAssign.getOwnerGroup().getName() + "\");\nattributeAssignOnAssign = group.getAttributeDelegate().retrieveAssignment(null,
sqlLoaderDefName, false, false);\nattributeAssignOnAssign.getAttributeValueDelegate().assignValueString(\"" +
sqlLoaderDefScheduleName.getName() + "\", \"" +
attributeAssign.getAttributeValueDelegate().retrieveValueString(sqlLoaderDefScheduleName.getName()) + "\");\n"); }
attributeAssigns =
GrouperDAOFactory.getFactory().getAttributeAssign().findAttributeAssignments(AttributeAssignType.group,
null, ldapLoaderDefName.getId(), null, null, null, null, null, true, false);
for (AttributeAssign attributeAssign : attributeAssigns) {result.append("group = GroupFinder.findByName(grouperSession, \"" +
attributeAssign.getOwnerGroup().getName() + "\");\nattributeAssignOnAssign = group.getAttributeDelegate().retrieveAssignment(null,
ldapLoaderDefName, false, false);\nattributeAssignOnAssign.getAttributeValueDelegate().assignValueString(\"" +
ldapLoaderDefScheduleName.getName() + "\", \"" +
attributeAssign.getAttributeValueDelegate().retrieveValueString(ldapLoaderDefScheduleName.getName()) + "\");\n"); }
result.append("\n\n############ DISABLE ALL SCHEDULES, BOUNCE GROUPER DAEMONS
AFTERWARDS #############\n\ngrouperSession =
GrouperSession.startRootSession();\n");
result.append("sqlLoaderDefName =
AttributeDefNameFinder.findByName(\"etc:legacy:attribute:legacyGroupType_grouperLoader\",
true);\n");
result.append("sqlLoaderDefScheduleName =
AttributeDefNameFinder.findByName(\"etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron\",
true);\n");
result.append("ldapLoaderDefName =
AttributeDefNameFinder.findByName(\"etc:attribute:loaderLdap:grouperLoaderLdap\",
true);\n");
result.append("ldapLoaderDefScheduleName =
AttributeDefNameFinder.findByName(\"etc:attribute:loaderLdap:grouperLoaderLdapQuartzCron\",
true);\n");
attributeAssigns =
GrouperDAOFactory.getFactory().getAttributeAssign().findAttributeAssignments(AttributeAssignType.group,
null, sqlLoaderDefName.getId(), null, null, null, null, null, true, false);
for (AttributeAssign attributeAssign : attributeAssigns) {result.append("group = GroupFinder.findByName(grouperSession,
\"" + attributeAssign.getOwnerGroup().getName() + "\");\nattributeAssignOnAssign =
group.getAttributeDelegate().retrieveAssignment(null, sqlLoaderDefName, false,
false);\nattributeAssignOnAssign.getAttributeValueDelegate().assignValueString(\"" + sqlLoaderDefScheduleName.getName() +
"\", \"0 0 0 1 1 ? 3000\");\n"); }
attributeAssigns =
GrouperDAOFactory.getFactory().getAttributeAssign().findAttributeAssignments(AttributeAssignType.group,
null, ldapLoaderDefName.getId(), null, null, null, null, null, true, false);
for (AttributeAssign attributeAssign : attributeAssigns) {result.append("group = GroupFinder.findByName(grouperSession,
\"" + attributeAssign.getOwnerGroup().getName() + "\");\nattributeAssignOnAssign =
group.getAttributeDelegate().retrieveAssignment(null, ldapLoaderDefName, false,
false);\nattributeAssignOnAssign.getAttributeValueDelegate().assignValueString(\"" + ldapLoaderDefScheduleName.getName() +
"\", \"0 0 0 1 1 ? 3000\");\n"); }
System.out.println(result);

################## It will generate something like this

[appadmin@i2midev6 bin]$ ./gsh disableLoaders.gsh

############ RESTORE OLD SCHEDULES, BOUNCE GROUPER DAEMONS AFTERWARDS
#############

grouperSession = GrouperSession.startRootSession();
sqlLoaderDefName =
AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyGroupType_grouperLoader",
true);
sqlLoaderDefScheduleName =
AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron",
true);
ldapLoaderDefName =
AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoaderLdap",
true);
ldapLoaderDefScheduleName =
AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoaderLdapQuartzCron",
true);
group = GroupFinder.findByName(grouperSession,
"nyu_apereo:presenter:allStevens3");
attributeAssignOnAssign =
group.getAttributeDelegate().retrieveAssignment(null, sqlLoaderDefName,
false, false);
attributeAssignOnAssign.getAttributeValueDelegate().assignValueString("etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron",
"0 0 * * * ?");
group = GroupFinder.findByName(grouperSession,
"test:loader:testLdapGroupList");
attributeAssignOnAssign =
group.getAttributeDelegate().retrieveAssignment(null, ldapLoaderDefName,
false, false);
attributeAssignOnAssign.getAttributeValueDelegate().assignValueString("etc:attribute:loaderLdap:grouperLoaderLdapQuartzCron",
"0 0 * * * ?");


############ DISABLE ALL SCHEDULES, BOUNCE GROUPER DAEMONS AFTERWARDS
#############

grouperSession = GrouperSession.startRootSession();
sqlLoaderDefName =
AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyGroupType_grouperLoader",
true);
sqlLoaderDefScheduleName =
AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron",
true);
ldapLoaderDefName =
AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoaderLdap",
true);
ldapLoaderDefScheduleName =
AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoaderLdapQuartzCron",
true);
group = GroupFinder.findByName(grouperSession,
"nyu_apereo:presenter:allStevens3");
attributeAssignOnAssign =
group.getAttributeDelegate().retrieveAssignment(null, sqlLoaderDefName,
false, false);
attributeAssignOnAssign.getAttributeValueDelegate().assignValueString("etc:legacy:attribute:legacyAttribute_grouperLoaderQuartzCron",
"0 0 0 1 1 ? 3000");
group = GroupFinder.findByName(grouperSession,
"test:loader:testLdapGroupList");
attributeAssignOnAssign =
group.getAttributeDelegate().retrieveAssignment(null, ldapLoaderDefName,
false, false);
attributeAssignOnAssign.getAttributeValueDelegate().assignValueString("etc:attribute:loaderLdap:grouperLoaderLdapQuartzCron",
"0 0 0 1 1 ? 3000");

-----Original Message-----
From:


[mailto:]
On Behalf Of Andrew Morgan
Sent: Wednesday, April 18, 2018 6:57 PM
To:

Subject: [grouper-users] Disable loader jobs

Is there an easy way to disable loader jobs?

Our Banner team is going to re-stage tables in our ODS this weekend, and
these tables drive views for many Grouper loader jobs. For safety, I want
to disable the loader jobs while this is happening. However, I need other
Grouper changes to continue to be processed, such as updates out to AD and
LDAP from the PSP (changelog consumers).

I know I can modify the cron schedule for each loader job, but that gets a
little tedious to do through the UI for 40 or so loader jobs.

Is there any GSH to list all loader jobs? A GSH way to dump the existing
schedule to the screen and set the schedule to a new value?

Thanks!

Andy Morgan
Systems Administrator, Identity & Access Management
Information Services | Oregon State University
541-737-8877 | is.oregonstate.edu




Archive powered by MHonArc 2.6.19.

Top of Page