[pkg-java] r12845 - in trunk/commons-daemon/debian: . patches

Damien Raude-Morvan drazzib at alioth.debian.org
Sat Jul 31 17:25:04 UTC 2010


Author: drazzib
Date: 2010-07-31 17:25:04 +0000 (Sat, 31 Jul 2010)
New Revision: 12845

Removed:
   trunk/commons-daemon/debian/patches/old_capabilities.diff
Modified:
   trunk/commons-daemon/debian/changelog
   trunk/commons-daemon/debian/patches/libgcj_PR31700.diff
   trunk/commons-daemon/debian/patches/series
   trunk/commons-daemon/debian/patches/syslog.diff
Log:
* New upstream release (UNRELEASED).
  - debian/patches/old_capabilities.diff: merged upstream.
  - no more prebuilt ELF objects in source tarball.

Modified: trunk/commons-daemon/debian/changelog
===================================================================
--- trunk/commons-daemon/debian/changelog	2010-07-31 17:21:27 UTC (rev 12844)
+++ trunk/commons-daemon/debian/changelog	2010-07-31 17:25:04 UTC (rev 12845)
@@ -1,3 +1,11 @@
+commons-daemon (1.0.3-1) UNRELEASED; urgency=low
+
+  * New upstream release (UNRELEASED).
+    - debian/patches/old_capabilities.diff: merged upstream.
+    - no more prebuilt ELF objects in source tarball.
+
+ -- Damien Raude-Morvan <drazzib at debian.org>  Sat, 31 Jul 2010 19:24:37 +0200
+
 commons-daemon (1.0.2-2) unstable; urgency=low
 
   * Re-add missing patches (lost during merge of new upstream release):

Modified: trunk/commons-daemon/debian/patches/libgcj_PR31700.diff
===================================================================
--- trunk/commons-daemon/debian/patches/libgcj_PR31700.diff	2010-07-31 17:21:27 UTC (rev 12844)
+++ trunk/commons-daemon/debian/patches/libgcj_PR31700.diff	2010-07-31 17:25:04 UTC (rev 12845)
@@ -4,12 +4,12 @@
 Last-Update: 2010-07-28
 --- a/src/native/unix/native/java.c
 +++ b/src/native/unix/native/java.c
-@@ -201,7 +201,7 @@
-         return(false);
+@@ -224,7 +224,7 @@
+         return false;
      }
  #endif
--    arg.ignoreUnrecognized=FALSE;
-+    arg.ignoreUnrecognized=JNI_TRUE;
-     arg.nOptions=args->onum;
-     arg.nOptions++; /* Add abort code */
-     opt=(JavaVMOption *)malloc(arg.nOptions*sizeof(JavaVMOption));
+-    arg.ignoreUnrecognized = FALSE;
++    arg.ignoreUnrecognized = JNI_TRUE;
+     arg.nOptions = args->onum;
+     arg.nOptions++;             /* Add abort code */
+     opt = (JavaVMOption *) malloc(arg.nOptions * sizeof(JavaVMOption));

Deleted: trunk/commons-daemon/debian/patches/old_capabilities.diff
===================================================================
--- trunk/commons-daemon/debian/patches/old_capabilities.diff	2010-07-31 17:21:27 UTC (rev 12844)
+++ trunk/commons-daemon/debian/patches/old_capabilities.diff	2010-07-31 17:25:04 UTC (rev 12845)
@@ -1,28 +0,0 @@
-Description: Patch to handle old capabilities version in jsvc-unix.c
- Print a useful error message if capabilities module is missing.
-Bug: http://bugs.debian.org/412690
-Bug: http://bugs.debian.org/412478
-Author: Mickael Kock <konqueror at gmx.de>
-Author: Marcus Better <marcus at better.se>
-Last-Update: 2010-07-28
-Forwarded: yes, https://issues.apache.org/jira/browse/DAEMON-168
---- a/src/native/unix/native/jsvc-unix.c
-+++ b/src/native/unix/native/jsvc-unix.c
-@@ -171,14 +171,15 @@
-     struct __user_cap_data_struct cap;
-  
-     memset(&caphead, 0, sizeof caphead);
--    caphead.version = _LINUX_CAPABILITY_VERSION;
-+    caphead.version = 0x19980330;
-     caphead.pid = 0;
-     memset(&cap, 0, sizeof cap);
-     cap.effective = caps;
-     cap.permitted = caps;
-     cap.inheritable = caps;
-     if (syscall(__NR_capset, &caphead, &cap) < 0) {
--        log_error("syscall failed in set_caps");
-+        log_error("set_caps: failed to set capabilities");
-+        log_error("check that your kernel supports capabilities");
-         return(-1);
-     }
-     return(0);

Modified: trunk/commons-daemon/debian/patches/series
===================================================================
--- trunk/commons-daemon/debian/patches/series	2010-07-31 17:21:27 UTC (rev 12844)
+++ trunk/commons-daemon/debian/patches/series	2010-07-31 17:25:04 UTC (rev 12845)
@@ -1,4 +1,3 @@
-old_capabilities.diff
 libgcj_PR31700.diff
 sh4_support.diff
 kfreebsd_support.diff

Modified: trunk/commons-daemon/debian/patches/syslog.diff
===================================================================
--- trunk/commons-daemon/debian/patches/syslog.diff	2010-07-31 17:21:27 UTC (rev 12844)
+++ trunk/commons-daemon/debian/patches/syslog.diff	2010-07-31 17:25:04 UTC (rev 12845)
@@ -10,59 +10,59 @@
 --- a/src/native/unix/native/debug.c
 +++ b/src/native/unix/native/debug.c
 @@ -15,10 +15,8 @@
-    limitations under the License.
- */
- /* @version $Id: debug.c 480469 2006-11-29 08:22:04Z bayard $ */
+  */
+ 
+ /* @version $Id: debug.c 921765 2010-03-11 10:03:32Z mturk $ */
 +#include <stdio.h>
  #include "jsvc.h"
 -#include <sys/types.h>
 -#include <unistd.h>
--#include <time.h> 
+-#include <time.h>
  
  /* Wether debug is enabled or not */
  bool log_debug_flag = false;
-@@ -29,19 +27,9 @@
- /* Dump a debug message to stderr */
- void log_debug(const char *fmt, ...) {
+@@ -30,21 +28,11 @@
+ void log_debug(const char *fmt, ...)
+ {
      va_list ap;
 -    time_t now;
 -    struct tm *nowtm;
 -    char buff[80];
  
-     if (log_debug_flag==false) return;
--    if (fmt==NULL) return;
+     if (log_debug_flag == false)
+         return;
+-    if (fmt == NULL)
+-        return;
 -
--    now = time(NULL);
+-    now   = time(NULL);
 -    nowtm = localtime(&now);
 -    strftime(buff, sizeof(buff), "%d/%m/%Y %T", nowtm);
--
-     va_start(ap,fmt);
--    fprintf(stderr,"%s %d %s debug: ", buff,  getpid(), log_prog);
-     vfprintf(stderr,fmt,ap);
-     fprintf(stderr,"\n");
+ 
+     va_start(ap, fmt);
+-    fprintf(stderr, "%s %d %s debug: ", buff, getpid(), log_prog);
+     vfprintf(stderr, fmt, ap);
+     fprintf(stderr, "\n");
      fflush(stderr);
-@@ -51,21 +39,11 @@
- /* Dump an error message to stderr */
- void log_error(const char *fmt, ...) {
+@@ -55,19 +43,11 @@
+ void log_error(const char *fmt, ...)
+ {
      va_list ap;
 -    time_t now;
 -    struct tm *nowtm;
 -    char buff[80];
  
-     if (fmt==NULL) return;
--
+     if (fmt == NULL)
+         return;
+ 
 -    now = time(NULL);
 -    nowtm = localtime(&now);
 -    strftime(buff, sizeof(buff), "%d/%m/%Y %T", nowtm);
 -
-     va_start(ap,fmt);
--    fprintf(stderr,"%s %d %s error: ", buff, getpid(), log_prog);
-     vfprintf(stderr,fmt,ap);
-     fprintf(stderr,"\n");
+     va_start(ap, fmt);
+-    fprintf(stderr, "%s %d %s error: ", buff, getpid(), log_prog);
+     vfprintf(stderr, fmt, ap);
+     fprintf(stderr, "\n");
      fflush(stderr);
-     va_end(ap);
- }
--
 --- a/src/native/unix/native/jsvc-unix.c
 +++ b/src/native/unix/native/jsvc-unix.c
 @@ -24,8 +24,11 @@
@@ -77,26 +77,25 @@
  #ifdef OS_LINUX
  #include <sys/prctl.h>
  #include <sys/syscall.h>
-@@ -45,12 +48,17 @@
- static mode_t envmask; /* mask to create the files */
+@@ -48,12 +51,16 @@
+ static mode_t envmask;          /* mask to create the files */
  
- pid_t controlled=0; /* the child process pid */
+ pid_t controlled = 0;           /* the child process pid */
 +pid_t logger_pid=0;     /* the logger process pid */
- static bool stopping=false;
- static bool doreload=false;
- static void (*handler_int)(int)=NULL;
- static void (*handler_hup)(int)=NULL;
- static void (*handler_trm)(int)=NULL;
+ static bool stopping = false;
+ static bool doreload = false;
+ static void (*handler_int) (int) = NULL;
+ static void (*handler_hup) (int) = NULL;
+ static void (*handler_trm) (int) = NULL;
  
 +static int run_controller(arg_data *args, home_data *data, uid_t uid,
 +                          gid_t gid);
 +
-+
  #ifdef OS_CYGWIN
  /*
   * File locking routine
-@@ -625,10 +633,62 @@
-     return(freopen(outfile,mode,stream));
+@@ -741,11 +748,63 @@
+     return freopen(outfile, mode, stream);
  }
  
 +#define LOGBUF_SIZE 1024
@@ -152,19 +151,19 @@
  /**
   *  Redirect stdin, stdout, stderr.
   */
--static void set_output(char *outfile, char *errfile, bool redirectstdin) {
-+static void set_output(char *outfile, char *errfile, bool redirectstdin, char *procname) {
+-static void set_output(char *outfile, char *errfile, bool redirectstdin)
++static void set_output(char *outfile, char *errfile, bool redirectstdin, char *procname)
+ {
 +    int out_pipe[2] = {0, 0}, err_pipe[2] = {0, 0}, fork_needed = 0;
 +
-     if (redirectstdin==true) {
+     if (redirectstdin == true) {
          freopen("/dev/null", "r", stdin);
      }
-@@ -643,12 +703,30 @@
-     if(strcmp(outfile, "&2") == 0 && strcmp(errfile,"&1") == 0) {
-       outfile="/dev/null";
+@@ -760,11 +819,29 @@
+     if (strcmp(outfile, "&2") == 0 && strcmp(errfile, "&1") == 0) {
+         outfile = "/dev/null";
      }
--    if(strcmp(outfile, "&2") != 0) {
--      loc_freopen(outfile, "a", stdout);
+-    if (strcmp(outfile, "&2") != 0) {
 +    if (strcmp(outfile, "SYSLOG") == 0) {
 +        freopen("/dev/null", "a", stdout);
 +        /* Send stdout to syslog through a logger process */
@@ -175,11 +174,10 @@
 +            fork_needed = 1;
 +        }
 +    } else if (strcmp(outfile, "&2") != 0) {
-+        loc_freopen(outfile, "a", stdout);
+         loc_freopen(outfile, "a", stdout);
      }
  
--    if(strcmp(errfile,"&1") != 0) {
--      loc_freopen(errfile, "a", stderr);
+-    if (strcmp(errfile, "&1") != 0) {
 +    if (strcmp(errfile, "SYSLOG") == 0) {
 +        freopen("/dev/null", "a", stderr);
 +        /* Send stderr to syslog through a logger process */
@@ -190,14 +188,13 @@
 +            fork_needed = 1;
 +        }
 +    } else if (strcmp(errfile, "&1") != 0) {
-+        loc_freopen(errfile, "a", stderr);
-     } else {
-       close(2);
-       dup(1);
-@@ -657,16 +735,42 @@
-       close(1);
-       dup(2);
+         loc_freopen(errfile, "a", stderr);
      }
+     else {
+@@ -775,17 +852,43 @@
+         close(1);
+         dup(2);
+     }
 +
 +    if (fork_needed) {
 +        pid_t pid = fork();
@@ -227,20 +224,21 @@
 +    }
  }
  
- int main(int argc, char *argv[]) {
-     arg_data *args=NULL;
-     home_data *data=NULL;
--    int status=0;
-     pid_t pid=0;
-     uid_t uid=0;
-     gid_t gid=0;
+ int main(int argc, char *argv[])
+ {
+     arg_data *args  = NULL;
+     home_data *data = NULL;
+-    int status = 0;
+     pid_t pid  = 0;
+     uid_t uid  = 0;
+     gid_t gid  = 0;
 -    time_t laststart;
 +    int res;
  
      /* Parse command line arguments */
-     args=arguments(argc,argv);
-@@ -689,7 +793,7 @@
-         return(0);
+     args = arguments(argc, argv);
+@@ -811,7 +914,7 @@
+         return 0;
      }
  
 -#ifdef OS_LINUX
@@ -248,7 +246,7 @@
      /* On some UNIX operating systems, we need to REPLACE this current
         process image with another one (thru execve) to allow the correct
         loading of VMs (notably this is for Linux). Set, replace, and go. */
-@@ -763,24 +867,39 @@
+@@ -890,11 +993,27 @@
      }
  
      envmask = umask(0077);
@@ -267,43 +265,19 @@
 +                          gid_t gid)
 +{
 +    pid_t pid=0;
++
  
      /* We have to fork: this process will become the controller and the other
         will be the child */
-     while ((pid=fork())!=-1) {
+     while ((pid = fork()) != -1) {
 +        time_t laststart;
 +        int status=0;
          /* We forked (again), if this is the child, we go on normally */
-         if (pid==0) exit(child(args,data,uid,gid));
-         laststart = time(NULL);
- 
-         /* We are in the controller, we have to forward all interesting signals
-            to the child, and wait for it to die */
--        controlled=pid;
-+        controlled = pid;
- #ifdef OS_CYGWIN
-        SetTerm(cygwincontroller);
- #endif
--        signal(SIGHUP,controller);
--        signal(SIGTERM,controller);
--        signal(SIGINT,controller);
-+        signal(SIGHUP, controller);
-+        signal(SIGTERM, controller);
-+        signal(SIGINT, controller);
- 
-         while (waitpid(pid,&status,0)!=pid);
- 
-@@ -830,7 +949,6 @@
-     /* Got out of the loop? A fork() failed then. */
-     log_error("Cannot decouple controller/child processes");
-     return(1);
--
- }
- 
- void main_reload(void) {
-@@ -842,4 +960,3 @@
+         if (pid == 0)
+             exit(child(args, data, uid, gid));
+@@ -975,4 +1094,3 @@
      log_debug("Killing self with TERM signal");
-     kill(controlled,SIGTERM);
+     kill(controlled, SIGTERM);
  }
 -
 --- a/src/native/unix/man/jsvc.1.xml




More information about the pkg-java-commits mailing list