edgent-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdog...@apache.org
Subject [6/7] incubator-quarks git commit: QUARKS-13 update crontab and instructions to use the updated startapp.sh
Date Mon, 11 Apr 2016 22:20:52 GMT
QUARKS-13 update crontab and instructions to use the updated startapp.sh


Project: http://git-wip-us.apache.org/repos/asf/incubator-quarks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quarks/commit/03b8df17
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quarks/tree/03b8df17
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quarks/diff/03b8df17

Branch: refs/heads/master
Commit: 03b8df1722fcc1166073ed878c8e5b7d539b4fa9
Parents: 57ab58c
Author: Victor Dogaru <vdogaru@apache.org>
Authored: Mon Apr 11 11:40:18 2016 -0700
Committer: Victor Dogaru <vdogaru@apache.org>
Committed: Mon Apr 11 14:57:38 2016 -0700

----------------------------------------------------------------------
 scripts/cron/README        | 34 +++++++++++++---------------------
 scripts/cron/startapp.cron |  6 +++---
 2 files changed, 16 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quarks/blob/03b8df17/scripts/cron/README
----------------------------------------------------------------------
diff --git a/scripts/cron/README b/scripts/cron/README
index e53f21f..8b1e1f2 100644
--- a/scripts/cron/README
+++ b/scripts/cron/README
@@ -1,38 +1,30 @@
-Script for restarting Quarks if the JVM crashes
+Restarting Quarks if the JVM crashes
 
-The startapp.sh script is setup to run as a cron job every minute in order
+The startapp.sh script can be setup to run as a cron job every minute in order
 to monitor a JVM running a Quarks application and restart Quarks if the 
 JVM crashes. The script checks whether the pid of the JVM indicates
 a process which is still running.  If the pid is not there, it executes the 
 command to start the application in the first place.
 
-The JVM's standard output and standard error are written to the directory 
-passed as a command line argument for the script. The script also saves the
-process id (pid) of the JVM in a file.  If the pid file already exists and 
-contains the id of a running process, then the script will not start Quarks.
+A crontab entry file contains information which cron uses to schedule the job.
+The sample startapp.cron file is configured to execute the 
+quarks.samples.topology.Terminated sample application, which terminates the 
+JVM after processing a preset number of tuples.
 
-The script is currently setup to execute the quarks.samples.topology.Terminated
-sample, which throws an exception after processing a preset number of 
-tuples.
-
-The crontab entry file startapp.cron contains information which cron uses to
-schedule the job. 
-
-To setup the script to run as a cron job:
+To setup cron to restart quarks.samples.topology.Terminated every minute:
 
 1. Edit the startapp.cron file:
- - Set the QUARKS environment variable to point to your quarks installation,
-   for example: QUARKS=/home/your_userid/quarks-release/quarks/java8
- - Make sure java is in the path; cron provides a default PATH environment 
-   variable which is probably different from the one you use for development.
+   - Set the QUARKS environment variable to point to your quarks installation,
+     for example: QUARKS=/home/your_userid/quarks-release/quarks/java8
+   - Set JAVA_HOME to point to your Java install directory. 
 
-2. Install startapp.cron: 
+2. Install startapp.cron:
 
-$ crontab ./startapp.cron
+   $ crontab ./startapp.cron
 
    Note: if you wish to have your ~/.profile executed you must explicitly
    do so in the crontab entry or in a script called by the entry.
 
 3. To remove the current crontab entries:
 
-$ crontab -r
+   $ crontab -r

http://git-wip-us.apache.org/repos/asf/incubator-quarks/blob/03b8df17/scripts/cron/startapp.cron
----------------------------------------------------------------------
diff --git a/scripts/cron/startapp.cron b/scripts/cron/startapp.cron
index a086a4c..4b5d5c2 100644
--- a/scripts/cron/startapp.cron
+++ b/scripts/cron/startapp.cron
@@ -21,7 +21,7 @@
 # installation:
 # QUARKS=/home/your_userid/quarks/java8
 #
-# Make sure that java is in the PATH environment used by cron:
-# PATH=/opt/my_java/bin:$PATH
+# Make sure that JAVA_HOME is set in the environment used by cron:
+# JAVA_HOME=/usr/lib/jvm/jre
 
-* * * * * $QUARKS/scripts/cron/startapp.sh /tmp >> /tmp/quarks-cron.log
+* * * * * $QUARKS/scripts/cron/startapp.sh $QUARKS/samples/lib/quarks.samples.topology.jar
quarks.samples.topology.TerminateAfterNTuples /tmp >> /tmp/quarks-cron.log


Mime
View raw message