Index: head/devel/jakarta-commons-daemon/Makefile =================================================================== --- head/devel/jakarta-commons-daemon/Makefile (revision 454757) +++ head/devel/jakarta-commons-daemon/Makefile (revision 454758) @@ -1,42 +1,42 @@ # Created by: Ronald Klop # $FreeBSD$ PORTNAME= commons-daemon -PORTVERSION= 1.0.15 +PORTVERSION= 1.1.0 CATEGORIES= devel java MASTER_SITES= APACHE_COMMONS_SOURCE:src \ APACHE_COMMONS_BINARIES:bin PKGNAMEPREFIX= jakarta- DISTFILES= ${PORTNAME}-${PORTVERSION}-native-src${EXTRACT_SUFX}:src \ ${PORTNAME}-${PORTVERSION}-bin${EXTRACT_SUFX}:bin MAINTAINER= ale@FreeBSD.org COMMENT= Wrapper code to start/stop a Java application as a daemon -BROKEN_armv6= fails to compile: 'jni_md.h' file not found - LICENSE= APACHE20 + +BROKEN_armv6= fails to compile: 'jni_md.h' file not found OPTIONS_DEFINE= DOCS USE_JAVA= yes JAVA_VERSION= 1.6+ JAVA_OS= native GNU_CONFIGURE= yes CONFIGURE_ARGS= --with-java=${JAVA_HOME} WRKSRC= ${WRKDIR}/${DISTNAME}-native-src/unix WRKBIN= ${WRKDIR}/${DISTNAME} PLIST_FILES= bin/jsvc %%JAVAJARDIR%%/${PORTNAME}.jar PORTDOCS= * do-install: ${INSTALL_PROGRAM} ${WRKSRC}/jsvc ${STAGEDIR}${PREFIX}/bin ${INSTALL_DATA} ${WRKBIN}/${DISTNAME}.jar \ ${STAGEDIR}${JAVAJARDIR}/${PORTNAME}.jar ${MKDIR} ${STAGEDIR}${DOCSDIR} cd ${WRKBIN} && ${COPYTREE_SHARE} apidocs ${STAGEDIR}${DOCSDIR} .include Index: head/devel/jakarta-commons-daemon/distinfo =================================================================== --- head/devel/jakarta-commons-daemon/distinfo (revision 454757) +++ head/devel/jakarta-commons-daemon/distinfo (revision 454758) @@ -1,4 +1,5 @@ -SHA256 (commons-daemon-1.0.15-native-src.tar.gz) = e98d96c7c71e02d1a05ce1c417eedb588678ccecc55ba2e9ae2969e4ea910a90 -SIZE (commons-daemon-1.0.15-native-src.tar.gz) = 204944 -SHA256 (commons-daemon-1.0.15-bin.tar.gz) = 0dab09bd0d2028000367a6d5c1592b92c71b561a3f98838f6162ae1623e139d8 -SIZE (commons-daemon-1.0.15-bin.tar.gz) = 232233 +TIMESTAMP = 1511441946 +SHA256 (commons-daemon-1.1.0-native-src.tar.gz) = 11962bc602619fd2eeb840f74a8c63cc1055221f0cc385a1fa906e758d39888d +SIZE (commons-daemon-1.1.0-native-src.tar.gz) = 207125 +SHA256 (commons-daemon-1.1.0-bin.tar.gz) = 0e2c282da674cc5d351b4d7884997eb63472f03f37bf54b210cdef62d07120d7 +SIZE (commons-daemon-1.1.0-bin.tar.gz) = 199681 Index: head/devel/jakarta-commons-daemon/files/patch-man_jsvc.1.xml =================================================================== --- head/devel/jakarta-commons-daemon/files/patch-man_jsvc.1.xml (revision 454757) +++ head/devel/jakarta-commons-daemon/files/patch-man_jsvc.1.xml (revision 454758) @@ -1,10 +1,10 @@ ---- man/jsvc.1.xml.orig 2012-06-13 12:42:23.000000000 +0200 -+++ man/jsvc.1.xml 2012-06-13 12:43:29.000000000 +0200 -@@ -142,7 +142,6 @@ +--- man/jsvc.1.xml.orig 2017-11-15 11:59:37 UTC ++++ man/jsvc.1.xml +@@ -143,7 +143,6 @@ waittime wait up to waittime seconds for the service to start - waittime should multiple of 10 (min=10) Index: head/devel/jakarta-commons-daemon/files/patch-native_arguments.c =================================================================== --- head/devel/jakarta-commons-daemon/files/patch-native_arguments.c (revision 454757) +++ head/devel/jakarta-commons-daemon/files/patch-native_arguments.c (revision 454758) @@ -1,22 +1,22 @@ ---- native/arguments.c.orig 2012-02-24 00:24:02.000000000 +0100 -+++ native/arguments.c 2012-06-13 13:15:57.000000000 +0200 -@@ -158,7 +158,7 @@ +--- native/arguments.c.orig 2017-11-02 13:10:04 UTC ++++ native/arguments.c +@@ -157,7 +157,7 @@ static arg_data *parse(int argc, char *a args->help = false; /* Don't display help */ args->chck = false; /* Don't do a check-only startup */ args->stop = false; /* Stop a running jsvc */ - args->wait = 0; /* Wait until jsvc has started the JVM */ + args->wait = 10; /* Wait until jsvc has started the JVM */ + args->restarts = -1; /* Infinite restarts by default */ args->install = false; /* Don't install as a service */ args->remove = false; /* Don't remove the installed service */ - args->service = false; /* Don't run as a service */ -@@ -262,10 +262,6 @@ +@@ -270,10 +270,6 @@ static arg_data *parse(int argc, char *a temp = optional(argc, argv, x++); if (temp) args->wait = atoi(temp); - if (args->wait < 10) { - log_error("Invalid wait time specified (min=10)"); - return NULL; - } } - else if (!strcmp(argv[x], "-umask")) { + else if (!strcmp(argv[x], "-restarts")) { temp = optional(argc, argv, x++); Index: head/devel/jakarta-commons-daemon/files/patch-native_jsvc-unix.c =================================================================== --- head/devel/jakarta-commons-daemon/files/patch-native_jsvc-unix.c (revision 454757) +++ head/devel/jakarta-commons-daemon/files/patch-native_jsvc-unix.c (revision 454758) @@ -1,70 +1,76 @@ ---- native/jsvc-unix.c.orig 2012-02-24 00:24:02.000000000 +0100 -+++ native/jsvc-unix.c 2012-06-13 12:40:54.000000000 +0200 -@@ -621,18 +621,13 @@ +--- native/jsvc-unix.c.orig 2017-11-15 11:51:22 UTC ++++ native/jsvc-unix.c +@@ -717,18 +717,13 @@ static void remove_tmp_file(arg_data *ar */ static int wait_child(arg_data *args, int pid) { - int count = 10; + int count = args->wait; bool havejvm = false; int fd; char buff[80]; - int i, status, waittime; + int i, status; log_debug("wait_child %d", pid); - waittime = args->wait / 10; - if (waittime > 10) { - count = waittime; - waittime = 10; - } while (count > 0) { sleep(1); /* check if the controler is still running */ -@@ -671,7 +666,6 @@ +@@ -767,7 +762,6 @@ static int wait_child(arg_data *args, in } } } - sleep(waittime); count--; } /* It takes more than the wait time to start, -@@ -801,11 +795,11 @@ +@@ -901,11 +895,11 @@ static int child(arg_data *args, home_da create_tmp_file(args); while (!stopping) { #if defined(OSD_POSIX) - java_sleep(60); + java_sleep(1); /* pause(); */ #else /* pause() is not threadsafe */ - sleep(60); + sleep(1); #endif if(doreopen) { doreopen = false; -@@ -824,7 +818,7 @@ +@@ -924,7 +918,7 @@ static int child(arg_data *args, home_da return 6; if (doreload == true) - ret = 123; + ret = 124; else ret = 0; -@@ -1212,12 +1206,12 @@ +@@ -1341,10 +1335,10 @@ static int run_controller(arg_data *args if (args->vers != true && args->chck != true && status != 122) - unlink(args->pidf); + remove_pid_file(args, pid); - /* If the child got out with 123 he wants to be restarted */ + /* If the child got out with 123 or 124 he wants to be restarted */ /* See java_abort123 (we use this return code to restart when the JVM aborts) */ -- if (status == 123) { -+ if (status == 123 || status == 124) { - log_debug("Reloading service"); - /* prevent looping */ -- if (laststart + 60 > time(NULL)) { -+ if (status == 123 && laststart + 60 > time(NULL)) { - log_debug("Waiting 60 s to prevent looping"); - sleep(60); - } + if (!stopping) { +- if (status == 123) { ++ if (status == 123 || status == 124) { + if (args->restarts == 0) { + log_debug("Service failure, restarts disabled"); + return 1; +@@ -1356,7 +1350,7 @@ static int run_controller(arg_data *args + log_debug("Reloading service"); + restarts++; + /* prevent looping */ +- if (laststart + 60 > time(NULL)) { ++ if (status == 123 && laststart + 60 > time(NULL)) { + log_debug("Waiting 60 s to prevent looping"); + sleep(60); + }