grouper-users - Re: [grouper-users] Disable loader jobs
Subject: Grouper Users - Open Discussion List
List archive
- From: Shilen Patel <>
- To: Andrew Morgan <>, "Hyzer, Chris" <>
- Cc: "" <>
- Subject: Re: [grouper-users] Disable loader jobs
- Date: Fri, 20 Apr 2018 19:00:29 +0000
- Accept-language: en-US
- Authentication-results: oit.duke.edu; spf=none
- Authentication-results: orst.edu; dkim=none (message not signed) header.d=none;orst.edu; dmarc=none action=none header.from=duke.edu;
- Ironport-phdr: 9a23:qrIFIREVTu9dN8outiyS951GYnF86YWxBRYc798ds5kLTJ76p8+7bnLW6fgltlLVR4KTs6sC17KN9fi4EUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRpOOv1BpTSj8Oq3Oyu5pHfeQpFiCazbL9oMBm6sRjau9ULj4dlNqs/0AbCrGFSe+RRy2NoJFaTkAj568yt4pNt8Dletuw4+cJYXqr0Y6o3TbpDDDQ7KG81/9HktQPCTQSU+HQRVHgdnwdSDAjE6BH6WYrxsjf/u+Fg1iSWIdH6QLYpUjm58axlVAHnhzsGNz4h8WHYlMpwjL5AoBm8oxBz2pPYbJ2JOPZ7eK7WYNEUSndbXstJVyJPHJ6yb5cBAeQCM+ZXrYfyp1oSohSxHgSjHv/jyjpSi3Pqx6A30eIsGhzG0gw6GNIOtWzZosj1NKcTVeC60q/IxijZYfxMxTfy9ozIeQ0mrPGXXbJwcM7RxlcpFw7ek1qQtI/lMC2P2usTrmeb8vNtWOSygGAprAFxpyKgxsYqioTRiYIV0EjE+TxnzIkoONG1SkB2bN+8HJtRsSGaK5V5QtkkQ252pCY21KcKtoCmcygX0Jgn3wTfa/uAc4iG+hLjU+eRITFkhH5/ZL2/gBOy/VC+yu39SMa13k5KoTBKktbSrHwCzQDc6tSGSvt6+EetwDiC1w7L6u5eLkA7i6vbJIM4zrM+i5UfrEvOEy/rlEj0j6KbdkEp9+614OrkerXrvoKQOo9qhg3kPKkigNGzDOc8PwQUQWSW9uqx2KX+8UD5XrlGlPM7nrPXvZ3VP8gWqLa1AwFL3Ysg9xqyCjKr38gGknUZKV9IfBGKj4byNFzLJP31AuqzjlCpnTpoyf3LOqfuD5PQJXbZirjhZ6xy60tExQoz099f45VUB6kEIP3pW0/xsMXUDhA3MgCt3urqCs9x1oQfWWKTGKOWLb7SsVyW6e41PeaDeZIVtC78K/gj+fHukWc0lUIdcKW3x5caZmq0EullLkide3bgnNgMHGkSsgo7VuPqiVmCUTBJZ3a1WqIx/io7CIKnDYfHWI+thqeM0zqmHp1VeG9KEE6DHmr1d4mcQfcDdDqSItN9kjwDTbWhRJUh1RaztA/i1bVnNPPY+jADtZ39zth1/PbelRUz9TxvE8SdyH+BQ3t1nmMOWz85wrp/oUpjxVefz6R0meJXGsFO56ABbgBvHJjQ1eFlQ/X1QA3IeJ/dTVG8TdygKTYrVc53ztMTNQI1UfWznB3Zm2KBA6UUjPbDUJk/8rPO0mLZJt12jWve2a8nyVQqX50cG3ehg/tE9wnXCoiBq0yFmqLiIb8c3SrA8k+P0GmD+kxUTVgjAu3+QXkDax6O/pzC7UTYQurrUOx/Pw==
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
I believe this was fixed in patch #83 (https://bugs.internet2.edu/jira/browse/GRP-1625) which was a fix to allow typed variables. The alternative is to not use typed variables. E.g. groovy:000> result = new StringBuilder(); ===> groovy:000> result.append("test\n"); ===> test groovy:000> - Shilen On 4/20/18, 2:54 PM, " on behalf of Andrew Morgan" < on behalf of > wrote: 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://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.internet2.edu_jira_browse_GRP-2D1736&d=DwIBAg&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=sWqutME58phurE0oO57Icg&m=YmHmbkW-etIgvJs0SGL6QADaLAubmsTZmXNM3_FQ8XE&s=eeLEMAnlfHemMo_0GmUlrawWDV2g5Uw-74rjV83EHmI&e= > > Thanks Chad and Carl for your responses. I made a GSH which generates GSH for this and put it on the wiki: > > https://urldefense.proofpoint.com/v2/url?u=https-3A__spaces.internet2.edu_pages_viewpage.action-3FpageId-3D14517859&d=DwIBAg&c=imBPVzF25OnBgGmVOlcsiEgHoG1i6YHLR0Sj_gZ4adc&r=sWqutME58phurE0oO57Icg&m=YmHmbkW-etIgvJs0SGL6QADaLAubmsTZmXNM3_FQ8XE&s=Kka5R-qMeKGewAe7adZpby-V-iUrn2nqTSDapVIK6gk&e= > > ###################### 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 > |
- [grouper-users] Disable loader jobs, Andrew Morgan, 04/18/2018
- RE: [grouper-users] Disable loader jobs, Redman, Chad, 04/19/2018
- Re: [grouper-users] Disable loader jobs, Carl Waldbieser, 04/19/2018
- RE: [grouper-users] Disable loader jobs, Hyzer, Chris, 04/20/2018
- RE: [grouper-users] Disable loader jobs, Andrew Morgan, 04/20/2018
- RE: [grouper-users] Disable loader jobs, Black, Carey M., 04/20/2018
- Re: [grouper-users] Disable loader jobs, Shilen Patel, 04/20/2018
- RE: [grouper-users] Disable loader jobs, Hyzer, Chris, 04/20/2018
- RE: [grouper-users] Disable loader jobs, Andrew Morgan, 04/20/2018
- RE: [grouper-users] Disable loader jobs, Hyzer, Chris, 04/20/2018
- RE: [grouper-users] Disable loader jobs, Andrew Morgan, 04/20/2018
Archive powered by MHonArc 2.6.19.