Hi all again, Now I had look at the source code of jsvc-unix.c. It looks as jsvc always has to wait for the completion of the sleep(60) call: So I changed the code using usleep(200000): log_debug("Waiting for a signal to be delivered"); create_tmp_file(args); #ifdef OSD_POSIX log_debug("java_sleep"); java_sleep(60); /* pause(); */ #else log_debug("normal sleep"); /* old sleep(60); / * pause() not threadsafe */ usleep(200000); /* 200ms */ log_debug("normal usleep done"); #endif while (!stopping) { #ifdef OSD_POSIX java_sleep(60); /* pause(); */ #else /* old sleep(60); / * pause() not threadsafe */ usleep(200000); /* 200ms */ #endif } remove_tmp_file(args); log_debug("Shutdown or reload requested: exiting");
Now the shutdown is sufficient fast: 08/09/2007 10:33:54 14808 jsvc debug: normal usleep done 08/09/2007 10:34:15 14808 jsvc debug: Caught SIGTERM: Scheduling a shutdown 08/09/2007 10:34:15 14808 jsvc debug: remove_tmp_file: /tmp/14808.jsvc_up 08/09/2007 10:34:15 14808 jsvc debug: Shutdown or reload requested: exiting 08/09/2007 10:34:17 14808 jsvc debug: Daemon stopped successfully 08/09/2007 10:34:17 14808 jsvc debug: Daemon destroyed successfully 08/09/2007 10:34:17 14808 jsvc debug: Calling System.exit(0) 08/09/2007 10:34:17 14807 jsvc debug: Service shut down Is the old behaviour by design or did I made something wrong at building the executable? I used ./configure --with-java=pathtojava and make (I do not have autoconf) Are there better solutions? Thanks Charly SunOS server 5.8 Generic_108528-06 sun4u sparc SUNW,UltraSPARC-IIi-cEngine 2007/9/8, charly <[EMAIL PROTECTED]>: > > Hi all, > > I am using jsvc on solaris to run tomcat on port 80 using a non root > user. Startup and running seems to be ok. > I use the jsvc -stop -pidfile .... to initiate a shutdown. this > command waits until the shutdown is complete. > But in my case it lasts very long until jsvc is actually doing the > shutdown: > > Does anyone know what could be the problem ? > > I