Module: ngircd.git
Branch: master
Commit: 50cb321bb1006a97729096451bb4898b78e90582
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=50cb321b…
Author: Alexander Barton <alex(a)barton.de>
Date: Tue Oct 5 23:19:54 2010 +0200
Updated doc/Platforms.txt
---
doc/Platforms.txt | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/doc/Platforms.txt b/doc/Platforms.txt
index 7a6e3a8..e113c04 100644
--- a/doc/Platforms.txt
+++ b/doc/Platforms.txt
@@ -32,22 +32,22 @@ hppa1.1/unknown/linux-gnu gcc 3.3.3 0.8.0 04-05-30 alex Y Y Y Y
hppa2.0/unknown/linux-gnu gcc 3.3.5 13~rc1 08-12-02 alex Y Y Y Y
hppa2.0w-hp-hpux11.11 gcc 4.2.3 14.1 09-07-22 goetz Y Y Y Y
i386/apple/darwin9.7.0 gcc 4.0.1 14.1 09-08-04 alex Y Y Y Y (3)
-i386/apple/darwin10.3.0 gcc 4.2.1 16 10-04-23 alex Y Y Y Y (3)
+i386/apple/darwin10.4.0 gcc 4.2.1 17-dev 10-10-05 alex Y Y Y Y (3)
i386/pc/solaris2.9 gcc 3.2.2 CVSHEAD 04-02-24 alex Y Y Y Y
i386/pc/solaris2.11 gcc 3.4.3 14.1 09-08-03 alex Y Y Y Y (4)
i386/unknown/freebsd5.2.1 gcc 3.3.3 0.8.0 04-05-30 alex Y Y Y Y
i386/unknown/freebsd6.0 gcc 3.4.4 0.10.0-p1 06-08-04 alex Y Y Y Y (3)
i386/unknown/freebsd6.1 gcc 3.4.4 CVSHEAD 06-05-07 fw Y Y Y Y (3)
-i386/unknown/freebsd6.2 gcc 3.4.6 16 10-04-11 alex Y Y Y Y (3)
+i386/unknown/freebsd6.2 gcc 3.4.6 17-dev 10-10-05 alex Y Y Y Y (3)
i386/unknown/freebsd7.0 gcc 4.2.1 14.1 09-07-28 alex Y Y Y Y (3)
i386/unknown/freebsd7.2 gcc 4.2.1 14.1 09-08-03 alex Y Y Y Y (3)
-i386/unknown/freebsd7.3 gcc 4.2.1 16 10-04-11 alex Y Y Y Y (3)
+i386/unknown/freebsd7.3 gcc 4.2.1 17-dev 10-10-05 alex Y Y Y Y (3)
i386/unknown/gnu0.3 gcc 3.3.3 0.8.0 04-05-30 alex Y Y n Y
i686/unknown/gnu0.3 gcc 4.3.1 14.1 09-07-28 alex Y Y Y Y
i686/unkn./kfreebsd7.2-gnu gcc 4.3.4 15 09-12-02 alex Y Y Y Y (3)
i386/unknown/netbsdelf1.6.1 gcc 2.95.3 CVSHEAD 04-02-24 alex Y Y Y Y
i386/unknown/netbsdelf3.0.1 gcc 3.3.3 0.10.0-p1 06-08-30 alex Y Y Y Y (3)
-i386/unknown/netbsdelf4.0 gcc 4.1.2 16 10-04-11 alex Y Y Y Y (3)
+i386/unknown/netbsdelf4.0 gcc 4.1.2 17-dev 10-10-05 alex Y Y Y Y (3)
i386/unknown/openbsd3.9 gcc 3.3.5 0.10.0-p1 06-08-30 alex Y Y Y Y (3)
i386/unknown/openbsd4.1 gcc 3.3.5 16 10-04-11 alex Y Y Y Y (3)
i586/pc/interix3.5 gcc 3.3 15 10-01-22 alex Y Y N Y
@@ -69,7 +69,9 @@ sparc/sun/solaris2.6 gcc 2.95.3 0.7.x-CVS 03-04-22 alex Y Y Y Y
sparc/sun/solaris2.7 gcc 3.3 0.8.0 04-05-30 alex Y Y Y Y
sparc/unkn./netbsdelf1.6.1 gcc 2.95.3 0.8.0 04-05-30 alex Y Y Y Y
x86_64/unknown/freebsd8.0 gcc 4.2.1 16 10-04-23 alex Y Y Y Y (3)
-x86_64/unknown/linux-gnu gcc 4.3.2 16 10-04-23 alex Y Y Y Y (1)
+x86_64/unknown/freebsd8.1 gcc 4.2.1 17-dev 10-10-05 alex Y Y Y Y (3)
+x86_64/unknown/linux-gnu gcc 4.3.2 17-dev 10-10-05 alex Y Y Y Y (1)
+x86_64/unknown/openbsd4.7 gcc 3.3.5 17-dev 10-10-05 alex Y Y Y Y (3)
Notes
Module: ngircd.git
Branch: master
Commit: 5e82a91d1337b78510bc62fe3c7e43f9c0b7d3d1
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=5e82a91d…
Author: Alexander Barton <alex(a)barton.de>
Date: Fri Sep 24 17:39:11 2010 +0200
New configuration option "SyslogFacility"
The new option "SyslogFacility" deines the syslog "facility" to which
ngIRCd should send log messages.
Possible values are system dependant, but most probably "auth", "daemon",
"user" and "local1" through "local7" are possible values; see syslog(3).
Default is "local5" for historical reasons.
---
ChangeLog | 5 +++++
NEWS | 5 +++++
doc/sample-ngircd.conf | 7 +++++++
man/ngircd.conf.5.tmpl | 7 +++++++
src/ngircd/conf.c | 19 +++++++++++++++++++
src/ngircd/conf.h | 7 +++++++
src/ngircd/log.c | 10 ++++------
7 files changed, 54 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 73c8473..4402f06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,11 @@
ngIRCd Release 17
+ - New configuration option "SyslogFacility" to define the syslog "facility"
+ (the "target"), to which ngIRCd should send its log messages.
+ Possible values are system dependant, but most probably "auth", "daemon",
+ "user" and "local1" through "local7" are possible values; see syslog(3).
+ Default is "local5" for historical reasons.
- Dump the "internal server state" (configured servers, established
connections and known clients) to the console or syslog when receiving
the SIGUSR2 signal and debug mode is enabled.
diff --git a/NEWS b/NEWS
index d3a600c..61e8331 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,11 @@
ngIRCd Release 17
+ - New configuration option "SyslogFacility" to define the syslog "facility"
+ (the "target"), to which ngIRCd should send its log messages.
+ Possible values are system dependant, but most probably "auth", "daemon",
+ "user" and "local1" through "local7" are possible values; see syslog(3).
+ Default is "local5" for historical reasons.
- Dump the "internal server state" (configured servers, established
connections and known clients) to the console or syslog when receiving
the SIGUSR2 signal and debug mode is enabled.
diff --git a/doc/sample-ngircd.conf b/doc/sample-ngircd.conf
index fdeed35..a2694f8 100644
--- a/doc/sample-ngircd.conf
+++ b/doc/sample-ngircd.conf
@@ -68,6 +68,13 @@
# so the server listens on all IP addresses of the system by default.
;Listen = 127.0.0.1,192.168.0.1
+ # Syslog "facility" to which ngIRCd should send log messages.
+ # Possible values are system dependant, but most probably auth, daemon,
+ # user and local1 through local7 are possible values; see syslog(3).
+ # Default is "local5" for historical reasons, you probably want to
+ # change this to "daemon", for example.
+ SyslogFacility = local1
+
# Text file with the "message of the day" (MOTD). This message will
# be shown to all users connecting to the server:
;MotdFile = /usr/local/etc/ngircd.motd
diff --git a/man/ngircd.conf.5.tmpl b/man/ngircd.conf.5.tmpl
index 71aaa1e..f4f7f6e 100644
--- a/man/ngircd.conf.5.tmpl
+++ b/man/ngircd.conf.5.tmpl
@@ -116,6 +116,13 @@ If unset, the defaults value is "0.0.0.0" or, if ngIRCd was compiled
with IPv6 support, "::,0.0.0.0". So the server listens on all configured
IP addresses and interfaces by default.
.TP
+\fBSyslogFacility\fR
+Syslog "facility" to which ngIRCd should send log messages. Possible
+values are system dependant, but most probably "auth", "daemon", "user"
+and "local1" through "local7" are possible values; see syslog(3).
+Default is "local5" for historical reasons, you probably want to
+change this to "daemon", for example.
+.TP
\fBMotdFile\fR
Text file with the "message of the day" (MOTD). This message will be shown
to all users connecting to the server. Changes made to this file
diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c
index 5619a6c..acb4010 100644
--- a/src/ngircd/conf.c
+++ b/src/ngircd/conf.c
@@ -324,6 +324,10 @@ Conf_Test( void )
printf(" ServerGID = %s\n", grp->gr_name);
else
printf(" ServerGID = %ld\n", (long)Conf_GID);
+#ifdef SYSLOG
+ printf(" SyslogFacility = %s\n",
+ ngt_SyslogFacilityName(Conf_SyslogFacility));
+#endif
printf(" PingTimeout = %d\n", Conf_PingTimeout);
printf(" PongTimeout = %d\n", Conf_PongTimeout);
printf(" ConnectRetry = %d\n", Conf_ConnectRetry);
@@ -600,6 +604,14 @@ Set_Defaults(bool InitServers)
Conf_MaxJoins = 10;
Conf_MaxNickLength = CLIENT_NICK_LEN_DEFAULT;
+#ifdef SYSLOG
+#ifdef LOG_LOCAL5
+ Conf_SyslogFacility = LOG_LOCAL5;
+#else
+ Conf_SyslogFacility = 0;
+#endif
+#endif
+
/* Initialize server configuration structures */
if (InitServers) {
for (i = 0; i < MAX_SERVERS;
@@ -1148,6 +1160,13 @@ Handle_GLOBAL( int Line, char *Var, char *Arg )
return;
}
#endif
+#ifdef SYSLOG
+ if (strcasecmp(Var, "SyslogFacility") == 0) {
+ Conf_SyslogFacility = ngt_SyslogFacilityID(Arg,
+ Conf_SyslogFacility);
+ return;
+ }
+#endif
Config_Error(LOG_ERR, "%s, line %d (section \"Global\"): Unknown variable \"%s\"!",
NGIRCd_ConfFile, Line, Var);
} /* Handle_GLOBAL */
diff --git a/src/ngircd/conf.h b/src/ngircd/conf.h
index 5cf5f6b..ff67dc7 100644
--- a/src/ngircd/conf.h
+++ b/src/ngircd/conf.h
@@ -173,6 +173,13 @@ GLOBAL int Conf_MaxConnectionsIP;
/* Maximum length of a nick name */
GLOBAL unsigned int Conf_MaxNickLength;
+#ifdef SYSLOG
+
+/* Syslog "facility" */
+GLOBAL int Conf_SyslogFacility;
+
+#endif
+
GLOBAL void Conf_Init PARAMS((void));
GLOBAL bool Conf_Rehash PARAMS((void));
GLOBAL int Conf_Test PARAMS((void));
diff --git a/src/ngircd/log.c b/src/ngircd/log.c
index 0cfe3b7..3710142 100644
--- a/src/ngircd/log.c
+++ b/src/ngircd/log.c
@@ -36,6 +36,7 @@
#include "conn.h"
#include "channel.h"
#include "irc-write.h"
+#include "conf.h"
#include "exp.h"
#include "log.h"
@@ -72,13 +73,10 @@ Log_Init( bool Daemon_Mode )
Is_Daemon = Daemon_Mode;
#ifdef SYSLOG
-#ifndef LOG_CONS /* Kludge: mips-dec-ultrix4.5 has no LOG_CONS/LOG_LOCAL5 */
+#ifndef LOG_CONS /* Kludge: mips-dec-ultrix4.5 has no LOG_CONS */
#define LOG_CONS 0
#endif
-#ifndef LOG_LOCAL5
-#define LOG_LOCAL5 0
-#endif
- openlog( PACKAGE_NAME, LOG_CONS|LOG_PID, LOG_LOCAL5 );
+ openlog(PACKAGE_NAME, LOG_CONS|LOG_PID, Conf_SyslogFacility);
#endif
Log( LOG_NOTICE, "%s started.", NGIRCd_Version );
@@ -267,7 +265,7 @@ GLOBAL void
Log_Init_Subprocess(char UNUSED *Name)
{
#ifdef SYSLOG
- openlog( PACKAGE_NAME, LOG_CONS|LOG_PID, LOG_LOCAL5 );
+ openlog(PACKAGE_NAME, LOG_CONS|LOG_PID, Conf_SyslogFacility);
#endif
#ifdef DEBUG
Log_Subprocess(LOG_DEBUG, "%s sub-process starting, PID %ld.",
Module: ngircd.git
Branch: master
Commit: ba720fcbaeaacee700d7d23936cf481e6fcb83b1
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=ba720fcb…
Author: Florian Westphal <fw(a)strlen.de>
Date: Tue Sep 14 23:53:59 2010 +0200
Fix signalpipe file descriptor leak on RESTART
Signals_Init() must only be called once.
This does not affect any ngircd release version.
Earlier version of this patch moved the io and sighandler
initialization before the while() loop, but as Alexander
Barton noticed that broke all systems without builtin select
support in io.c...
---
src/ngircd/sighandlers.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/ngircd/sighandlers.c b/src/ngircd/sighandlers.c
index aaff1ea..80eef3e 100644
--- a/src/ngircd/sighandlers.c
+++ b/src/ngircd/sighandlers.c
@@ -266,6 +266,8 @@ Signals_Init(void)
#ifdef HAVE_SIGACTION
struct sigaction saction;
#endif
+ if (signalpipe[0] > 0 || signalpipe[1] > 0)
+ return true;
if (pipe(signalpipe))
return false;