You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by jf...@apache.org on 2006/04/27 12:36:31 UTC
svn commit: r397516 -
/jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c
Author: jfclere
Date: Thu Apr 27 03:36:27 2006
New Revision: 397516
URL: http://svn.apache.org/viewcvs?rev=397516&view=rev
Log:
Also restart when the JVM process is signaled (abort is no always called).
Don't change user when we are already the user.
Modified:
jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c
Modified: jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c?rev=397516&r1=397515&r2=397516&view=diff
==============================================================================
--- jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c (original)
+++ jakarta/commons/proper/daemon/trunk/src/native/unix/native/jsvc-unix.c Thu Apr 27 03:36:27 2006
@@ -132,6 +132,10 @@
} else
log_debug("Cannot set supplement group list for user '%s'",user);
}
+ if (getuid() == uid) {
+ log_debug("No need to change user to '%s'!",user);
+ return(0);
+ }
if (setuid(uid)!=0) {
log_error("Cannot set user id for user '%s'",user);
return(-1);
@@ -794,7 +798,17 @@
/* Otherwise we don't rerun it */
log_error("Service exit with a return value of %d",status);
return(1);
+
} else {
+ if (WIFSIGNALED(status)) {
+ log_error("Service killed by signal %d",WTERMSIG(status));
+ /* prevent looping */
+ if (laststart+60>time(NULL)) {
+ log_debug("Waiting 60 s to prevent looping");
+ sleep(60);
+ }
+ continue;
+ }
log_error("Service did not exit cleanly",status);
return(1);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org