mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-08 09:23:13 +02:00
- Fixed a /RESTART issue on Linux: Unreal did not properly close all file-
descriptors. Because of this, Unreal did not restart properly as you would get an "Address already in use" error. This only seemed to happen when logging to syslog. - Fixed a similar issue with syslog (and debugmode) and closing fd's as well: the first port we listened on would not open up, ircd did not log any error.
This commit is contained in:
@@ -1894,3 +1894,9 @@
|
||||
not exist, it now asks you if you want to automatically download and
|
||||
install curl (which is done by ./curlinstall).
|
||||
This has been tested on Linux, further testing on f.e. FreeBSD is required.
|
||||
- Fixed a /RESTART issue on Linux: Unreal did not properly close all file-
|
||||
descriptors. Because of this, Unreal did not restart properly as you would
|
||||
get an "Address already in use" error. This only seemed to happen when
|
||||
logging to syslog.
|
||||
- Fixed a similar issue with syslog (and debugmode) and closing fd's as well:
|
||||
the first port we listened on would not open up, ircd did not log any error.
|
||||
|
||||
+1
-2
@@ -361,8 +361,7 @@ void server_reboot(char *mesg)
|
||||
if (!(bootopt & (BOOT_TTY | BOOT_DEBUG)))
|
||||
(void)close(2);
|
||||
(void)close(1);
|
||||
if ((bootopt & BOOT_CONSOLE) || isatty(0))
|
||||
(void)close(0);
|
||||
(void)close(0);
|
||||
(void)execv(MYNAME, myargv);
|
||||
#else
|
||||
close_connections();
|
||||
|
||||
@@ -605,6 +605,9 @@ char logbuf[BUFSIZ];
|
||||
# endif
|
||||
#endif
|
||||
#ifndef _WIN32
|
||||
#ifdef HAVE_SYSLOG
|
||||
closelog(); /* temporary close syslog, as we mass close() fd's below... */
|
||||
#endif
|
||||
#ifndef NOCLOSEFD
|
||||
for (fd = 3; fd < MAXCONNECTIONS; fd++)
|
||||
{
|
||||
@@ -655,6 +658,9 @@ init_dgram:
|
||||
close(fileno(stdout));
|
||||
if (!(bootopt & BOOT_DEBUG))
|
||||
close(fileno(stderr));
|
||||
#endif
|
||||
#ifdef HAVE_SYSLOG
|
||||
openlog("ircd", LOG_PID | LOG_NDELAY, LOG_DAEMON); /* reopened now */
|
||||
#endif
|
||||
memset(local, 0, sizeof(aClient*) * MAXCONNECTIONS);
|
||||
LastSlot = -1;
|
||||
|
||||
Reference in New Issue
Block a user