diff options
author | Ernst de Haan <znerd@FreeBSD.org> | 2002-05-08 22:00:04 +0000 |
---|---|---|
committer | Ernst de Haan <znerd@FreeBSD.org> | 2002-05-08 22:00:04 +0000 |
commit | 156b71b59f6afc3092ffb99270dc62b994d39002 (patch) | |
tree | e45c063c60b3060d59c6c2bc3dbc2a04e1aeb557 /www/tomcat41/files | |
parent | Improved the startup script. Always displaying a space first (diff) |
Changed daemonctl program to check if the JAR file exists before
trying to start the JVM. This is a serious usability improvement.
Bumped PORTREVISION.
Diffstat (limited to 'www/tomcat41/files')
-rw-r--r-- | www/tomcat41/files/daemonctl.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/www/tomcat41/files/daemonctl.c b/www/tomcat41/files/daemonctl.c index 6e9a6b25b4b7..5a3684a39d82 100644 --- a/www/tomcat41/files/daemonctl.c +++ b/www/tomcat41/files/daemonctl.c @@ -4,7 +4,7 @@ * * Daemon control program. * - * $FreeBSD: /tmp/pcvs/ports/www/tomcat41/files/Attic/daemonctl.c,v 1.5 2002-04-08 21:50:22 znerd Exp $ + * $FreeBSD: /tmp/pcvs/ports/www/tomcat41/files/Attic/daemonctl.c,v 1.6 2002-05-08 22:00:04 znerd Exp $ */ #include <assert.h> @@ -36,6 +36,7 @@ #define ERR_ALREADY_RUNNING 6 #define ERR_NOT_RUNNING 7 #define ERR_CHDIR_TO_APP_HOME 8 +#define ERR_ACCESS_JAR_FILE 17 #define ERR_STDOUT_LOGFILE_OPEN 9 #define ERR_STDERR_LOGFILE_OPEN 10 #define ERR_FORK_FAILED 11 @@ -370,6 +371,15 @@ void start(void) { exit(ERR_CHDIR_TO_APP_HOME); } + /* See if the JAR file exists */ + result = access("%%APP_HOME%%/%%JAR_FILE%%", R_OK); + if (result < 0) { + printf(" [ FAILED ]\n"); + fprintf(stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to access JAR file %%APP_HOME%%/%%JAR_FILE%%: "); + perror(NULL); + exit(ERR_ACCESS_JAR_FILE); + } + /* Open the stdout log file */ stdoutLogFile = open("%%STDOUT_LOG%%", O_WRONLY); if (stdoutLogFile < 0) { |