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: Shilen Patel <>, "" <>
  • Subject: RE: [grouper-users] Disable loader jobs
  • Date: Fri, 20 Apr 2018 12:39:24 -0700 (PDT)
  • Ironport-phdr: 9a23:hzixMBdWmlt1hfN+BbS/KpkLlGMj4u6mDksu8pMizoh2WeGdxcW8YR7h7PlgxGXEQZ/co6odzbaO6Oa4ASQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTahb75+Ngm6oRnMvcQKnIVuLbo8xAHUqXVSYeRWwm1oJVOXnxni48q74YBu/SdNtf8/7sBMSar1cbg2QrxeFzQmLns65Nb3uhnZTAuA/WUTX2MLmRdVGQfF7RX6XpDssivms+d2xSeXMdHqQb0yRD+v9LlgRgP2hygbNj456GDXhdJ2jKJHuxKquhhzz5fJbI2JKPZye6XQds4YS2VcRMZcTyJPDIOiYYUSDeUPPuhYoIfyqFQStha+ABWgCP/1xzNUnHL736s32PkhHwHc2wwgGsoDvWjSrNroLqcdT+60x7TPwzXEdfNW1i3y6I7VeR0mpPGMWqhwccXLxkkpDA7FiU+QqZf5Pz+PyOsCrnWb4vNmWOmyhWAnrARxrSKuxscqkoTJiZgVykjd+Sln3Yk5ON+1RUB6bNK8EZtQsT2aOJVsQsMkXW5opDg2xqcYtpGmYSgG0IwnxwTYa/yAfYiI+hXjVOeXITdknn5qZLW/hxOq/Ui+y+3zSMe10E5QoSpKjNbArGoC2ADP6siGTft9+F6t1DiB1wDL8O5ELl47lavGJJI4zLM/i4cfvEvDEyPrmkj7j6+be0Ei9+O16Orneq3rqoKCO4J3kA3yL6Ajl8KlDek4KAQCQXaX9Oak2LH+40H0Q69GguAyn6TXqpzXKt4XqrO7DgNJ1Iso9gyxAC280NsCmHkKNFJFdwyDj4juI1zOO/X4Deung1i1jjdr3+zKMqD7DpXWL3jDn63tfbFn60FCxwozytZf54lICr4bPPL8RFX9u8LFAR8kKwC0wuDnB8th1o4GRG6DHKyUPLnPvVKM6O8jOemBaJULtDrjKfUp//vugmU4mV8Zc6mpx5wXaHWgE/RjJEWZe3Xsjc0HEWoRuQo+VvfqiEGYXTFNenmyQrow5isnB4K+EYfDWoetjaSO3CehGZ1We3hGBU6WEXvxaoWEQOkDaDiJIsJ6ljwEVKOhS5M61R2wrgP6yrxnLvbK9S0Cs5LsysR16/PJmR4s6DN0EpfV72bYBUFljG4SA3cd3Lp+ugY1nlKI0blqjuZwFMdYoe5RXwE8c5PQ0ropJcr1X1foeNuTRUnuZ9K8Djg3BoY0xMUBakBVHM+5klbO0zf8UOxdrKCCGJFhqvGU5HP2Pcsoji+ejKQ=

Ha, we are at patch #80 right now. Removing the type fixed it. :)

Thanks,
Andy


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

Sorry that script worked in legacy gsh… but with patch like shilen said
should work in new gsh… if you get it working let me know the script and I
can update the wiki

Thanks
Chris

From: Shilen Patel
[mailto:]
Sent: Friday, April 20, 2018 3:00 PM
To: Andrew Morgan
<>;
Hyzer, Chris
<>
Cc:

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


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<mailto:%20on%20behalf%20of%20Andrew%20Morgan>"

<
on behalf of
<mailto:%20on%20behalf%20of%>>
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:>

[mailto:]
On Behalf Of Andrew Morgan

> Sent: Wednesday, April 18, 2018 6:57 PM

> To:
<mailto:>

> 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