Changeset 1957
- Timestamp:
- 08/21/2007 05:40:03 PM (14 months ago)
- Location:
- branches/lighttpd-1.4.x
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/lighttpd-1.4.x/NEWS
r1948 r1957 6 6 - 1.4.17 - 7 7 * added dir-listing.set-footer in mod_dirlisting (#1277) 8 * added sending UID and PID for SIGTERM and SIGINT to the logs 8 9 * fixed hardcoded font-sizes in mod_dirlisting (#1267) 9 10 * fixed different ETag length on 32/64 platforms (#1279) -
branches/lighttpd-1.4.x/src/log.c
r1371 r1957 127 127 } 128 128 129 log_error_write(srv, __FILE__, __LINE__, "s", "logfiles cycled");130 131 129 return 0; 132 130 } 133 131 134 132 int log_error_close(server *srv) { 135 log_error_write(srv, __FILE__, __LINE__, "s", "server stopped");136 137 133 switch(srv->errorlog_mode) { 138 134 case ERRORLOG_FILE: -
branches/lighttpd-1.4.x/src/server.c
r1873 r1957 71 71 72 72 #if defined(HAVE_SIGACTION) && defined(SA_SIGINFO) 73 static volatile siginfo_t last_sigterm_info; 74 static volatile siginfo_t last_sighup_info; 75 73 76 static void sigaction_handler(int sig, siginfo_t *si, void *context) { 74 UNUSED(si);75 77 UNUSED(context); 76 78 77 79 switch (sig) { 78 case SIGTERM: srv_shutdown = 1; break; 80 case SIGTERM: 81 srv_shutdown = 1; 82 memcpy(&last_sigterm_info, si, sizeof(*si)); 83 break; 79 84 case SIGINT: 80 if (graceful_shutdown) srv_shutdown = 1; 81 else graceful_shutdown = 1; 82 83 break; 84 case SIGALRM: handle_sig_alarm = 1; break; 85 case SIGHUP: handle_sig_hup = 1; break; 86 case SIGCHLD: break; 85 if (graceful_shutdown) { 86 srv_shutdown = 1; 87 } else { 88 graceful_shutdown = 1; 89 } 90 memcpy(&last_sigterm_info, si, sizeof(*si)); 91 92 break; 93 case SIGALRM: 94 handle_sig_alarm = 1; 95 break; 96 case SIGHUP: 97 handle_sig_hup = 1; 98 memcpy(&last_sighup_info, si, sizeof(*si)); 99 break; 100 case SIGCHLD: 101 break; 87 102 } 88 103 } … … 1080 1095 1081 1096 return -1; 1097 } else { 1098 #ifdef HAVE_SIGACTION 1099 log_error_write(srv, __FILE__, __LINE__, "sdsd", 1100 "logfiles cycled UID =", 1101 last_sigterm_info.si_uid, 1102 "PID =", 1103 last_sigterm_info.si_pid); 1104 #else 1105 log_error_write(srv, __FILE__, __LINE__, "s", 1106 "logfiles cycled"); 1107 #endif 1082 1108 } 1083 1109 } … … 1379 1405 } 1380 1406 1407 #ifdef HAVE_SIGACTION 1408 log_error_write(srv, __FILE__, __LINE__, "sdsd", 1409 "server stopped by UID =", 1410 last_sigterm_info.si_uid, 1411 "PID =", 1412 last_sigterm_info.si_pid); 1413 #else 1414 log_error_write(srv, __FILE__, __LINE__, "s", 1415 "server stopped"); 1416 #endif 1417 1381 1418 /* clean-up */ 1382 1419 log_error_close(srv);

