Bug#460183: jsvc: apply patch to make jsc reopen log files on SIGUSR1

2008-04-01 Thread Александр Николаевич Головко
Fixed stupid error in previous patch, available on
http://lists.alioth.debian.org/pipermail/pkg-java-maintainers/2008-March/016040.html

-- 
С уважением,
Александр Николаевич Головко
системный администратор
ЗАО Стек Софт
[EMAIL PROTECTED]
+7-495-9806005 доб.274
ôÏÌØËÏ × 123/src/native/unix: autom4te.cache
ôÏÌØËÏ × 123/src/native/unix: configure
diff -ur 123.orig/src/native/unix/native/jsvc-unix.c 123/src/native/unix/native/jsvc-unix.c
--- 123.orig/src/native/unix/native/jsvc-unix.c	2008-03-27 16:33:39.0 +0300
+++ 123/src/native/unix/native/jsvc-unix.c	2008-04-01 11:06:43.0 +0400
@@ -43,19 +43,25 @@
 #endif
 
 extern char **environ;
+arg_data *args=NULL;
+home_data *data=NULL;
 
 static mode_t envmask; /* mask to create the files */
 
 pid_t controlled=0; /* the son process pid */
 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_hup)(int)=NULL;
+static void (*handler_usr1)(int)=NULL;
 static void (*handler_trm)(int)=NULL;
 
 static int run_controller(arg_data *args, home_data *data, uid_t uid,
   gid_t gid);
+static void set_output(char *outfile, char *errfile, char *procname);
+static void * signal_set(int sig, void * newHandler);
+
 
 #ifdef OS_CYGWIN
 /*
@@ -117,6 +123,13 @@
 break;
 }
 
+	case SIGUSR1: {
+	log_debug(Caught SIGUSR1: Reopening logs);
+	set_output(args-outfile, args-errfile, args-procname);
+handler_usr1=signal_set(SIGUSR1,handler);
+	break;
+	}
+
 default: {
 log_debug(Caught unknown signal %d,sig);
 break;
@@ -283,6 +296,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);
@@ -575,6 +589,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();
@@ -751,8 +766,6 @@
 }
 
 int main(int argc, char *argv[]) {
-arg_data *args=NULL;
-home_data *data=NULL;
 pid_t pid=0;
 uid_t uid=0;
 gid_t gid=0;
@@ -885,6 +898,7 @@
SetTerm(cygwincontroller);
 #endif
 signal(SIGHUP, controller);
+signal(SIGUSR1, controller);
 signal(SIGTERM, controller);
 signal(SIGINT, controller);
 
___
pkg-java-maintainers mailing list
pkg-java-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-java-maintainers

Bug#460183: jsvc: apply patch to make jsc reopen log files on SIGUSR1

2008-01-21 Thread Michael Koch
On Fri, Jan 11, 2008 at 05:41:10AM +, David Pashley wrote:
 Package: jsvc
 Severity: wishlist
 Tags: patch
 
 https://issues.apache.org/jira/browse/DAEMON-95 includes a patch to
 reopen the log files used for stdout and stderr. This would allow, among
 other things, to have a working logrotate setup for tomcat. Given that
 last time I looked jsvc had a 2GB file limit, this could be a massive
 gain for most people.

That patch is horrible to read, even in its plain-text version in the
html page. And its outdated. Some stuff is already in our sources or
dont apply anymore due to changes.

Can you please create a clean patch based on it and test it? That would
help alot.


Cheers,
Michael



___
pkg-java-maintainers mailing list
pkg-java-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-java-maintainers


Bug#460183: jsvc: apply patch to make jsc reopen log files on SIGUSR1

2008-01-10 Thread David Pashley
Package: jsvc
Severity: wishlist
Tags: patch

https://issues.apache.org/jira/browse/DAEMON-95 includes a patch to
reopen the log files used for stdout and stderr. This would allow, among
other things, to have a working logrotate setup for tomcat. Given that
last time I looked jsvc had a 2GB file limit, this could be a massive
gain for most people.

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-k7
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)



___
pkg-java-maintainers mailing list
pkg-java-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-java-maintainers