diff options
author | Rong-En Fan <rafan@FreeBSD.org> | 2006-12-16 02:14:26 +0000 |
---|---|---|
committer | Rong-En Fan <rafan@FreeBSD.org> | 2006-12-16 02:14:26 +0000 |
commit | 35a967da9984fa2fd62ef395dfabc7e1cd8bbfdd (patch) | |
tree | 83969bd7a07d0dfa50a246de5e21a6042398b617 /www/resin2/files | |
parent | dc55152eac2d55dc5fe7909a482a906ac38b6ef1 (diff) | |
download | ports-35a967da9984fa2fd62ef395dfabc7e1cd8bbfdd.tar.gz ports-35a967da9984fa2fd62ef395dfabc7e1cd8bbfdd.zip |
Notes
Diffstat (limited to 'www/resin2/files')
-rw-r--r-- | www/resin2/files/pkg-message.in | 15 | ||||
-rw-r--r-- | www/resin2/files/resin.sh.in | 18 | ||||
-rw-r--r-- | www/resin2/files/resinctl | 4 |
3 files changed, 17 insertions, 20 deletions
diff --git a/www/resin2/files/pkg-message.in b/www/resin2/files/pkg-message.in index 490862390511..5eb713703dbd 100644 --- a/www/resin2/files/pkg-message.in +++ b/www/resin2/files/pkg-message.in @@ -30,18 +30,3 @@ Resin configuration is located at %%PREFIX%%/etc/%%APP_NAME%%.xml Enjoy! - --------------------------------------------------------------------------------- -ADVANCED USAGE - -If you need to pass special options to Java, please set the -%%APP_NAME%%_flags option in /etc/rc.conf, see examples below: - - # Prevent Java from opening an X11 display - %%APP_NAME%%_flags="-Djava.awt.headless=true" - - # Increase memory limit of the Java virtual machine - %%APP_NAME%%_flags="-Xms32m -Xmx256m" - - # Run Java with remote debugging turned on on port 8000 - %%APP_NAME%%_flags="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000" diff --git a/www/resin2/files/resin.sh.in b/www/resin2/files/resin.sh.in index a60b51bbcf68..fcbb91485593 100644 --- a/www/resin2/files/resin.sh.in +++ b/www/resin2/files/resin.sh.in @@ -4,6 +4,8 @@ # # PROVIDE: %%APP_NAME%% +# REQUIRE: LOGIN +# KEYWORD: shutdown # # Add the following line to /etc/rc.conf to enable %%APP_NAME%%: @@ -16,10 +18,9 @@ name=%%APP_NAME%% rcvar=`set_rcvar` -command=%%PREFIX%%/sbin/%%APP_NAME%%ctl -command_args="$1" +command="%%PREFIX%%/sbin/%%APP_NAME%%ctl" +command_args="start" pidfile=%%PID_FILE%% -procname=%%JAVA%% # set defaults @@ -28,4 +29,15 @@ procname=%%JAVA%% %%APP_NAME%%_group=${%%APP_NAME%%_group:-"www"} load_rc_config ${name} + +if test -n "${%%APP_NAME%%_java_version}" ; then + JAVA_HOME=$(JAVA_VERSION="${%%APP_NAME%%_java_version}" JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVA_HOME | cut -d= -f2) + procname=$(JAVA_VERSION="${%%APP_NAME%%_java_version}" JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -d= -f2) +else + JAVA_HOME=$(JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVA_HOME | cut -d= -f2) + procname=$(JAVAVM_DRYRUN=1 %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -d= -f2) +fi + +export JAVA_HOME + run_rc_command "$1" diff --git a/www/resin2/files/resinctl b/www/resin2/files/resinctl index f193a4c95d26..886ea3495fa4 100644 --- a/www/resin2/files/resinctl +++ b/www/resin2/files/resinctl @@ -154,7 +154,7 @@ if __name__ == '__main__': APP_NAME = "%%APP_NAME%%" APP_HOME = "%%APP_HOME%%" PID_FILE = "%%PID_FILE%%" - COMMAND = "%%JAVA%%" + COMMAND = "%%PREFIX%%/bin/java" ARGS = [COMMAND] ARGS += sys.argv[1:-1] @@ -165,8 +165,8 @@ if __name__ == '__main__': "-conf", "%%PREFIX%%/etc/%%APP_NAME%%.xml" ] - os.environ['JAVA_HOME'] = "%%JAVA_HOME%%" os.environ['CLASSPATH'] = classpath() + os.environ['PATH'] = "%%LOCALBASE%%/bin:/usr/bin:/bin" if len(sys.argv) < 2: usage() |