Date: Thu, 28 Mar 2024 16:47:28 +0000 (UTC) Message-ID: <1219656184.6664.1711644448465@ip-10-10-7-29.ec2.internal> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_6663_175844516.1711644448463" ------=_Part_6663_175844516.1711644448463 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The Grouper-loader daemon is not absolutely required for running Grouper= , but you will benefit greatly if you do run it all the time. The benefits = include:
Grouper-loader is also required if you will be loading groups from an ex= ternal database (covered later), or using change log clients. It can be run= in an interactive session using :
Linux: Note, on linux, you will run this in the background as a lon= g running process:
nohup G= ROUPER_HOME/bin/gsh.sh -loader &
Windows:
GROUPER= _HOME/bin/gsh.bat -loader (windows)
Its is not always convenient to keep the loader running in an interactiv= e session, as the session may be ended on an event such as a logout. Using = something like GNU screen on Linux makes it easier to maintain a persistent= session, but it is better to run it as daemon started at boot (for linux),= or as a windows service (for windows). Fortunately this is a straightforwa= rd task using JavaWrapper from http://wrapper.tanukisoftware.com
See this wiki f= or linux
Download the correct vers= ion for your system <= a class=3D"external-link" href=3D"http://wrapper.tanukisoftware.com/doc/eng= lish/download.jsp">http://wrapper.tanukisoftware.com/doc/english/download.j= sp - I'll be usin= g the community edition version 3.5.6 for the example here. The standard an= d professional editions have additional features, such as monitoring the ru= nning java process, but the community edition is enough for our purposes. T= his is available for numerous operating systems, but not for 64bith Windows= , which is only available in the standard and professional editions.=
Extract the contents of t= he archive you downloaded. I prefer to keep it separate from my grouper ins= tallation as far as possible, and I normally put it alongside grouper. On L= inux if my GROUPER_HOME on linux is /usr/local/grouper/grouper.api-1.6.2, I= would put the wrapper files in /usr/local/grouper.api-1.6.2/wrapper-linux-= x86-64-3.5.6. On windows I would put it in c:\program files\grouper.api-1.6= .2\wrapper-windows-x86-64-3.5.6. I will refer to this as WRAPPER_HOME.
Here is the user-editable= section of a sample configuration file required for Linux which sits in th= e WRAPPER_HOME/bin directory, called grouper. It stops at the before the li= ne "# Do not modify anything beyond this point ". The remainder of the file= content is required, but not included here. This file is the init script f= or a linux system:
#! /bin= /sh # # Copyright (c) 1999, 2010 Tanuki Software, Ltd. # http://www.tanukisoftware.com # All rights reserved. # # This software is the proprietary information of Tanuki Software. # You shall use it only in accordance with the terms of the # license agreement you entered into with Tanuki Software. # http://wrapper.tanukisoftware.com/doc/english/licenseOverview.html # # Java Service Wrapper sh script. Suitable for starting and stopping # wrapped Java applications on UNIX platforms. # #--------------------------------------------------------------------------= --- # These settings can be modified to fit the needs of your application # Optimized for use with version 3.5.6 of the Wrapper. # Application APP_NAME=3D"grouper" APP_LONG_NAME=3D"Grouper" # Wrapper WRAPPER_CMD=3D"/usr/local/grouper/wrapper-linux-x86-32-3.5.6/bin/wrapper" WRAPPER_CONF=3D"/usr/local/grouper/wrapper-linux-x86-32-3.5.6/conf/grouper.= conf" # Priority at which to run the wrapper. See "man nice" for valid prioritie= s. # nice is only used if a priority is specified. PRIORITY=3D # Location of the pid file. PIDDIR=3D"/usr/local/grouper/wrapper-linux-x86-32-3.5.6/bin/" # FIXED_COMMAND tells the script to use a hard coded action rather than # expecting the first parameter of the command line to be the command. # By default the command will will be expected to be the first parameter. #FIXED_COMMAND=3Dconsole # PASS_THROUGH tells the script to pass all arguments through to the JVM # as is. If FIXED_COMMAND is specified then all arguments will be passed. # If not set then all arguments starting with the second will be passed. #PASS_THROUGH=3Dtrue # If uncommented, causes the Wrapper to be shutdown using an anchor file. # When launched with the 'start' command, it will also ignore all INT and # TERM signals. #IGNORE_SIGNALS=3Dtrue # Wrapper will start the JVM asynchronously. Your application may have some # initialization tasks and it may be desirable to wait a few seconds # before returning. For example, to delay the invocation of following # startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will # cause the start command to delay for the indicated period of time # (in seconds). # WAIT_AFTER_STARTUP=3D0 # If set, wait for the wrapper to report that the daemon has started WAIT_FOR_STARTED_STATUS=3Dtrue WAIT_FOR_STARTED_TIMEOUT=3D120 # If set, the status, start_msg and stop_msg commands will print out detail= ed # state information on the Wrapper and Java processes. #DETAIL_STATUS=3Dtrue # If set, the 'pause' and 'resume' commands will be enabled. These make it # possible to pause the JVM or Java application without completely stoppin= g # the Wrapper. See the wrapper.pausable and wrapper.pausable.stop_jvm # properties for more information. #PAUSABLE=3Dtrue # If specified, the Wrapper will be run as the specified user. # IMPORTANT - Make sure that the user has the required privileges to write # the PID file and wrapper.log files. Failure to be able to write the log # file will cause the Wrapper to exit without any way to write out an erro= r # message. # NOTE - This will set the user which is used to run the Wrapper as well as # the JVM and is not useful in situations where a privileged resource or # port needs to be allocated prior to the user being changed. RUN_AS_USER=3Dgrouper # By default we show a detailed usage block. Uncomment to show brief usage= . #BRIEF_USAGE=3Dtrue # When installing on On Mac OSX platforms, the following domain will be use= d to # prefix the plist file name. PLIST_DOMAIN=3Dorg.tanukisoftware.wrapper # The following two lines are used by the chkconfig command. Change as is # appropriate for your application. They should remain commented. # chkconfig: 2345 20 80 # description: Test Wrapper Sample Application # Initialization block for the install_initd and remove_initd scripts used = by # SUSE linux distributions. ### BEGIN INIT INFO # Provides: testwrapper # Required-Start: $local_fs $network $syslog # Should-Start: # Required-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Grouper # Description: Grouper loader daemon ### END INIT INFO
The variables "WRAPPER_CO= MMAND" and "WRAPPER_CONF" contain the full paths to files in my installatio= n. WRAPPER command points to an executable file included in the wrapper dis= tribution. WRAPPER_CONF points to a config file for loading Grouper. I set = Grouper to start as user grouper with the line "RUN_AS_USER=3Dgrouper". Thi= s user needs rights in the grouper directory, the wrapper directory and to = run java. On a standard distribution you won't need to do anything for Java= , but will need to change the owner of GROUPER_HOME, WRAPPER_HOME and all t= heir sub-directories:
chown -= r grouper $GROUPER_HOME chown -r grouper $WRAPPER_HOME
For testing, you may pref=
er simply to run as root, which you can do by simply commenting out the
"RUN_AS_USER=3Dgroupe=
r" line.
Here is a sample configuration file for the grouper application, which s= its in WRAPPER_HOME/conf and is called grouper.conf. It is referenced in th= e WRAPPER_HOME/bin/grouper file as GROUPER_CONF. Please note that GROUPER_H= OME, WRAPPER_HOME and JAVA_HOME are defined as a system variables in both t= he Linux and Windows versions.
# Inclu= de file problems can be debugged by removing the first '#' # from the following line: ##include.debug #******************************************************************** # Wrapper Localization #******************************************************************** # Specify the locale which the Wrapper should use. By default the system # locale is used. #wrapper.lang=3Den_US # en_US or ja_JP # Specify the location of the Wrapper's language resources. If these are # missing, the Wrapper will default to the en_US locale. wrapper.lang.folder=3D../lang #******************************************************************** # Wrapper Java Properties #******************************************************************** # Java Application # Locate the java binary on the system PATH: wrapper.java.command=3D$JAVA_HOME/bin/java # Tell the Wrapper to log the full generated Java command line. wrapper.java.command.loglevel=3DINFO # Java Main class. This class must implement the WrapperListener interface # or guarantee that the WrapperManager class is initialized. Helper # classes are provided to do this for you. See the Integration section # of the documentation for details. wrapper.java.mainclass=3Dorg.tanukisoftware.wrapper.WrapperSimpleApp # Java Classpath (include wrapper.jar) Add class path elements as # needed starting from 1 wrapper.java.classpath.1=3D$GROUPER_HOME/lib/wrapperdemo.jar wrapper.java.classpath.2=3D$WRAPPER_HOME/lib/* wrapper.java.classpath.3=3D$GROUPER_HOME/lib/grouper/* wrapper.java.classpath.4=3D$GROUPER_HOME/lib/jdbcSamples/* wrapper.java.classpath.5=3D$GROUPER_HOME1/lib/custom/* wrapper.java.classpath.6=3D$GROUPER_HOME/lib/ant/* wrapper.java.classpath.7=3D$GROUPER_HOME/dist/lib/* # this is the path to the grouper config files wrapper.java.classpath.8=3D$GROUPER_HOME/conf/ # Java Library Path (location of Wrapper.DLL or libwrapper.so) wrapper.java.library.path.1=3D$WRAPPER_HOME/lib # Java Bits. On applicable platforms, tells the JVM to run in 32 or 64-bit= mode. wrapper.java.additional.auto_bits=3DTRUE # Java Additional Parameters wrapper.java.additional.1=3D # Initial Java Heap Size (in MB) #wrapper.java.initmemory=3D3 # Maximum Java Heap Size (in MB) #wrapper.java.maxmemory=3D64 # Application parameters. Add parameters as needed starting from 1 # This line tells java wrapper to start the GrouperLoader class using the m= ain method wrapper.app.parameter.1=3Dedu.internet2.middleware.grouper.app.loader.Group= erLoader #******************************************************************** # Wrapper Logging Properties #******************************************************************** # Enables Debug output from the Wrapper. # wrapper.debug=3DTRUE # Format of output for the console. (See docs for formats) wrapper.console.format=3DPM # Log Level for console output. (See docs for log levels) wrapper.console.loglevel=3DINFO # Log file to use for wrapper output logging. wrapper.logfile=3D$GROUPER_HOME/wrapper.log # Format of output for the log file. (See docs for formats) wrapper.logfile.format=3DLPTM # Log Level for log file output. (See docs for log levels) wrapper.logfile.loglevel=3DINFO # Maximum size that the log file will be allowed to grow to before # the log is rolled. Size is specified in bytes. The default value # of 0, disables log rolling. May abbreviate with the 'k' (kb) or # 'm' (mb) suffix. For example: 10m =3D 10 megabytes. wrapper.logfile.maxsize=3D10m # Maximum number of rolled log files which will be allowed before old # files are deleted. The default value of 0 implies no limit. wrapper.logfile.maxfiles=3D10 # Log Level for sys/event log output. (See docs for log levels) wrapper.syslog.loglevel=3DNONE #******************************************************************** # Wrapper General Properties #******************************************************************** # Allow for the use of non-contiguous numbered properties wrapper.ignore_sequence_gaps=3DTRUE # Title to use when running as a console wrapper.console.title=3DGrouper #******************************************************************** # Wrapper JVM Checks #******************************************************************** # Detect DeadLocked Threads in the JVM. (Requires Standard Edition) wrapper.check.deadlock=3DTRUE wrapper.check.deadlock.interval=3D10 wrapper.max_failed_invocations=3D99 wrapper.console.fatal_to_stderr=3DFALSE wrapper.console.error_to_stderr=3DFALSE wrapper.check.deadlock.action=3DRESTART wrapper.check.deadlock.output=3DFULL # Out Of Memory detection. # (Simple match) wrapper.filter.trigger.1000=3Djava.lang.OutOfMemoryError # (Only match text in stack traces if -XX:+PrintClassHistogram is being use= d.) #wrapper.filter.trigger.1000=3DException in thread "*" java.lang.OutOfMemor= yError #wrapper.filter.allow_wildcards.1000=3DTRUE wrapper.filter.action.1000=3DRESTART wrapper.filter.message.1000=3DThe JVM has run out of memory.
On Windows no startup script is required, only a configuration file is n= eeded. I call it grouper.conf and put it in WRAPPER_HOME/conf.
# Inclu= de file problems can be debugged by removing the first '#' # from the following line: ##include.debug #******************************************************************** # Wrapper Localization #******************************************************************** # Specify the locale which the Wrapper should use. By default the system # locale is used. #wrapper.lang=3Den_US # en_US or ja_JP # Specify the location of the Wrapper's language resources. If these are # missing, the Wrapper will default to the en_US locale. wrapper.lang.folder=3D../lang #******************************************************************** # Wrapper Java Properties #******************************************************************** # Java Application # Locate the java binary on the system PATH: wrapper.java.command=3D%JAVA_HOME%\bin\java # Tell the Wrapper to log the full generated Java command line. wrapper.java.command.loglevel=3DINFO # Java Main class. This class must implement the WrapperListener interface # or guarantee that the WrapperManager class is initialized. Helper # classes are provided to do this for you. See the Integration section # of the documentation for details. wrapper.java.mainclass=3Dorg.tanukisoftware.wrapper.WrapperSimpleApp # Java Classpath (include wrapper.jar) Add class path elements as # needed starting from 1 wrapper.java.classpath.1=3D%GROUPER_HOME%\lib\wrapperdemo.jar wrapper.java.classpath.2=3D%WRAPPER_HOME%\lib\* wrapper.java.classpath.3=3D%GROUPER_HOME%\lib\grouper\* wrapper.java.classpath.4=3D%GROUPER_HOME%\lib\jdbcSamples\* wrapper.java.classpath.5=3D%GROUPER_HOME%\lib\custom\* wrapper.java.classpath.6=3D%GROUPER_HOME%\lib\ant\* wrapper.java.classpath.7=3D%GROUPER_HOME%\dist\lib\* # this is the path to the grouper config files wrapper.java.classpath.8=3D%GROUPER_HOME%\conf\ # Java Library Path (location of Wrapper.DLL or libwrapper.so) wrapper.java.library.path.1=3D%WRAPPER_HOME%\lib # Java Bits. On applicable platforms, tells the JVM to run in 32 or 64-bit= mode. wrapper.java.additional.auto_bits=3DTRUE # Java Additional Parameters wrapper.java.additional.1=3D # Initial Java Heap Size (in MB) #wrapper.java.initmemory=3D3 # Maximum Java Heap Size (in MB) #wrapper.java.maxmemory=3D64 # Application parameters. Add parameters as needed starting from 1 # This line tells java wrapper to start the GrouperLoader class using the m= ain method wrapper.app.parameter.1=3Dedu.internet2.middleware.grouper.app.loader.Group= erLoader #******************************************************************** # Wrapper Logging Properties #******************************************************************** # Enables Debug output from the Wrapper. # wrapper.debug=3DTRUE # Format of output for the console. (See docs for formats) wrapper.console.format=3DPM # Log Level for console output. (See docs for log levels) wrapper.console.loglevel=3DINFO # Log file to use for wrapper output logging. wrapper.logfile=3D%GROUPER_HOME%\wrapper.log # Format of output for the log file. (See docs for formats) wrapper.logfile.format=3DLPTM # Log Level for log file output. (See docs for log levels) wrapper.logfile.loglevel=3DINFO # Maximum size that the log file will be allowed to grow to before # the log is rolled. Size is specified in bytes. The default value # of 0, disables log rolling. May abbreviate with the 'k' (kb) or # 'm' (mb) suffix. For example: 10m =3D 10 megabytes. wrapper.logfile.maxsize=3D10m # Maximum number of rolled log files which will be allowed before old # files are deleted. The default value of 0 implies no limit. wrapper.logfile.maxfiles=3D10 # Log Level for sys/event log output. (See docs for log levels) wrapper.syslog.loglevel=3DNONE #******************************************************************** # Wrapper General Properties #******************************************************************** # Allow for the use of non-contiguous numbered properties wrapper.ignore_sequence_gaps=3DTRUE # Title to use when running as a console wrapper.console.title=3DGrouper #******************************************************************** # Wrapper JVM Checks #******************************************************************** # Detect DeadLocked Threads in the JVM. (Requires Standard Edition) wrapper.check.deadlock=3DTRUE wrapper.check.deadlock.interval=3D10 wrapper.max_failed_invocations=3D99 wrapper.console.fatal_to_stderr=3DFALSE wrapper.console.error_to_stderr=3DFALSE wrapper.check.deadlock.action=3DRESTART wrapper.check.deadlock.output=3DFULL # Out Of Memory detection. # (Simple match) wrapper.filter.trigger.1000=3Djava.lang.OutOfMemoryError # (Only match text in stack traces if -XX:+PrintClassHistogram is being use= d.) #wrapper.filter.trigger.1000=3DException in thread "*" java.lang.OutOfMemor= yError #wrapper.filter.allow_wildcards.1000=3DTRUE wrapper.filter.action.1000=3DRESTART wrapper.filter.message.1000=3DThe JVM has run out of memory.
It is a good idea to do an initial application start in an interactive c= ommand line session as then any errors will be printed out onto the screen:=
Linux:
WRAPPER= _HOME/bin/grouper console
Windows:
WRAPPER= _HOME\bin\wrapper.exe -c ..\conf\grouper.conf
Symlink the script so that the link exists in /etc/init.d/ with:
ln -s W= RAPPER_HOME/bin/grouper /etc/init.d/grouper
Alternatively you can copy the file to the /etc/init.d directory.
Next install it into your system startup with:
chkconf= ig -add grouper
.. and start it with:
/etc/in= it.d/grouper start
A single command installs the service:
WRAPPER= _HOME\bin\wrapper.exe -i ..\conf\grouper.conf
.. which you can then control as a service as normal.