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

Damien Raude-Morvan drazzib at alioth.debian.org
Sun Sep 5 16:58:56 UTC 2010


Author: drazzib
Date: 2010-09-05 16:58:52 +0000 (Sun, 05 Sep 2010)
New Revision: 12970

Added:
   trunk/commons-daemon/debian/patches/jsvc_reopen_usr1.diff
Modified:
   trunk/commons-daemon/debian/changelog
   trunk/commons-daemon/debian/patches/series
Log:
d/patches/jsvc_reopen_usr1.diff:
Make jsvc reopen log files on SIGUSR1 (Closes: #460183).

Modified: trunk/commons-daemon/debian/changelog
===================================================================
--- trunk/commons-daemon/debian/changelog	2010-09-05 16:08:01 UTC (rev 12969)
+++ trunk/commons-daemon/debian/changelog	2010-09-05 16:58:52 UTC (rev 12970)
@@ -1,3 +1,10 @@
+commons-daemon (1.0.3-2) unstable; urgency=low
+
+  * d/patches/jsvc_reopen_usr1.diff:
+    Make jsvc reopen log files on SIGUSR1 (Closes: #460183).
+
+ -- Damien Raude-Morvan <drazzib at debian.org>  Tue, 31 Aug 2010 00:26:47 +0200
+
 commons-daemon (1.0.3-1) unstable; urgency=low
 
   * New upstream release.

Added: trunk/commons-daemon/debian/patches/jsvc_reopen_usr1.diff
===================================================================
--- trunk/commons-daemon/debian/patches/jsvc_reopen_usr1.diff	                        (rev 0)
+++ trunk/commons-daemon/debian/patches/jsvc_reopen_usr1.diff	2010-09-05 16:58:52 UTC (rev 12970)
@@ -0,0 +1,70 @@
+Description: make jsvc reopen log files on SIGUSR1
+ Used to handle logrotate.
+Bug: http://bugs.debian.org/460183
+Author: Damien Raude-Morvan <drazzib at debian.org>
+Last-Update: 2010-08-31
+Forwared: yes, https://issues.apache.org/jira/browse/DAEMON-95
+
+--- a/src/native/unix/native/jsvc-unix.c
++++ b/src/native/unix/native/jsvc-unix.c
+@@ -54,10 +54,14 @@
+ pid_t logger_pid=0;     /* the logger process pid */
+ static bool stopping = false;
+ static bool doreload = false;
++static bool doreopen = false;
+ static void (*handler_int) (int) = NULL;
++static void (*handler_usr1) (int) = NULL;
+ static void (*handler_hup) (int) = NULL;
+ static void (*handler_trm) (int) = NULL;
+ 
++static void set_output(char *outfile, char *errfile, bool redirectstdin,
++                       char *procname);
+ static int run_controller(arg_data *args, home_data *data, uid_t uid,
+                           gid_t gid);
+ 
+@@ -119,6 +123,10 @@
+                 doreload = true;
+             }
+         break;
++        case SIGUSR1:
++             log_debug("Caught SIGUSR1: Reopening logs");
++             doreopen = true;
++        break;
+         default:
+             log_debug("Caught unknown signal %d", sig);
+         break;
+@@ -359,6 +367,7 @@
+         case SIGTERM:
+         case SIGINT:
+         case SIGHUP:
++        case SIGUSR1:
+             log_debug("Forwarding signal %d to process %d", sig, controlled);
+             kill(controlled, sig);
+             signal(sig, controller);
+@@ -693,6 +702,7 @@
+ 
+     /* Install signal handlers */
+     handler_hup = signal_set(SIGHUP, handler);
++    handler_usr1 = signal_set(SIGUSR1, handler);
+     handler_trm = signal_set(SIGTERM, handler);
+     handler_int = signal_set(SIGINT, handler);
+     controlled = getpid();
+@@ -707,6 +717,10 @@
+         /* pause() is not threadsafe */
+         sleep(60);
+ #endif
++        if(doreopen) {
++            doreopen = false;
++            set_output(args->outfile, args->errfile, args->redirectstdin, args->procname);
++        }
+     }
+     remove_tmp_file(args);
+     log_debug("Shutdown or reload requested: exiting");
+@@ -1028,6 +1042,7 @@
+         SetTerm(cygwincontroller);
+ #endif
+         signal(SIGHUP, controller);
++        signal(SIGUSR1, controller);
+         signal(SIGTERM, controller);
+         signal(SIGINT, controller);
+ 

Modified: trunk/commons-daemon/debian/patches/series
===================================================================
--- trunk/commons-daemon/debian/patches/series	2010-09-05 16:08:01 UTC (rev 12969)
+++ trunk/commons-daemon/debian/patches/series	2010-09-05 16:58:52 UTC (rev 12970)
@@ -6,3 +6,4 @@
 arm_support.diff
 hurd_support.diff
 syslog.diff
+jsvc_reopen_usr1.diff




More information about the pkg-java-commits mailing list