directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dran...@apache.org
Subject [12/12] directory-kerberos git commit: WIP: Rework KDC service wrapper & installation package
Date Sat, 14 Mar 2015 02:54:31 GMT
WIP: Rework KDC service wrapper & installation package


Project: http://git-wip-us.apache.org/repos/asf/directory-kerberos/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerberos/commit/097d43c4
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerberos/tree/097d43c4
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerberos/diff/097d43c4

Branch: refs/heads/master
Commit: 097d43c42a99e191528d2dc3ed5fa9cb18cb0877
Parents: f2846bc
Author: Drankye <drankye@gmail.com>
Authored: Sat Mar 14 10:35:43 2015 +0800
Committer: Drankye <drankye@gmail.com>
Committed: Sat Mar 14 10:35:43 2015 +0800

----------------------------------------------------------------------
 kdc-tool/kinit/kinit-dist/bin/kinit.sh          |   19 -
 kdc-tool/kinit/pom.xml                          |   31 +-
 kdc-tool/pom.xml                                |    1 +
 kerby-dist/kdc-dist/README.txt                  |   54 +
 kerby-dist/kdc-dist/bin/start-kdc.sh            |    2 +
 kerby-dist/kdc-dist/pom.xml                     |   36 +
 kerby-dist/kdc-dist/scripts/ReadMe.txt          |   34 +
 kerby-dist/kdc-dist/scripts/cluster.gv          |   22 +
 kerby-dist/kdc-dist/scripts/commandCondition.gv |  103 +
 kerby-dist/kdc-dist/scripts/decryptor.gv        |   20 +
 .../kdc-dist/scripts/equinox/equinoxShutdown.gv |    5 +
 kerby-dist/kdc-dist/scripts/groovy/ReadMe.txt   |    1 +
 .../kdc-dist/scripts/groovy/helloworld.gv       |   13 +
 .../kdc-dist/scripts/linearRestartDelay.gv      |   11 +
 kerby-dist/kdc-dist/scripts/mapNetworkDrive.gv  |   12 +
 kerby-dist/kdc-dist/scripts/maxDuration.gv      |   52 +
 kerby-dist/kdc-dist/scripts/maxStartup.gv       |   60 +
 kerby-dist/kdc-dist/scripts/nutch/ReadMe.txt    |    5 +
 kerby-dist/kdc-dist/scripts/nutch/nutch_base.gv |  187 +
 .../kdc-dist/scripts/nutch/nutch_crawl.gv       |    8 +
 .../kdc-dist/scripts/nutch/nutch_recrawl.gv     |  110 +
 kerby-dist/kdc-dist/scripts/nutch/nutch_solr.gv |   53 +
 kerby-dist/kdc-dist/scripts/sendMail.gv         |   84 +
 kerby-dist/kdc-dist/scripts/setenv.gv           |   42 +
 kerby-dist/kdc-dist/scripts/snmpTrap.gv         |   56 +
 kerby-dist/kdc-dist/scripts/threadDump.gv       |   13 +
 kerby-dist/kdc-dist/scripts/timeCondition.gv    |   82 +
 kerby-dist/kdc-dist/scripts/trayColor.gv        |   48 +
 kerby-dist/kdc-dist/scripts/trayMessage.gv      |   29 +
 .../kdc-dist/scripts/vfsCommandCondition.gv     |   99 +
 .../kdc-dist/scripts/wso2/wso2_shutdown.gv      |   13 +
 kerby-dist/pom.xml                              |   36 +
 kerby-dist/tool-dist/bin/kinit.sh               |    3 +
 kerby-dist/tool-dist/pom.xml                    |   36 +
 kerby-kdc/kerby-kdc-dist/LICENSE.txt            |  504 --
 kerby-kdc/kerby-kdc-dist/README.txt             |   54 -
 kerby-kdc/kerby-kdc-dist/bat/genConfig.bat      |    7 -
 kerby-kdc/kerby-kdc-dist/bat/installService.bat |    6 -
 kerby-kdc/kerby-kdc-dist/bat/queryService.bat   |    5 -
 kerby-kdc/kerby-kdc-dist/bat/runConsole.bat     |    4 -
 kerby-kdc/kerby-kdc-dist/bat/runConsoleW.bat    |    3 -
 kerby-kdc/kerby-kdc-dist/bat/runHelloWorld.bat  |    7 -
 .../bat/runServicesManagerClient.bat            |    2 -
 .../bat/runServicesManagerServer.bat            |    3 -
 kerby-kdc/kerby-kdc-dist/bat/setenv.bat         |   27 -
 kerby-kdc/kerby-kdc-dist/bat/startService.bat   |    6 -
 kerby-kdc/kerby-kdc-dist/bat/stopService.bat    |    6 -
 kerby-kdc/kerby-kdc-dist/bat/systemTrayIcon.bat |    6 -
 kerby-kdc/kerby-kdc-dist/bat/sytemTrayIconW.bat |    2 -
 .../kerby-kdc-dist/bat/uninstallService.bat     |    4 -
 kerby-kdc/kerby-kdc-dist/bat/wrapper.bat        |    3 -
 kerby-kdc/kerby-kdc-dist/bat/wrapperW.bat       |    1 -
 kerby-kdc/kerby-kdc-dist/bin/genConfig.sh       |   37 -
 kerby-kdc/kerby-kdc-dist/bin/installDaemon.sh   |   35 -
 .../kerby-kdc-dist/bin/installDaemonNoPriv.sh   |   35 -
 kerby-kdc/kerby-kdc-dist/bin/kerbykdc.sh        |   18 -
 kerby-kdc/kerby-kdc-dist/bin/queryDaemon.sh     |   37 -
 kerby-kdc/kerby-kdc-dist/bin/runConsole.sh      |   35 -
 kerby-kdc/kerby-kdc-dist/bin/runHelloWorld.sh   |   25 -
 kerby-kdc/kerby-kdc-dist/bin/setenv.sh          |   57 -
 kerby-kdc/kerby-kdc-dist/bin/startDaemon.sh     |   35 -
 .../kerby-kdc-dist/bin/startDaemonNoPriv.sh     |   35 -
 kerby-kdc/kerby-kdc-dist/bin/stopDaemon.sh      |   35 -
 .../kerby-kdc-dist/bin/stopDaemonNoPriv.sh      |   35 -
 kerby-kdc/kerby-kdc-dist/bin/systemTrayIcon.sh  |   35 -
 kerby-kdc/kerby-kdc-dist/bin/uninstallDaemon.sh |   37 -
 .../kerby-kdc-dist/bin/uninstallDaemonNoPriv.sh |   35 -
 kerby-kdc/kerby-kdc-dist/bin/wrapper.sh         |    7 -
 kerby-kdc/kerby-kdc-dist/build/MANIFEST.MF      |   50 -
 kerby-kdc/kerby-kdc-dist/build/ReadMe.txt       |   15 -
 .../build/abeille/ConsoleForm.xml               | 4527 ------------------
 .../kerby-kdc-dist/build/abeille/ReadMe.txt     |    4 -
 .../kerby-kdc-dist/build/abeille/WSForm.xml     | 1642 -------
 .../build/abeille/srvmgr_install_dialog.xml     |  771 ---
 .../build/abeille/srvmgr_newHostDialog.xml      |  725 ---
 .../abeille/srvmgr_reload_console_dialog.xml    |  734 ---
 .../build/abeille/srvmgr_uninstall_dialog.xml   |  508 --
 .../build/abeille/srvmgr_window.xml             | 1354 ------
 .../build/gradle/ahessian/build.gradle          |   18 -
 .../kerby-kdc-dist/build/gradle/build.gradle    |   70 -
 .../gradle/gradle/wrapper/gradle-wrapper.jar    |  Bin 12597 -> 0 bytes
 .../gradle/wrapper/gradle-wrapper.properties    |    7 -
 .../kerby-kdc-dist/build/gradle/gradlew.bat     |   87 -
 .../kerby-kdc-dist/build/gradle/gradlew.sh      |  168 -
 .../build/gradle/hessian4/build.gradle          |   16 -
 .../kerby-kdc-dist/build/gradle/readMe.txt      |   25 -
 .../kerby-kdc-dist/build/gradle/settings.gradle |    2 -
 .../build/gradle/srvmgr/build.gradle            |   32 -
 .../build/gradle/wrapper-app/build.gradle       |   38 -
 .../build/gradle/wrapper/build.gradle           |   54 -
 kerby-kdc/kerby-kdc-dist/build/ws/ReadMe.txt    |    4 -
 .../kerby-kdc-dist/build/ws/genKeyStore.bat     |    1 -
 kerby-kdc/kerby-kdc-dist/build/ws/jaxb.keys     |  Bin 1289 -> 0 bytes
 kerby-kdc/kerby-kdc-dist/build/ws/sign.bat      |    1 -
 kerby-kdc/kerby-kdc-dist/conf/wrapper.conf      |  308 --
 .../kerby-kdc-dist/conf/wrapper.javaws.conf     |    1 -
 kerby-kdc/kerby-kdc-dist/conf/wrapper.stop.conf |   24 -
 kerby-kdc/kerby-kdc-dist/lib/core/ReadMe.txt    |   23 -
 .../lib/core/commons/commons-cli-2-SNAPSHOT.jar |  Bin 702066 -> 0 bytes
 .../core/commons/commons-collections-3.2.jar    |  Bin 571259 -> 0 bytes
 .../core/commons/commons-configuration-1.8.jar  |  Bin 354491 -> 0 bytes
 .../lib/core/commons/commons-io-1.3.1.jar       |  Bin 83613 -> 0 bytes
 .../lib/core/commons/commons-lang-2.4.jar       |  Bin 261809 -> 0 bytes
 .../lib/core/commons/commons-logging-1.1.jar    |  Bin 52915 -> 0 bytes
 .../lib/core/commons/commons-vfs2-2.0.jar       |  Bin 415578 -> 0 bytes
 .../lib/core/groovy/groovy-all-1.8.6.jar        |  Bin 6167392 -> 0 bytes
 .../kerby-kdc-dist/lib/core/jna/jna-3.4.1.jar   |  Bin 1907070 -> 0 bytes
 .../lib/core/jna/platform-3.4.1.jar             |  Bin 916366 -> 0 bytes
 .../lib/core/netty/netty-3.6.6.Final.jar        |  Bin 1206119 -> 0 bytes
 .../lib/core/regex/jrexx-1.1.1.jar              |  Bin 100722 -> 0 bytes
 .../kerby-kdc-dist/lib/core/yajsw/ahessian.jar  |  Bin 226847 -> 0 bytes
 .../kerby-kdc-dist/lib/extended/ReadMe.txt      |   25 -
 .../lib/extended/abeille/formsrt.jar            |  Bin 454530 -> 0 bytes
 .../lib/extended/commons/commons-codec-1.3.jar  |  Bin 46725 -> 0 bytes
 .../commons/commons-httpclient-3.0.1.jar        |  Bin 279781 -> 0 bytes
 .../lib/extended/commons/commons-net-1.4.1.jar  |  Bin 180792 -> 0 bytes
 .../glazedlists/commons-beanutils-1.8.2.jar     |  Bin 231891 -> 0 bytes
 .../glazedlists/glazedlists-1.8.0_java15.jar    |  Bin 838393 -> 0 bytes
 .../lib/extended/jgoodies/forms-1.2.0.jar       |  Bin 108132 -> 0 bytes
 .../lib/extended/quartz/quartz-1.8.0.jar        |  Bin 444283 -> 0 bytes
 .../lib/extended/velocity/velocity-1.7.jar      |  Bin 449505 -> 0 bytes
 .../vfs-webdav/jackrabbit-webdav-1.5.6.jar      |  Bin 3378270 -> 0 bytes
 .../lib/extended/vfs-webdav/slf4j-api-1.5.0.jar |  Bin 16591 -> 0 bytes
 .../extended/vfs-webdav/slf4j-jdk14-1.5.0.jar   |  Bin 8641 -> 0 bytes
 .../lib/extended/vfs-webdav/xercesImpl.jar      |  Bin 1229289 -> 0 bytes
 .../lib/extended/yajsw/hessian4.jar             |  Bin 262007 -> 0 bytes
 .../lib/extended/yajsw/srvmgr.jar               |  Bin 85249 -> 0 bytes
 kerby-kdc/kerby-kdc-dist/lib/groovy/ReadMe.txt  |   11 -
 .../lib/groovy/joda/joda-time-1.6.jar           |  Bin 534827 -> 0 bytes
 .../lib/groovy/mail/activation.jar              |  Bin 56290 -> 0 bytes
 .../kerby-kdc-dist/lib/groovy/mail/mail.jar     |  Bin 371264 -> 0 bytes
 .../kerby-kdc-dist/lib/groovy/snmp/SNMP4J.jar   |  Bin 370448 -> 0 bytes
 kerby-kdc/kerby-kdc-dist/scripts/ReadMe.txt     |   34 -
 kerby-kdc/kerby-kdc-dist/scripts/cluster.gv     |   22 -
 .../kerby-kdc-dist/scripts/commandCondition.gv  |  103 -
 kerby-kdc/kerby-kdc-dist/scripts/decryptor.gv   |   20 -
 .../scripts/equinox/equinoxShutdown.gv          |    5 -
 .../kerby-kdc-dist/scripts/groovy/ReadMe.txt    |    1 -
 .../kerby-kdc-dist/scripts/groovy/helloworld.gv |   13 -
 .../scripts/linearRestartDelay.gv               |   11 -
 .../kerby-kdc-dist/scripts/mapNetworkDrive.gv   |   12 -
 kerby-kdc/kerby-kdc-dist/scripts/maxDuration.gv |   52 -
 kerby-kdc/kerby-kdc-dist/scripts/maxStartup.gv  |   60 -
 .../kerby-kdc-dist/scripts/nutch/ReadMe.txt     |    5 -
 .../kerby-kdc-dist/scripts/nutch/nutch_base.gv  |  187 -
 .../kerby-kdc-dist/scripts/nutch/nutch_crawl.gv |    8 -
 .../scripts/nutch/nutch_recrawl.gv              |  110 -
 .../kerby-kdc-dist/scripts/nutch/nutch_solr.gv  |   53 -
 kerby-kdc/kerby-kdc-dist/scripts/sendMail.gv    |   84 -
 kerby-kdc/kerby-kdc-dist/scripts/setenv.gv      |   42 -
 kerby-kdc/kerby-kdc-dist/scripts/snmpTrap.gv    |   56 -
 kerby-kdc/kerby-kdc-dist/scripts/threadDump.gv  |   13 -
 .../kerby-kdc-dist/scripts/timeCondition.gv     |   82 -
 kerby-kdc/kerby-kdc-dist/scripts/trayColor.gv   |   48 -
 kerby-kdc/kerby-kdc-dist/scripts/trayMessage.gv |   29 -
 .../scripts/vfsCommandCondition.gv              |   99 -
 .../scripts/wso2/wso2_shutdown.gv               |   13 -
 kerby-kdc/kerby-kdc-dist/templates/daemon.vm    |   67 -
 .../kerby-kdc-dist/templates/launchd.plist.vm   |   19 -
 kerby-kdc/kerby-kdc-dist/webapps/ReadMe.txt     |   24 -
 .../webapps/yajsw/serviceManagerClient.conf     |   10 -
 .../webapps/yajsw/serviceManagerClient.jnlp     |   28 -
 .../webapps/yajsw/serviceManagerServer.conf     |   31 -
 .../webapps/yajsw/serviceManagerServer.jnlp     |   28 -
 .../kerby-kdc-dist/webapps/yajsw/wrapper.conf   |   41 -
 .../kerby-kdc-dist/webapps/yajsw/wrapperWS.jar  |  Bin 62173 -> 0 bytes
 .../kerby-kdc-dist/webapps/yajsw/yajsw.jnlp     |   28 -
 kerby-kdc/kerby-kdc-dist/wrapper.jar            |  Bin 830979 -> 0 bytes
 kerby-kdc/kerby-kdc-dist/wrapperApp.jar         |  Bin 43989 -> 0 bytes
 kerby-kdc/kerby-kdc-dist/yajsw.policy.txt       |    4 -
 kerby-kdc/pom.xml                               |   29 -
 pom.xml                                         |    1 +
 172 files changed, 1332 insertions(+), 13948 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kdc-tool/kinit/kinit-dist/bin/kinit.sh
----------------------------------------------------------------------
diff --git a/kdc-tool/kinit/kinit-dist/bin/kinit.sh b/kdc-tool/kinit/kinit-dist/bin/kinit.sh
deleted file mode 100644
index ac0754a..0000000
--- a/kdc-tool/kinit/kinit-dist/bin/kinit.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-confdir=/etc/kerby/krb/conf
-java -jar ../kinit/kinit-1.0-SNAPSHOT-jar-with-dependencies.jar ${confdir} $@

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kdc-tool/kinit/pom.xml
----------------------------------------------------------------------
diff --git a/kdc-tool/kinit/pom.xml b/kdc-tool/kinit/pom.xml
index 97d806a..2c49764 100644
--- a/kdc-tool/kinit/pom.xml
+++ b/kdc-tool/kinit/pom.xml
@@ -45,34 +45,5 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <version>2.2</version>
-        <executions>
-          <execution>
-            <id>dist</id>
-            <phase>package</phase>
-            <goals>
-              <goal>single</goal>
-            </goals>
-            <configuration>
-              <archive>
-                <manifest>
-                  <mainClass>org.apache.kerby.kerberos.tool.Kinit</mainClass>
-                </manifest>
-              </archive>
-              <descriptorRefs>
-                <descriptorRef>jar-with-dependencies</descriptorRef>
-              </descriptorRefs>
-              <outputDirectory>kinit-dist/kinit</outputDirectory>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
+  
 </project>

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kdc-tool/pom.xml
----------------------------------------------------------------------
diff --git a/kdc-tool/pom.xml b/kdc-tool/pom.xml
index da3cb47..6f75fd4 100644
--- a/kdc-tool/pom.xml
+++ b/kdc-tool/pom.xml
@@ -30,4 +30,5 @@
     <module>kinit</module>
     <module>token-tool</module>
   </modules>
+
 </project>

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/README.txt
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/README.txt b/kerby-dist/kdc-dist/README.txt
new file mode 100644
index 0000000..48a5486
--- /dev/null
+++ b/kerby-dist/kdc-dist/README.txt
@@ -0,0 +1,54 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+How to install kerby-server?
+
+1. Set the absolute path of the directory:kerby-dist\kerby-server in kerby-dist\conf\wrapper.conf:
+Change the value of wrapper.working.dir.(in the line 28)
+e.g. 
+wrapper.working.dir=C:\\Users\\hazel\\workspace\\directory-kerberos\\kerby-dist\\target\\
+or
+wrapper.working.dir=/home/hazel/workspace/directory-kerberos/kerby-dist/target
+
+2.Every time you want to reinstall, just run:
+mvn install
+
+3.Then you can run or manage the service via the following scripts.
+On windows:
+bat/runConsole.bat,
+bat/installService.bat,
+bat/startService.bat,
+bat/stopService.bat,
+bat/uninstallService.bat in Windows.
+
+On Linux:
+bin/genConfig.sh
+bin/installDaemonNoPriv.sh
+bin/installDaemon.sh
+bin/queryDaemon.sh
+bin/runConsole.sh
+bin/runHelloWorld.sh
+bin/setenv.sh
+bin/startDaemonNoPriv.sh
+bin/startDaemon.sh
+bin/stopDaemonNoPriv.sh
+bin/stopDaemon.sh
+bin/systemTrayIcon.sh
+bin/uninstallDaemonNoPriv.sh
+bin/uninstallDaemon.sh
+bin/wrapper.sh
+

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/bin/start-kdc.sh
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/bin/start-kdc.sh b/kerby-dist/kdc-dist/bin/start-kdc.sh
new file mode 100644
index 0000000..9e6ce7c
--- /dev/null
+++ b/kerby-dist/kdc-dist/bin/start-kdc.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+java -jar ../kerby-kdc/kerby-kdc-1.0-SNAPSHOT-jar-with-dependencies.jar $@
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/pom.xml
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/pom.xml b/kerby-dist/kdc-dist/pom.xml
new file mode 100644
index 0000000..fa6be02
--- /dev/null
+++ b/kerby-dist/kdc-dist/pom.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. See accompanying LICENSE file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.kerby</groupId>
+    <artifactId>kerby-dist</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>kdc-dist</artifactId>
+  <name>KDC Dist</name>
+  <description>KDC Dist Project</description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.kerby</groupId>
+      <artifactId>kerby-kerb</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/ReadMe.txt
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/ReadMe.txt b/kerby-dist/kdc-dist/scripts/ReadMe.txt
new file mode 100644
index 0000000..a1e1a00
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/ReadMe.txt
@@ -0,0 +1,34 @@
+The following are scripts implementing diverse "extra" functionality for YAJSW.
+For more details please check the script file and the project documentation.
+
+
+Groovy scripts executed as trigger actions (eg if a text matches application console output, or on state changes):
+
+sendMail.gv
+trayMessage.gv
+trayColor.gv
+snmpTrap.gv
+
+Groovy scripts executed as conditions (eg script checks condition cyclically and starts/stops application accordingly)
+
+timeCondition.gv
+fileCondition.gv
+commandCondition.gv
+
+Groovy script executed on MSCS cluster change
+
+cluster.gv
+
+Groovy script for calculating the delay on application restart
+
+linearRestartDelay.gv
+
+Groovy script executed within the application process before the application is started (generally to map network forlders before a service is started)
+
+mapNetworkDrive.gv
+
+Groovy script for monitoring the application
+
+maxStartup.gv
+maxDuration.gv
+

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/cluster.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/cluster.gv b/kerby-dist/kdc-dist/scripts/cluster.gv
new file mode 100644
index 0000000..77fad19
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/cluster.gv
@@ -0,0 +1,22 @@
+/*
+ * Sample for Cluster aware script 
+ * 
+ * Starts the process if current node is active
+ * Stops the process otherwise
+ * 
+ * Arguments: -
+ * 
+ * Configuration Example:
+ * 
+ * wrapper.windows.cluster.script=scripts/cluster.gv
+ * 
+ * current cluster information may be accessed by:
+ *
+ * process.cluster.activeNode: returns as string the current active node for the first group found
+ * process.cluster.groupInfo: returns a Map<String, String> with <group-name, current-node-of-group>
+ */
+ 
+if (System.getenv("COMPUTERNAME").equals(process.cluster.activeNode))
+    process.start()
+else
+    process.stop()
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/commandCondition.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/commandCondition.gv b/kerby-dist/kdc-dist/scripts/commandCondition.gv
new file mode 100644
index 0000000..36a387e
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/commandCondition.gv
@@ -0,0 +1,103 @@
+/*
+ * Condition Script for implementing the wrapper.commandfile option
+ * 
+ * On first call the application is started
+ * With each call the script check for the existance of a command file
+ * This is a text file with one command per line
+ * All commands in the file are executed and the file is deleted
+ * The following commands are supported:
+ * 
+ * START 	      : start the application if it is not running
+ * STOP  	      : stop the applicaiton if it is running
+ * RESTART 	    : restart the application if it is running
+ * DUMP  	      : request a thread dump
+ * SHUTDOWN     : stop the wrapper and the application
+ * STATE <file> : writes the current state of the application to the given file
+ * STARTDUMP    : start of cyclic thread dump
+ * STOPDUMP     : stop of cyclic thread dump
+ * 
+ * Arguments: 
+ * - fileName
+ * 
+ * Example Configuration:
+ * 
+ * wrapper.condition.script=scripts/commandCondition.gv 
+ * wrapper.condition.script.args=cmd.txt 
+ * wrapper.condition.cycle=1 
+ */
+
+// on first call file is bound
+// set the file and start the process
+if (callCount == 0)
+{
+	file = new File(this.args[0])
+	process.start()
+	// at start no cyclic thread dump
+	nextDumpTime = -1
+	// uncomment to start cyclic thread dump on start
+	// nextDumpTime = System.currentTimeMillis()
+}
+
+// execute a command
+doCommand = { cmd ->
+	logger.info("executing file command "+cmd);
+	if ("START".equals(cmd))
+		process.start();
+	else if ("STOP".equals(cmd))
+		process.stop();
+	else if ("RESTART".equals(cmd))
+		process.restart();
+	else if ("DUMP".equals(cmd))
+		process.threadDump();
+	else if ("STARTDUMP".equals(cmd))
+	  	nextDumpTime = System.currentTimeMillis()
+	else if ("STOPDUMP".equals(cmd))
+	  	nextDumpTime = -1
+	else if ("SHUTDOWN".equals(cmd))
+	{
+		process.stop();
+		shutdown = true;
+	}
+	else if (cmd.startsWith("STATE "))
+	{
+		String fName = cmd.substring(6)
+		writer = new File(fName).newWriter(false) // no append
+		writer.write(process.getStringState())
+		writer.close()
+	}
+	else
+		logger.info("unknown command");
+}
+
+if (file.exists())
+// do the file
+try
+{
+	shutdown = false;
+	logger.info("command file found")
+	file.eachLine {cmd -> doCommand(cmd)}
+	file.delete();
+	logger.info("command file deleted")
+	if (shutdown)
+	{
+		Thread.sleep(5000)
+		Runtime.getRuntime().halt(0);
+	}
+}
+catch (Exception ex)
+{
+	logger.info("Error executing command file "+ex.getMessage())
+}
+
+try
+{
+if (nextDumpTime != -1 && nextDumpTime <= System.currentTimeMillis()) 
+	{ 
+		doCommand("DUMP")
+		nextDumpTime = System.currentTimeMillis()+30000 
+	}
+}
+catch (Exception ex)
+{
+	logger.info("Error executing cyclic thread dump "+ex.getMessage())
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/decryptor.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/decryptor.gv b/kerby-dist/kdc-dist/scripts/decryptor.gv
new file mode 100644
index 0000000..cf9f058
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/decryptor.gv
@@ -0,0 +1,20 @@
+/*
+ * In-Configurtion Script for encrypting configuration data
+ * 
+ * Dependency: http://www.jasypt.org/
+ *             Download jasypt-*.jar to <yajsw>/lib/groovy/jasypt/
+ * 
+ * Example Configuration:
+ * # definition of the In-Configuration script
+ * wrapper.config.script.decryptor = scripts/decryptor.gv
+ * # invocation of the script
+ * wrapper.java.additional.15 = ${decryptor.invoke('decrypt'\, 'aplasdfjlk')} 
+ */
+import org.jasypt.util.text.*
+
+public String decrypt(String text)
+{
+   textEncryptor = new BasicTextEncryptor();
+   textEncryptor.setPassword('asdfasdf');
+   return textEncryptor.decrypt(textEncryptor.encrypt(text));
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/equinox/equinoxShutdown.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/equinox/equinoxShutdown.gv b/kerby-dist/kdc-dist/scripts/equinox/equinoxShutdown.gv
new file mode 100644
index 0000000..70aae9a
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/equinox/equinoxShutdown.gv
@@ -0,0 +1,5 @@
+import org.eclipse.core.runtime.adaptor.EclipseStarter;
+
+println 'calling EclipseStarter.shutdown'
+EclipseStarter.shutdown()
+println 'shutdown terminated'
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/groovy/ReadMe.txt
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/groovy/ReadMe.txt b/kerby-dist/kdc-dist/scripts/groovy/ReadMe.txt
new file mode 100644
index 0000000..caf5193
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/groovy/ReadMe.txt
@@ -0,0 +1 @@
+Sample groovy script used in conf/sample/wrapper.groovy_helloworld.conf showing how groovy scripts are wrapped
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/groovy/helloworld.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/groovy/helloworld.gv b/kerby-dist/kdc-dist/scripts/groovy/helloworld.gv
new file mode 100644
index 0000000..139715d
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/groovy/helloworld.gv
@@ -0,0 +1,13 @@
+/*
+ * Sample script to test wrapping of a groovy script
+ * Just loops forever and prints to file and console
+ */
+writer=new File("FileWrite.out").newWriter()
+
+while (true)
+{
+	println "hello world"
+	writer.writeLine("hello world")
+	writer.flush()
+	Thread.sleep(1000);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/linearRestartDelay.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/linearRestartDelay.gv b/kerby-dist/kdc-dist/scripts/linearRestartDelay.gv
new file mode 100644
index 0000000..cc98475
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/linearRestartDelay.gv
@@ -0,0 +1,11 @@
+/*
+ * Script which increases the delay on each restart
+ * Input argument is the delay in seconds
+ *
+ * Configuration Example:
+ * 
+ * wrapper.restart.delay.script=scripts/linearRestartDelay.gv
+ * wrapper.restart.delay.script.args=10
+ */
+  return count*Long.parseLong(args[0])
+

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/mapNetworkDrive.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/mapNetworkDrive.gv b/kerby-dist/kdc-dist/scripts/mapNetworkDrive.gv
new file mode 100644
index 0000000..b46a6f4
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/mapNetworkDrive.gv
@@ -0,0 +1,12 @@
+/*
+ * Sample script for mapping a network before an application starts on windows
+ * 
+ * Arguments: -
+ * 
+ * Configuration Example:
+ * 
+ * wrapper.app.pre.script=scripts/mapNetworkDrive.gv
+ *
+ */
+
+'net use k: \\\\myserver\\$c'.execute().text
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/maxDuration.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/maxDuration.gv b/kerby-dist/kdc-dist/scripts/maxDuration.gv
new file mode 100644
index 0000000..b633be9
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/maxDuration.gv
@@ -0,0 +1,52 @@
+/*
+ * Script for checking that an application does not run
+ * longer than a max duration
+ * 
+ * An instance of the script is invoked on startup of the application
+ * Another instance is invoked when the application returns to idle state
+ * 
+ * On first call a timer is set. We are using a timer implementation from the netty framework.
+ * The timer is stored in the context map so that it can be retrieved when the application terminates.
+ * 
+ * Arguments: 
+ * - maximal duration in seconds
+ * 
+ * Example Configuration:
+ * 
+ * wrapper.script.RUN = scripts/maxDuration.gv
+ * wrapper.script.RUN.args = ${1*60*60} // 1 hour
+ * wrapper.script.IDLE = scripts/maxDuration.gv
+ *
+ */
+
+import org.jboss.netty.util.*
+import java.util.concurrent.TimeUnit
+
+
+// on first call create a timer task
+if (callCount == 0 && process.isOSProcessRunning())
+{
+	Timer timer = new HashedWheelTimer();
+	final myProcess = process;
+	TimerTask task = 
+	{ Object[] timeout ->
+			if (myProcess.isOSProcessRunning())
+			{
+				System.out.println("Script maxDuration.gv: application running too long -> stopping");
+				myProcess.stop();
+			}
+	} as TimerTask;
+		long duration = Long.parseLong(args[0])
+		Timeout timeout = timer.newTimeout(task, duration, TimeUnit.SECONDS)
+		context.put("timeout", timeout);
+		System.out.println("Script maxDuration.gv: timeout set")
+}
+else if (!process.isOSProcessRunning())
+{
+	Timeout timeout = context.remove("timeout");
+	if (timeout != null && !timeout.isExpired())
+		timeout.cancel();
+	System.out.println("Script maxDuration.gv: timeout removed")
+}
+
+

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/maxStartup.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/maxStartup.gv b/kerby-dist/kdc-dist/scripts/maxStartup.gv
new file mode 100644
index 0000000..338dad7
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/maxStartup.gv
@@ -0,0 +1,60 @@
+/*
+ * Script for checking that an application reports that it is up and running 
+ * within a timeout after it is in state running.
+ *
+ * The application reports that it is up by logging a text to the console
+ * The logged text is defined as a filter trigger.
+ * 
+ * An instance of the script is invoked on startup of the application
+ * Another instance is invoked when the expected text has been printed to the console
+ * 
+ * If we have been invoked by a text match (line == null) a timer is set. We are using a timer implementation from the netty framework.
+ * The timer is stored in the context map so that it can be retrieved when the application terminates.
+ * 
+ * Arguments: 
+ * - maximal duration in seconds
+ * 
+ * Example Configuration:
+ * 
+ * wrapper.script.RUN = scripts/maxStartup.gv
+ * wrapper.script.RUN.args = ${2*60} // 2 minutes
+ * wrapper.filter.trigger.systemStarted=System started
+ * wrapper.filter.script.systemStarted=scripts/maxStartup.gv
+ *
+ */
+
+import org.jboss.netty.util.*
+import java.util.concurrent.TimeUnit
+
+println "maxStartup.gv invoked: $line"
+
+	Timeout timeout = context.remove("timeout");
+// if a timeout has been set: remove it.
+	if (timeout != null && !timeout.isExpired())
+	{
+		timeout.cancel();
+		println "Script maxStartup.gv: timeout removed"
+		}
+
+// if we are not invoked by a trigger
+if (line == null || "".equals(line))
+{
+	Timer timer = new HashedWheelTimer();
+	final myProcess = process;
+	TimerTask task = 
+	{ Object[] tt ->
+			if (myProcess.isOSProcessRunning())
+			{
+			println "Script maxStartup.gv: took too long to startup -> restart"
+				myProcess.restart();
+			}
+	} as TimerTask;
+		long duration = Long.parseLong(args[0])
+		timeout = timer.newTimeout(task, duration, TimeUnit.SECONDS)
+		context.put("timeout", timeout);
+		println "Script maxStartup.gv: timeout set"
+}
+// else: nothing to do: timeout has already been removed
+
+
+

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/nutch/ReadMe.txt
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/nutch/ReadMe.txt b/kerby-dist/kdc-dist/scripts/nutch/ReadMe.txt
new file mode 100644
index 0000000..9169d5c
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/nutch/ReadMe.txt
@@ -0,0 +1,5 @@
+Sample Scripts showing how YAJSW can be used to run a workflow of applications.
+This example implements web crawl for nutch/solr.
+For further details refer to nutch_recrawl.gv.
+
+Refer also to conf/samples/luceneNutch for the configuration files for wrapping these scripts.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/nutch/nutch_base.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/nutch/nutch_base.gv b/kerby-dist/kdc-dist/scripts/nutch/nutch_base.gv
new file mode 100644
index 0000000..fb54709
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/nutch/nutch_base.gv
@@ -0,0 +1,187 @@
+/*
+*
+* Base script for running nutch
+* Sets global properties
+* Defines execNutch for executing nutch in a sub-process
+* Diverse shell functions
+*/
+
+
+import org.rzo.yajsw.groovy.*
+
+// properties
+//NUTCH_HOME = "."
+crawl_dir = "$NUTCH_HOME/crawl_dir"
+//CATALINA_HOME = "."
+depth = 5
+threads = 50
+adddays = 7
+//rank = 10000 // Comment this statement if you don't want to set topN value
+safe = true
+urls = "urls"
+
+
+//
+steps=10
+try
+{
+if (rank instanceof Integer)
+	topN="--topN $rank"
+else
+  topN=""
+}
+catch (Exception ex)
+{
+	topN = ""
+}
+
+// nutch command -> main class
+getMainClass = { COMMAND ->
+if (COMMAND.equals("crawl"))
+  return "org.apache.nutch.crawl.Crawl"
+else if (COMMAND.equals("inject"))
+   return "org.apache.nutch.crawl.Injector"
+else if (COMMAND.equals("generate"))
+   return "org.apache.nutch.crawl.Generator"
+else if (COMMAND.equals("freegen"))
+   return "org.apache.nutch.tools.FreeGenerator"
+else if (COMMAND.equals("fetch"))
+   return "org.apache.nutch.fetcher.Fetcher"
+else if (COMMAND.equals("fetch2"))
+   return "org.apache.nutch.fetcher.Fetcher2"
+else if (COMMAND.equals("parse"))
+   return "org.apache.nutch.parse.ParseSegment"
+else if (COMMAND.equals("readdb"))
+   return "org.apache.nutch.crawl.CrawlDbReader"
+else if (COMMAND.equals("convdb"))
+   return "org.apache.nutch.tools.compat.CrawlDbConverter"
+else if (COMMAND.equals("mergedb"))
+   return "org.apache.nutch.crawl.CrawlDbMerger"
+else if (COMMAND.equals("readlinkdb"))
+   return "org.apache.nutch.crawl.LinkDbReader"
+else if (COMMAND.equals("readseg"))
+   return "org.apache.nutch.segment.SegmentReader"
+else if (COMMAND.equals("segread"))
+{
+	echo "[DEPRECATED] Command 'segread' is deprecated, use 'readseg' instead."
+   return "org.apache.nutch.segment.SegmentReader"
+}
+else if (COMMAND.equals("mergesegs"))
+   return "org.apache.nutch.segment.SegmentMerger"
+else if (COMMAND.equals("updatedb"))
+   return "org.apache.nutch.crawl.CrawlDb"
+else if (COMMAND.equals("invertlinks"))
+   return "org.apache.nutch.crawl.LinkDb"
+else if (COMMAND.equals("mergelinkdb"))
+   return "org.apache.nutch.crawl.LinkDbMerger"
+else if (COMMAND.equals("index"))
+   return "org.apache.nutch.indexer.Indexer"
+else if (COMMAND.equals("solrindex"))
+   return "org.apache.nutch.indexer.solr.SolrIndexer"
+else if (COMMAND.equals("dedup"))
+   return "org.apache.nutch.indexer.DeleteDuplicates"
+else if (COMMAND.equals("solrdedup"))
+   return "org.apache.nutch.indexer.solr.SolrDeleteDuplicates"
+else if (COMMAND.equals("merge"))
+   return "org.apache.nutch.indexer.IndexMerger"
+else if (COMMAND.equals("plugin"))
+   return "org.apache.nutch.plugin.PluginRepository"
+else if (COMMAND.equals("server"))
+   return 'org.apache.nutch.searcher.DistributedSearch$Server'
+   else
+	   return null
+}
+
+// run nutch set exit code into err
+err = 0
+execNutch = { args ->
+	    println "exec nutch $args"
+		builder = new WrapperBuilder()
+		// get full path to conf file
+		builder."wrapper.config" = new File("conf/wrapper.nutch.conf").getCanonicalPath()
+		// set the java application args starting with args[1]
+		args.eachWithIndex {arg, i -> if (i>0) builder."wrapper.app.parameter.$i" = arg}
+		// working dir of nutch
+		builder."NUTCH_HOME" = NUTCH_HOME
+		// get the main class depending on the nutch command in args[0]
+		builder."wrapper.java.app.mainclass" = getMainClass(args[0])
+		process = builder.process();
+		process.start()
+		process.waitFor()
+		err = process.exitCode
+		println "nutch terminated with exit code $err"
+		return err
+		}
+
+// echo command
+echo = {println it}
+
+// tomcat service
+builder = new WrapperBuilder()
+builder."wrapper.config" = "conf/wrapper.nutch_tomcat.conf"
+builder."CATALINA_HOME" = CATALINA_HOME
+tomcat = builder.service()
+// install if not already installed
+if (!tomcat.isInstalled())
+	tomcat.install()
+
+// some sh commands implemented in groovy
+delClos = { file ->
+		println "del ${file.getCanonicalPath()} ${file.isDirectory()}"
+		if (file.isDirectory())
+		{
+			file.eachDir {delClos(it)}
+			file.eachFile {if (!it.delete()) println "error deleting $it"}
+		}
+		else
+			if (!file.delete()) println "error deleting $file"
+}
+// rm -rf
+rm_rf = { file -> 
+		println "rm -rf $file"
+		removeSelf = true
+		if (file.endsWith("*"))
+		{
+			file = file.replace( "*", "")
+			removeSelf = false
+		}
+		delClos(new File(file))
+		if (removeSelf)
+		{
+			new File(file).delete()
+		}
+}
+// mv
+mvSingle = {from, to -> println "mv $from $to"; if (!from.renameTo(new File(to, from.getName()))) println "error moving $from -> $to"}
+mv = {from , to ->
+    println "mv $from $to"
+    moveDir = false
+    if (from.endsWith( "*"))
+    {
+    	from = from.replace("*", "")
+    	moveDir = true
+    }
+    from = new File(from)
+    to = new File(to)
+	success = false
+     if (moveDir)
+			{
+        from.eachFile(){mvSingle( it, to)}
+        from.eachDir(){mvSingle (it, to)}
+			}
+			else
+				mvSingle (from, to)
+}
+
+//`ls -d crawl/segments/* | tail -1`
+lastSegment = {dir = "$it"; files = new File(dir).list(); return "$dir/${files[files.length-1]}"}
+
+// touch
+touch = {
+		file = new File(it)
+	if (file.exists())
+		file.setLastModified(System.currentTimeMillis())
+	else
+		println "touch error: file does not exist ${file.getCanonicalPath()}"
+}
+

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/nutch/nutch_crawl.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/nutch/nutch_crawl.gv b/kerby-dist/kdc-dist/scripts/nutch/nutch_crawl.gv
new file mode 100644
index 0000000..6d22f13
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/nutch/nutch_crawl.gv
@@ -0,0 +1,8 @@
+// basic initializations
+evaluate(new File("scripts/nutch_base.gv"))
+
+// start the script
+// bin/nutch crawl urls -dir crawl -depth 3 -topN 50
+echo "----- crawl -----"
+execNutch (["crawl", "$urls", "-dir", "${crawl_dir}", "-depth", "$depth"])
+echo "----- done -----"

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/nutch/nutch_recrawl.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/nutch/nutch_recrawl.gv b/kerby-dist/kdc-dist/scripts/nutch/nutch_recrawl.gv
new file mode 100644
index 0000000..2449d6e
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/nutch/nutch_recrawl.gv
@@ -0,0 +1,110 @@
+/*  
+Original script:
+http://www.adick.at/2008-10-15,recrawl-script-for-nutch/
+
+*/
+// basic initializations
+evaluate(new File("scripts/nutch_base.gv"))
+try
+{
+// start the script
+echo "----- Inject (Step 1 of $steps) -----"
+execNutch (["inject", "${crawl_dir}/crawldb", "urls"])
+
+echo "----- Generate, Fetch, Parse, Update (Step 2 of $steps) -----"
+for(i=0; i <depth; i++)
+{
+        echo "--- Beginning crawl at depth ${i + 1} of ${depth} ---"
+        execNutch(["generate", "$crawl_dir/crawldb", "$crawl_dir/segments", "-adddays", "$adddays"])
+        if (err != 0)
+        {
+         echo "runbot: Stopping at depth ${i +1}. No more URLs to fetch."
+          break
+        }
+         segment=lastSegment( "$crawl_dir/segments/")
+         execNutch (["fetch", "$segment", "-threads ${threads}"])
+         if (err != 0)
+         {
+         echo "runbot: fetch $segment at depth ${depth} failed. Deleting it."
+         rm_rf("$segment")
+         continue
+         }
+        echo "--- Parsing Segment $segment ---"
+        execNutch (["parse", "$segment"])
+        execNutch (["updatedb", "$crawl_dir/crawldb", "$segment"])
+}
+         
+echo "----- Stopping Tomcat (Step 3 of $steps) -----"
+tomcat.stop()
+
+echo "----- Merge Segments (Step 4 of $steps) -----"
+rm_rf("$crawl_dir/MERGEDsegments")
+execNutch (["mergesegs", "$crawl_dir/MERGEDsegments", "-dir", "$crawl_dir/segments/"])
+println "err $err"
+if (err == 0)
+{
+          if (!safe)
+            rm_rf ("$crawl_dir/segments/*")
+           else
+         {
+            new File("$crawl_dir/FETCHEDsegments").mkdir()
+            mv ("$crawl_dir/segments/*", "$crawl_dir/FETCHEDsegments")
+         }
+          mv ("$crawl_dir/MERGEDsegments/*", "$crawl_dir/segments")
+          rm_rf ("$crawl_dir/MERGEDsegments")
+      }
+else
+{
+	      println "error in merge -> abort"
+          System.exit(err)
+}
+
+echo "----- Invert Links (Step 5 of $steps) -----"
+execNutch (["invertlinks", "$crawl_dir/linkdb", "$crawl_dir/segments/*"])
+
+echo "----- Index (Step 6 of $steps) -----"
+rm_rf("$crawl_dir/NEWindexes")
+rm_rf ("$crawl_dir/OLDindexes")
+execNutch (["index", "$crawl_dir/NEWindexes", "$crawl_dir/crawldb", "$crawl_dir/linkdb", "$crawl_dir/segments/*"])
+
+echo "----- Dedup (Step 7 of $steps) -----"
+execNutch (["dedup", "$crawl_dir/NEWindexes"])
+         
+echo "----- Merge Indexes (Step 8 of $steps) -----"
+execNutch (["merge", "$crawl_dir/MERGEDindexes", "$crawl_dir/NEWindexes"])
+// in nutch-site, hadoop.tmp.dir points to crawl/tmp
+rm_rf ("$crawl_dir/tmp/*")
+// replace indexes with indexes_merged
+file = new File("$crawl_dir/OLDindexes")
+if (!file.exists()) file.mkdir()
+mv ("$crawl_dir/index/*", "$crawl_dir/OLDindexes")
+mv ("$crawl_dir/MERGEDindexes/*", "$crawl_dir/index")
+// clean up old indexes directories
+if(!safe)
+         {
+         rm_rf ("$crawl_dir/NEWindexes")
+         rm_rf ("$crawl_dir/OLDindexes")
+         }
+         
+echo "----- Reloading index on the search site (Step 9 of $steps) -----"
+ if(safe)
+         {
+        touch ("${CATALINA_HOME}/webapps/ROOT/WEB-INF/web.xml")
+        echo "Done!"
+         }
+      else
+         {
+        echo "runbot: Can not reload index in safe mode."
+        echo "runbot: Please reload it manually using the following command:"
+        echo "runbot: touch ${CATALINA_HOME}/webapps/ROOT/WEB-INF/web.xml"
+         }
+
+echo "----- Restarting Tomcat (Step 10 of $steps) -----"
+tomcat.stop()
+tomcat.start()
+echo "runbot: FINISHED: Crawl completed!"
+}
+catch (Throwable ex)
+{
+	ex.printStackTrace()
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/nutch/nutch_solr.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/nutch/nutch_solr.gv b/kerby-dist/kdc-dist/scripts/nutch/nutch_solr.gv
new file mode 100644
index 0000000..c79d076
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/nutch/nutch_solr.gv
@@ -0,0 +1,53 @@
+/*  
+Original script:
+http://www.lucidimagination.com/blog/2009/03/09/nutch-solr/
+
+
+*/
+// basic initializations
+evaluate(new File("scripts/nutch_base.gv"))
+
+solr_url = "http://127.0.0.1:8983/solr/"
+steps = 4
+
+try
+{
+// start the script
+echo "----- Inject (Step 1 of $steps) -----"
+execNutch (["inject", "${crawl_dir}/crawldb", "urls"])
+
+echo "----- Generate, Fetch, Parse, Update (Step 2 of $steps) -----"
+for(i=0; i <depth; i++)
+{
+        echo "--- Beginning crawl at depth ${i + 1} of ${depth} ---"
+        execNutch(["generate", "$crawl_dir/crawldb", "$crawl_dir/segments", "-adddays", "$adddays"])
+        if (err != 0)
+        {
+         echo "runbot: Stopping at depth ${i +1}. No more URLs to fetch."
+          break
+        }
+         segment=lastSegment( "$crawl_dir/segments/")
+         execNutch (["fetch", "$segment", "-threads ${threads}", "-noParsing"])
+         if (err != 0)
+         {
+         echo "runbot: fetch $segment at depth ${depth} failed. Deleting it."
+         rm_rf("$segment")
+         continue
+         }
+        echo "--- Parsing Segment $segment ---"
+        execNutch (["parse", "$segment"])
+        execNutch (["updatedb", "$crawl_dir/crawldb", "$segment", "-filter", "-normalize"])
+}
+
+echo "----- Invert Links (Step 3 of $steps) -----"
+execNutch (["invertlinks", "$crawl_dir/linkdb", "$crawl_dir/segments/*"])
+
+echo "----- index all content from all segments to Solr (Step 4 of $steps) -----"
+execNutch (["solrindex", "$solr_url", "$crawl_dir/crawldb", "$crawl_dir/linkdb", "$crawl_dir/segments/*"])
+
+echo "runbot: FINISHED: Crawl completed!"
+}
+catch (Throwable ex)
+{
+	ex.printStackTrace()
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/sendMail.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/sendMail.gv b/kerby-dist/kdc-dist/scripts/sendMail.gv
new file mode 100644
index 0000000..2c6c0ab
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/sendMail.gv
@@ -0,0 +1,84 @@
+/*
+ * Script for sending an email.
+ * 
+ * Arguments: 
+ * - toMail
+ * - subject
+ * - message
+ * 
+ * Example Configuration:
+ * 
+ * wrapper.filter.trigger.exception.mail=Exception
+ * wrapper.filter.script.exception.mail=scripts/sendMail.gv
+ * wrapper.filter.script.exception.mail.args=mailto@me.com, YAJSW exception, exception found in console output please check the log file
+ */
+import javax.mail.*
+import javax.mail.internet.*
+
+port = 25
+
+mailHost='smtp.mailhost.net' // set your mail provider  
+mailFrom='me@mailhost.net'   // set your mail from
+
+mailUser=null                // set your user if you require authentication
+mailPassword=null            // set your password if you require authentication
+useSSL=false             		 // set to true to use SSL
+  
+
+if (this.args == null || this.args.length != 3)
+{
+	logger.info("error in script sendMail.gv missing arguments. check configuration")
+	return;
+}
+
+mailTo=this.args[0]
+
+subject=this.args[1]
+message=this.args[2]
+
+logger.info("sending mail to " +mailTo)
+
+try
+{
+props = new Properties()
+props.put('mail.smtp.host', mailHost)
+props.put('mail.smtp.port', port.toString())
+
+if (mailPassword != null)
+{
+	props.put('mail.smtp.user', mailUser); 
+	props.put('mail.smtp.password', mailPassword) 
+	props.put('mail.smtp.auth', 'true') 
+	mailSession = Session.getDefaultInstance(props, 
+		new javax.mail.Authenticator() 
+		{ protected PasswordAuthentication getPasswordAuthentication() 
+			{ return new PasswordAuthentication(mailUser, mailPassword); 
+			} 
+		})
+}
+else
+	mailSession = Session.getDefaultInstance(props, null)
+
+
+// Construct the message
+msg = new MimeMessage(mailSession)
+msg.from = new InternetAddress(mailFrom)
+msg.addRecipient(Message.RecipientType.TO, new InternetAddress(mailTo))
+msg.subject = subject
+msg.text = message
+
+// Send the message
+if (useSSL)
+	SMTPSSLTransport.send(msg)
+else
+	Transport.send(msg)
+
+logger.info("mail sent " +mailTo)
+}
+catch (Exception ex)
+{
+logger.throwing("sendMail.gv", "run", ex)
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/setenv.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/setenv.gv b/kerby-dist/kdc-dist/scripts/setenv.gv
new file mode 100644
index 0000000..51b7435
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/setenv.gv
@@ -0,0 +1,42 @@
+/*
+ * Script for setting an OS environment variable on Windows.
+ * This can be called within the wrapped application to set environment variables
+ *
+ * Arguments: 
+ * - none
+ * 
+ * Example Configuration:
+ * 
+ * wrapper.app.pre.script = setenv.gv
+ * 
+ * to define the variables and their values edit the vars map in the script
+ * note: System.getenv() will not return values set by this script. This script is invoked after the java launcher initialized the environment properties.
+ */
+
+import com.sun.jna.Native;
+import com.sun.jna.win32.StdCallLibrary;
+import com.sun.jna.win32.W32APIOptions;
+
+// set the variables in the following map
+def vars = ['testvar1':'testval1', 'testvar2':'testval2']
+
+println "setting environment variables"
+
+
+public interface Kernel32 extends StdCallLibrary 
+{
+	Kernel32 INSTANCE = (Kernel32) Native.loadLibrary("kernel32", Kernel32.class, W32APIOptions.UNICODE_OPTIONS);
+
+	boolean SetEnvironmentVariable(String lpName, String lpValue);
+}
+
+vars.each
+{
+	var = it.key
+	value = it.value
+	println "setting $var = $value"
+	Kernel32.INSTANCE.SetEnvironmentVariable(var, value)
+}
+
+println "done setting environment variables"
+

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/snmpTrap.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/snmpTrap.gv b/kerby-dist/kdc-dist/scripts/snmpTrap.gv
new file mode 100644
index 0000000..3978168
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/snmpTrap.gv
@@ -0,0 +1,56 @@
+/*
+ * Script for sending SNMP traps
+ * 
+ * arguments:
+ * - ip address of the NMS
+ * - id the OID of the trap is: 1.3.6.1.2.1.1.1.id
+ * - message of the trap
+ * 
+ * required libs:
+ * - snmp4j
+ * 
+ * Example Configuration:
+ * 
+ * wrapper.filter.script = scripts/snmpTrap.gv
+ * wrapper.filter.script.args = 192.168.0.1, 1, out of memory exception 
+ */
+
+import java.io.IOException;
+
+import org.snmp4j.*
+import org.snmp4j.smi.*
+import org.snmp4j.transport.*
+
+if (this.args == null || this.args.length != 3)
+{
+	logger.info("error in script snmpTrap.gv missing arguments. check configuration")
+	return;
+}
+
+
+nmsIp = this.args[0];
+id = this.args[1];
+msg = this.args[2];
+
+target = new CommunityTarget();
+port = 162;
+targetAddress = GenericAddress.parse("udp:"+nmsIp+"/"+port);
+target.setAddress(targetAddress);
+target.setTimeout(5000);
+target.setRetries(1);
+target.setCommunity(new OctetString("Public"));
+transport = new DefaultUdpTransportMapping();
+snmp = new Snmp(transport);
+v = new OctetString(msg);
+oid = new OID([1, 3, 6, 1, 2, 1, 1, 1, id] as int[]);
+vb = new VariableBinding(oid, v);
+p = new PDUv1();
+p.add(vb);
+snmp.trap(p, target);
+
+logger.info("sent trap to nmsIp: "+ id + " "+msg)
+
+
+
+
+

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/threadDump.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/threadDump.gv b/kerby-dist/kdc-dist/scripts/threadDump.gv
new file mode 100644
index 0000000..00f2a93
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/threadDump.gv
@@ -0,0 +1,13 @@
+/*
+ * Script for executing a thread dump.
+ * This can be set as a shutdown hook in the application 
+ *
+ * Arguments: 
+ * - none
+ * 
+ * Example Configuration:
+ * 
+ * wrapper.app.shutdown.script = threadDump.gv
+ */
+println "Thead Dump YAJSW shutdown hook"
+new org.rzo.yajsw.action.ThreadDumpImpl5().execute(null, null, System.out, null)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/timeCondition.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/timeCondition.gv b/kerby-dist/kdc-dist/scripts/timeCondition.gv
new file mode 100644
index 0000000..95e4a67
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/timeCondition.gv
@@ -0,0 +1,82 @@
+/*
+ * Condition Script to check that the application is running during an interval
+ * 
+ * Starts the process if it is not running
+ * Stops the process outside of the interval
+ * 
+ * Arguments: 
+ * - interval begin 
+ * - interval end
+ * 
+ * Time format <hh>[:<mm>[:<ss>]]
+ * Example: 25 -> 1:00 next day
+ * Example: 3, 1 -> 3:00 -> 1:00 next day
+ * 
+ * Configuration Example:
+ * 
+ * wrapper.condition.script=scripts/timeCondition.gv
+ * wrapper.condition.script.args=13,13:50
+ */
+
+import org.joda.time.*
+
+if (this.args == null || this.args.length != 2)
+{
+	println "error in script timeCondition.gv missing arguments. check configuration"
+	return;
+}
+
+
+getTime = { strTime ->
+			hours = 0
+			minutes = 0
+			seconds = 0
+			try
+			{
+				times = strTime.split(":")
+				hours = Integer.parseInt(times[0])
+				minutes = Integer.parseInt(times[1])
+				seconds = Integer.parseInt(times[2])
+			}
+			catch (Exception ex){}
+			now = new DateTime();
+			result = now.withTime(0, 0, 0, 0)
+			result = result.plusHours(hours)
+			result = result.plusMinutes(minutes)
+			result = result.plusSeconds(seconds)
+			return result
+        }
+
+createInterval = { ->
+	begin = getTime(args[0])
+	end   = getTime(args[1])
+	if (end.isBefore(begin))
+	   end = end.plusDays(1)
+	interval = new Interval(begin, end);
+	return interval;
+	
+}
+
+getInterval = { ->
+// on first call intervall is not bound 
+		if (callCount == 0 || interval.isAfterNow())
+			{
+				return createInterval()
+			}
+			else
+				return interval
+}
+
+
+processState = process.getStringState()
+
+if (getInterval().containsNow() && "IDLE".equals(processState))
+{
+	println "starting process"
+	process.start();
+}
+else if (!getInterval().containsNow() && !"IDLE".equals(processState))
+{
+	println "stopping process"
+	process.stop();
+}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/trayColor.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/trayColor.gv b/kerby-dist/kdc-dist/scripts/trayColor.gv
new file mode 100644
index 0000000..1a25d60
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/trayColor.gv
@@ -0,0 +1,48 @@
+/*
+ * Script for changing the status color on the system tray icon.
+ * 
+ * Arguments: 
+ * - color [RED|YELLOW|GREEN|BLUE|BLACK|CYAN|GRAY|MAGENTA|ORANGE|PINK|NULL]
+ * 
+ * Example Configuration:
+ * 
+ * wrapper.filter.trigger.nok.tray=not OK
+ * wrapper.filter.script.nok.tray=scripts/trayColor.gv
+ * wrapper.filter.script.nok.tray.args=RED
+ * wrapper.filter.trigger.ok.tray=OK
+ * wrapper.filter.script.ok.tray=scripts/trayColor.gv
+ * wrapper.filter.script.ok.tray.args=NULL
+ */
+ 
+ import java.awt.Color
+ 
+if (this.args == null || this.args.length != 1)
+{
+	println "error in script trayMessage.gv missing arguments. check configuration"
+	return;
+}
+
+color = null;
+ if (args[0].equals('RED'))
+ 		color = Color.RED
+else  if (args[0].equals('NULL'))
+ 		color = null
+else if (args[0].equals('GREEN'))
+ 		color = Color.GREEN
+else  if (args[0].equals('BLUE'))
+ 		color = Color.BLUE
+else  if (args[0].equals('BLACK'))
+ 		color = Color.BLACK
+else  if (args[0].equals('CYAN'))
+ 		color = Color.CYAN
+else  if (args[0].equals('GRAY'))
+ 		color = Color.GRAY
+else  if (args[0].equals('MAGENTA'))
+ 		color = Color.MAGENTA
+else  if (args[0].equals('ORANGE'))
+ 		color = Color.ORANGE
+else  if (args[0].equals('PINK'))
+ 		color = Color.PINK
+ 		
+   
+ process.getTrayIcon().setUserColor(color)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/trayMessage.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/trayMessage.gv b/kerby-dist/kdc-dist/scripts/trayMessage.gv
new file mode 100644
index 0000000..808f4be
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/trayMessage.gv
@@ -0,0 +1,29 @@
+/*
+ * Script for displaying a system tray message.
+ * 
+ * Arguments: 
+ * - toMail
+ * - subject
+ * - message
+ * 
+ * Example Configuration:
+ * 
+ * wrapper.filter.trigger.exception.tray=Exception
+ * wrapper.filter.script.exception.tray=scripts/trayMessage.gv
+ * wrapper.filter.script.exception.tray.args=Exception
+ */
+
+if (this.args == null || this.args.length != 1)
+{
+	println "error in script trayMessage.gv: missing arguments. check configuration"
+	return;
+}
+
+if (process == null || process.getTrayIcon() == null)
+{
+	println "error in script trayMessage.gv: no process or process not configured for tray icon"
+	return; 
+}
+
+ 
+ process.getTrayIcon().error(this.args[0], "$line")
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/vfsCommandCondition.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/vfsCommandCondition.gv b/kerby-dist/kdc-dist/scripts/vfsCommandCondition.gv
new file mode 100644
index 0000000..248f347
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/vfsCommandCondition.gv
@@ -0,0 +1,99 @@
+/*
+ * Condition Script for implementing the wrapper.commandfile option
+ * Command file can be any VFS supported text file.
+ * This allows for remote control of a server farm.
+ *
+ * On first call the application is started
+ * With each call the script checks for update of the command file
+ * This is a text file with one command per line
+ * All commands in the file are executed
+ * The following commands are supported:
+ * 
+ * START 	: start the application if it is not running
+ * STOP  	: stop the applicaiton if it is running
+ * RESTART 	: restart the application if it is running
+ * DUMP  	: request a thread dump
+ * SHUTDOWN : stop the wrapper and the application
+ * STATE <file> : writes the current state of the application to the given file on the local hd
+ * 
+ * Arguments: 
+ * - fileName
+ * 
+ * Example Configuration:
+ * 
+ * wrapper.condition.script=scripts/vfsCommandCondition.gv 
+ * wrapper.condition.script.args=http://localhost/cmd.txt 
+ * wrapper.condition.cycle=1 
+ */
+ 
+import org.apache.commons.vfs2.VFS
+import org.apache.commons.vfs2.FileObject;
+
+// on first call file is bound
+// set the file and start the process
+if (callCount == 0)
+{
+	process.start()
+	
+	file = VFS.getManager().resolveFile(args[0]) 
+	lastmodified = 0 
+	if (file != null && file.exists()) 
+		lastmodified = file.getContent().getLastModifiedTime() 
+
+}
+
+
+// execute a command
+doCommand = { cmd ->
+	logger.info("executing file command "+cmd);
+	if ("START".equals(cmd))
+		process.start();
+	else if ("STOP".equals(cmd))
+		process.stop();
+	else if ("RESTART".equals(cmd))
+		process.restart();
+	else if ("DUMP".equals(cmd))
+		process.threadDump();
+	else if ("SHUTDOWN".equals(cmd))
+	{
+		process.stop();
+		shutdown = true;
+	}
+	else if (cmd.startsWith("STATE "))
+	{
+		String fName = cmd.substring(6)
+		writer = new File(fName).newWriter(false) // no append
+		writer.write(process.getStringState())
+		writer.close()
+	}
+	else
+		logger.info("unknown command");
+}
+
+	VFS.getManager().getFilesCache().close()
+	file = VFS.getManager().resolveFile(args[0]) 
+	
+if (file != null && file.exists() && lastmodified < file.getContent().getLastModifiedTime())
+// do the file
+try
+{
+	lastmodified = file.getContent().getLastModifiedTime() 
+	shutdown = false;
+	logger.info("new command file found " + file)
+	instream = new BufferedReader(new InputStreamReader(file.getContent().getInputStream()))
+	for (s = instream.readLine(); s != null; s = instream.readLine())
+	  doCommand(s)
+	instream.close()
+	
+	if (shutdown)
+	{
+		Thread.sleep(5000)
+		Runtime.getRuntime().halt(0);
+	}
+}
+catch (Exception ex)
+{
+	logger.info("Error executing command file "+ex.getMessage())
+	if (instream != null)
+	  instream.close()
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/kdc-dist/scripts/wso2/wso2_shutdown.gv
----------------------------------------------------------------------
diff --git a/kerby-dist/kdc-dist/scripts/wso2/wso2_shutdown.gv b/kerby-dist/kdc-dist/scripts/wso2/wso2_shutdown.gv
new file mode 100644
index 0000000..89af56a
--- /dev/null
+++ b/kerby-dist/kdc-dist/scripts/wso2/wso2_shutdown.gv
@@ -0,0 +1,13 @@
+import javax.management.*
+
+servers = MBeanServerFactory.findMBeanServer(null)
+beanName = "org.wso2.carbon:type=ServerAdmin"
+println 'executing wso2 shutdown script'
+servers.each(){
+	try{
+		new GroovyMBean(it, beanName).shutdownGracefully(); 
+		println 'shutdownGracefully invoked, waiting for wso2 shutdown'; 
+		Thread.sleep(20000); 
+		return;
+		} 
+		catch (Exception ex){ex.printStackTrace()}}

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/pom.xml
----------------------------------------------------------------------
diff --git a/kerby-dist/pom.xml b/kerby-dist/pom.xml
new file mode 100644
index 0000000..df20508
--- /dev/null
+++ b/kerby-dist/pom.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. See accompanying LICENSE file.
+-->
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.kerby</groupId>
+    <artifactId>kerby-all</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>kerby-dist</artifactId>
+  <name>Kerby KDC Distribution</name>
+  <description>Kerby KDC Distribution</description>
+  <packaging>pom</packaging>
+
+  <modules>
+    <module>kdc-dist</module>
+    <module>tool-dist</module>
+  </modules>
+
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/tool-dist/bin/kinit.sh
----------------------------------------------------------------------
diff --git a/kerby-dist/tool-dist/bin/kinit.sh b/kerby-dist/tool-dist/bin/kinit.sh
new file mode 100644
index 0000000..c82b91c
--- /dev/null
+++ b/kerby-dist/tool-dist/bin/kinit.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+confdir=/etc/kerby/krb/conf
+java -jar ../kinit/kinit-1.0-SNAPSHOT-jar-with-dependencies.jar ${confdir} $@

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/097d43c4/kerby-dist/tool-dist/pom.xml
----------------------------------------------------------------------
diff --git a/kerby-dist/tool-dist/pom.xml b/kerby-dist/tool-dist/pom.xml
new file mode 100644
index 0000000..d90e4d6
--- /dev/null
+++ b/kerby-dist/tool-dist/pom.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. See accompanying LICENSE file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.kerby</groupId>
+    <artifactId>kerby-dist</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>tool-dist</artifactId>
+  <name>Tool Dist</name>
+  <description>Tool Dist Project</description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.kerby</groupId>
+      <artifactId>kerby-kerb</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+  </dependencies>
+
+</project>


Mime
View raw message