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: "Black, Carey M." <>
  • To: Andrew Morgan <>, "" <>
  • Subject: RE: [grouper-users] Disable loader jobs
  • Date: Fri, 20 Apr 2018 18:59:48 +0000
  • Accept-language: en-US
  • Authentication-results: spf=pass (sender IP is 128.146.138.9) smtp.mailfrom=osu.edu; internet2.edu; dkim=none (message not signed) header.d=none;internet2.edu; dmarc=pass action=none header.from=osu.edu;
  • Ironport-phdr: 9a23:XF4D+hKcJBbl5/G5VNmcpTZWNBhigK39O0sv0rFitYgXKvj8rarrMEGX3/hxlliBBdydt6ofzbKO+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1Ov71GonPhMiryuy+4ZLebxlGiTanfb9+MAi9oBnMuMURnYZsMLs6xAHTontPdeRWxGdoKkyWkh3h+Mq+/4Nt/jpJtf45+MFOTav1f6IjTbxFFzsmKHw65NfqtRbYUwSC4GYXX3gMnRpJBwjF6wz6Xov0vyDnuOdxxDWWMMvrRr0vRz+s87lkRwPpiCcfNj427mfXitBrjKlGpB6tvgFzz5LIbI2QMvd1Y6HTcs4ARWdZXshfSTFPAp+yYYUMAeoOP+dYoJXyqVQBtha+GRCsCefzxjNUmnP6w6s32PkhHwHc2wwgGsoDvHrJodXxLqgdTeO1wLHVxjjddfxWwyny6YjVeR4mu/2AU697fM3KxkkrDQzKklaQpZb4Mz+L2OkAqG+b7/F9Ve61lWEothxxryGpy8wxhIfJgYcVxUrF9SV/2Is1JNu4SFJlbt6+FptfqT2aO5VsTsw8Xm5opSA3waAFt56jZCUG1o4oywLCZ/GCboSE/w/vWeOfITp3mH5pZLeyhxis/kWvy+DxU8y53VREoyZYitXAq24B2h/J5sSaRfZw/12t1DKA2gzJ9+1JLlw4mbLVK5E/wbM8ip8evEHDEyDqhEr2gqqbelsr9+Wp9uvqZ7rrq5+eOoJ6jwzxLr8hldelDuk+LwMARXKU+f6m273m5UD5QKtFjvkxkqTBqJ7XOcMVqrKnDwNMz4st7QizAy6h0NsDg3YLNlVFeA+bj4fyPFHOPfb4Auqlj1S0ijdrwOzGMaP9DZXRL3jDl7Hhcax6605B1Aozyddf55VXCr0bPP3zXUrxuMTZDh8/LQO03/7qBMtn2Y8CRG6CB7KVPL7PvVKN6OIiLPWAaJMQtTbzNfco6P/jgHo8lFIfc6SlwIMbaHWiEfRnJ0WZb2DsgtAEEWoSpQU+SPblh0GBUTJJenq+Qawx6yo8CIK9EIfPXJ6ij6Gc3CujBJ1ZenhGCkyQEXfvb4iEVO0MaCWPIs95jDMET6GtS5I61R6wrg/60KFqLu7V+i0DqZLjz8Z56/fSlRE06Tx7Ed6d02eTQGFogG8EXSE5071ioR819lDW+K50mfFHXflU/fxAVE9uMJnGwOV8I9foQR6Hc9uUHhLuCNq8BiwpQ8h03sQDeV1VGtO+gwrF0jbwRbIZivbDUJMu9b/E0mK0Ot1w0W3u1a89gkMgT9cVc2Cqm/gs2RLUAtuDuUGQnKXuPY8VxiPcvELFhyLatkVRWw02CP+edXcEew3bocmvtRCKdKOnFblyalgJ8sWFMKYfL4Sx1Vg=
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

Change this line;

StringBuilder result = new StringBuilder();

--> to -->
result = new StringBuilder();

--
Carey Matthew



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


<>
On Behalf Of Andrew Morgan
Sent: Friday, April 20, 2018 2:54 PM
To: Hyzer, Chris
<>
Cc:

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

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:legacyGroupTyp
> e_grouperLoader", true); sqlLoaderDefScheduleName =
> AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyAttribut
> e_grouperLoaderQuartzCron", true); ldapLoaderDefName =
> AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoa
> derLdap", true); ldapLoaderDefScheduleName =
> AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoa
> derLdapQuartzCron", 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:legacyGroupTy
> pe_grouperLoader\", true);\n");
> result.append("sqlLoaderDefScheduleName =
> AttributeDefNameFinder.findByName(\"etc:legacy:attribute:legacyAttribu
> te_grouperLoaderQuartzCron\", true);\n");
> result.append("ldapLoaderDefName =
> AttributeDefNameFinder.findByName(\"etc:attribute:loaderLdap:grouperLo
> aderLdap\", true);\n"); result.append("ldapLoaderDefScheduleName =
> AttributeDefNameFinder.findByName(\"etc:attribute:loaderLdap:grouperLo
> aderLdapQuartzCron\", true);\n"); attributeAssigns =
> GrouperDAOFactory.getFactory().getAttributeAssign().findAttributeAssig
> nments(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().assignVal
> ueString(\"" + sqlLoaderDefScheduleName.getName() + "\", \"" +
> attributeAssign.getAttributeValueDelegate().retrieveValueString(sqlLoa
> derDefScheduleName.getName()) + "\");\n"); } attributeAssigns =
> GrouperDAOFactory.getFactory().getAttributeAssign().findAttributeAssig
> nments(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().assignVal
> ueString(\"" + ldapLoaderDefScheduleName.getName() + "\", \"" +
> attributeAssign.getAttributeValueDelegate().retrieveValueString(ldapLo
> aderDefScheduleName.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:legacyGroupTy
> pe_grouperLoader\", true);\n");
> result.append("sqlLoaderDefScheduleName =
> AttributeDefNameFinder.findByName(\"etc:legacy:attribute:legacyAttribu
> te_grouperLoaderQuartzCron\", true);\n");
> result.append("ldapLoaderDefName =
> AttributeDefNameFinder.findByName(\"etc:attribute:loaderLdap:grouperLo
> aderLdap\", true);\n"); result.append("ldapLoaderDefScheduleName =
> AttributeDefNameFinder.findByName(\"etc:attribute:loaderLdap:grouperLo
> aderLdapQuartzCron\", true);\n"); attributeAssigns =
> GrouperDAOFactory.getFactory().getAttributeAssign().findAttributeAssig
> nments(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().assignVal
> ueString(\"" + sqlLoaderDefScheduleName.getName() + "\", \"0 0 0 1 1 ?
> 3000\");\n"); } attributeAssigns =
> GrouperDAOFactory.getFactory().getAttributeAssign().findAttributeAssig
> nments(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().assignVal
> ueString(\"" + 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:legacyGroupTyp
> e_grouperLoader", true); sqlLoaderDefScheduleName =
> AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyAttribut
> e_grouperLoaderQuartzCron", true); ldapLoaderDefName =
> AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoa
> derLdap", true); ldapLoaderDefScheduleName =
> AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoa
> derLdapQuartzCron", 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:legacyGroupTyp
> e_grouperLoader", true); sqlLoaderDefScheduleName =
> AttributeDefNameFinder.findByName("etc:legacy:attribute:legacyAttribut
> e_grouperLoaderQuartzCron", true); ldapLoaderDefName =
> AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoa
> derLdap", true); ldapLoaderDefScheduleName =
> AttributeDefNameFinder.findByName("etc:attribute:loaderLdap:grouperLoa
> derLdapQuartzCron", 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