1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-05 23:33:12 +02:00

Added log {} syslog support

This commit is contained in:
codemastr
2002-03-18 23:26:12 +00:00
parent ffea432f5a
commit 65a2668ede
13 changed files with 179 additions and 137 deletions
+1
View File
@@ -1245,3 +1245,4 @@ seen. gmtime warning still there
Thanks to larne, Luke, SciFi, panda, ^Tux^.. Syzop .. and the countless
people bitching about their servers going down.
*** beta8 released ***
- Added log {} syslog support (appears to work fine) [#0000099]
+2
View File
@@ -306,6 +306,8 @@ AC_CHECK_FUNCS(strcasecmp,AC_DEFINE(GOT_STRCASECMP))
AC_CHECK_FUNCS(inet_addr,,AC_DEFINE(NEED_INET_ADDR))
AC_CHECK_FUNCS(inet_ntoa,,AC_DEFINE(NEED_INET_NTOA))
AC_CHECK_FUNCS(inet_netof,,AC_DEFINE(NEED_INET_NETOF))
AC_CHECK_FUNCS(syslog,AC_DEFINE(HAVE_SYSLOG))
AC_CHECK_FUNCS(vsyslog,AC_DEFINE(HAVE_VSYSLOG))
AC_SUBST(REGEX)
AC_SUBST(STRTOUL)
AC_SUBST(CRYPTOLIB)
Vendored
+153 -37
View File
@@ -4171,6 +4171,122 @@ EOF
fi
done
for ac_func in syslog
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4178: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4183 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif
; return 0; }
EOF
if { (eval echo configure:4206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
cat >> confdefs.h <<\EOF
#define HAVE_SYSLOG 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
for ac_func in vsyslog
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:4236: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4241 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
$ac_func();
#endif
; return 0; }
EOF
if { (eval echo configure:4264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_func_$ac_func=no"
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
cat >> confdefs.h <<EOF
#define $ac_tr_func 1
EOF
cat >> confdefs.h <<\EOF
#define HAVE_VSYSLOG 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
@@ -4332,7 +4448,7 @@ cat >> confdefs.h <<\EOF
EOF
echo $ac_n "checking what order we should supply the SSL libraries in""... $ac_c" 1>&6
echo "configure:4336: checking what order we should supply the SSL libraries in" >&5
echo "configure:4452: checking what order we should supply the SSL libraries in" >&5
if eval "test \"`echo '$''{'ac_cv_ssl_libs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4340,7 +4456,7 @@ else
save_libs="$LIBS"
LIBS="$LIBS -lssl -lcrypto -lssl"
cat > conftest.$ac_ext <<EOF
#line 4344 "configure"
#line 4460 "configure"
#include "confdefs.h"
#include <openssl/ssl.h>
int main() {
@@ -4349,7 +4465,7 @@ SSL_write(NULL, NULL, NULL);
; return 0; }
EOF
if { (eval echo configure:4353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:4469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_ssl_libs="-lssl -lcrypto -lssl" LIBS="$save_libs"
else
@@ -4375,12 +4491,12 @@ if test "${enable_dynamic_linking+set}" = set; then
enableval="$enable_dynamic_linking"
echo $ac_n "checking for dlopen""... $ac_c" 1>&6
echo "configure:4379: checking for dlopen" >&5
echo "configure:4495: checking for dlopen" >&5
if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4384 "configure"
#line 4500 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char dlopen(); below. */
@@ -4403,7 +4519,7 @@ dlopen();
; return 0; }
EOF
if { (eval echo configure:4407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:4523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_dlopen=yes"
else
@@ -4421,7 +4537,7 @@ if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
echo "configure:4425: checking for dlopen in -ldl" >&5
echo "configure:4541: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4429,7 +4545,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 4433 "configure"
#line 4549 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4440,7 +4556,7 @@ int main() {
dlopen()
; return 0; }
EOF
if { (eval echo configure:4444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:4560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4469,20 +4585,20 @@ fi
hold_cflags=$CFLAGS
CFLAGS="$CFLAGS -export-dynamic"
echo $ac_n "checking if we need the -export-dynamic flag""... $ac_c" 1>&6
echo "configure:4473: checking if we need the -export-dynamic flag" >&5
echo "configure:4589: checking if we need the -export-dynamic flag" >&5
if eval "test \"`echo '$''{'ac_cv_export_dynamic'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4479 "configure"
#line 4595 "configure"
#include "confdefs.h"
int main() {
int i;
; return 0; }
EOF
if { (eval echo configure:4486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:4602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_export_dynamic=yes
else
@@ -4500,7 +4616,7 @@ CFLAGS=$hold_cflags
fi
echo $ac_n "checking for compiler option to produce PIC""... $ac_c" 1>&6
echo "configure:4504: checking for compiler option to produce PIC" >&5
echo "configure:4620: checking for compiler option to produce PIC" >&5
if eval "test \"`echo '$''{'ac_cv_pic'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4519,7 +4635,7 @@ fi
echo "$ac_t""$ac_cv_pic" 1>&6
echo $ac_n "checking if your system prepends an underscore on symbols""... $ac_c" 1>&6
echo "configure:4523: checking if your system prepends an underscore on symbols" >&5
echo "configure:4639: checking if your system prepends an underscore on symbols" >&5
if eval "test \"`echo '$''{'ac_cv_underscore'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4564,7 +4680,7 @@ if test "${enable_inet6+set}" = set; then
enableval="$enable_inet6"
echo $ac_n "checking if your system has IPv6 support""... $ac_c" 1>&6
echo "configure:4568: checking if your system has IPv6 support" >&5
echo "configure:4684: checking if your system has IPv6 support" >&5
if eval "test \"`echo '$''{'ac_cv_ip6'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4573,7 +4689,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
#line 4577 "configure"
#line 4693 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -4585,7 +4701,7 @@ exit(0);
}
EOF
if { (eval echo configure:4589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:4705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_ip6=yes
else
@@ -4647,7 +4763,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
echo "configure:4651: checking host system type" >&5
echo "configure:4767: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -4673,17 +4789,17 @@ acx_pthread_ok=no
# If it isn't, don't bother looking for the threads libraries.
ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for pthread.h""... $ac_c" 1>&6
echo "configure:4677: checking for pthread.h" >&5
echo "configure:4793: checking for pthread.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4682 "configure"
#line 4798 "configure"
#include "confdefs.h"
#include <pthread.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4687: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:4803: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4752,7 +4868,7 @@ esac
result=none
if test "$acx_pthread_ok" = "no"; then
echo $ac_n "checking what flags pthreads needs""... $ac_c" 1>&6
echo "configure:4756: checking what flags pthreads needs" >&5
echo "configure:4872: checking what flags pthreads needs" >&5
if eval "test \"`echo '$''{'ac_cv_pthreadflag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4790,7 +4906,7 @@ for flag in $acx_pthread_flags; do
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
cat > conftest.$ac_ext <<EOF
#line 4794 "configure"
#line 4910 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@@ -4799,7 +4915,7 @@ pthread_t th; pthread_join(th, 0);
pthread_create(0,0,0,0); pthread_cleanup_pop(0);
; return 0; }
EOF
if { (eval echo configure:4803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:4919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
acx_pthread_ok=yes
else
@@ -4845,20 +4961,20 @@ esac
# Detect AIX lossage: threads are created detached by default
# and the JOINABLE attribute has a nonstandard name (UNDETACHED).
echo $ac_n "checking for joinable pthread attribute""... $ac_c" 1>&6
echo "configure:4849: checking for joinable pthread attribute" >&5
echo "configure:4965: checking for joinable pthread attribute" >&5
if eval "test \"`echo '$''{'ac_cv_pthreadjoin'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 4855 "configure"
#line 4971 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
int attr=PTHREAD_CREATE_JOINABLE;
; return 0; }
EOF
if { (eval echo configure:4862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:4978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_pthreadjoin=PTHREAD_CREATE_JOINABLE
else
@@ -4870,14 +4986,14 @@ fi
rm -f conftest*
if test "$ac_cv_pthreadjoin" = "unknown"; then
cat > conftest.$ac_ext <<EOF
#line 4874 "configure"
#line 4990 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
int attr=PTHREAD_CREATE_UNDETACHED;
; return 0; }
EOF
if { (eval echo configure:4881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:4997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_pthreadjoin=PTHREAD_CREATE_UNDETACHED
else
@@ -4903,7 +5019,7 @@ EOF
fi
echo $ac_n "checking if more special flags are required for pthreads""... $ac_c" 1>&6
echo "configure:4907: checking if more special flags are required for pthreads" >&5
echo "configure:5023: checking if more special flags are required for pthreads" >&5
if eval "test \"`echo '$''{'ac_cv_pthreadspecial'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4928,7 +5044,7 @@ echo "$ac_t""$ac_cv_pthreadspecial" 1>&6
# Extract the first word of "cc_r", so it can be a program name with args.
set dummy cc_r; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:4932: checking for $ac_word" >&5
echo "configure:5048: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_PTHREAD_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4960,7 +5076,7 @@ else
fi
if test "x$ac_cv_pthreadflag"!=x; then
echo $ac_n "checking if pthreads uses one thread per process""... $ac_c" 1>&6
echo "configure:4964: checking if pthreads uses one thread per process" >&5
echo "configure:5080: checking if pthreads uses one thread per process" >&5
if eval "test \"`echo '$''{'ac_cv_thread_multi'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4973,7 +5089,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
#line 4977 "configure"
#line 5093 "configure"
#include "confdefs.h"
#include <pthread.h>
@@ -5007,7 +5123,7 @@ int main() {
}
EOF
if { (eval echo configure:5011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:5127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_thread_multi=no
else
@@ -5083,12 +5199,12 @@ CC="$PTHREAD_CC"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
IRCDLIBS="$IRCDLIBS $PTHREAD_LIBS"
echo $ac_n "checking if FD_SETSIZE is large enough to allow $ac_fd file descriptors""... $ac_c" 1>&6
echo "configure:5087: checking if FD_SETSIZE is large enough to allow $ac_fd file descriptors" >&5
echo "configure:5203: checking if FD_SETSIZE is large enough to allow $ac_fd file descriptors" >&5
if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
#line 5092 "configure"
#line 5208 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -5100,7 +5216,7 @@ exit(1);
}
EOF
if { (eval echo configure:5104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:5220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
echo "$ac_t""yes" 1>&6
else
-30
View File
@@ -336,36 +336,6 @@
*/
#define CMDLINE_CONFIG /* allow conf-file to be specified on command line */
/*
* If you wish to have the server send 'vital' messages about server
* through syslog, define USE_SYSLOG. Only system errors and events critical
* to the server are logged although if this is defined with FNAME_USERLOG,
* syslog() is used instead of the above file. It is not recommended that
* this option is used unless you tell the system administrator beforehand
* and obtain their permission to send messages to the system log files.
*/
#ifndef _WIN32
#undef USE_SYSLOG
#endif
#ifdef USE_SYSLOG
/*
* If you use syslog above, you may want to turn some (none) of the
* spurious log messages for KILL/SQUIT off.
*/
#undef SYSLOG_KILL /* log all operator kills to syslog */
#undef SYSLOG_SQUIT /* log all remote squits for all servers to syslog */
#undef SYSLOG_CONNECT /* log remote connect messages for other all servs */
#undef SYSLOG_USERS /* send userlog stuff to syslog */
#undef SYSLOG_OPER /* log all users who successfully become an Op */
/*
* If you want to log to a different facility than DAEMON, change
* this define.
*/
#define LOG_FACILITY LOG_DAEMON
#endif /* USE_SYSLOG */
/*
* Size of the LISTEN request. Some machines handle this large
* without problem, but not all. It defaults to 5, but can be
+6
View File
@@ -111,6 +111,12 @@
/* Define if you need bzero */
#undef NEED_BZERO
/* Define if you have syslog */
#undef HAVE_SYSLOG
/* Define if you have vsyslog */
#undef HAVE_VSYSLOG
/* Define if you want to allow SSL connections */
#undef USE_SSL
+1 -1
View File
@@ -40,7 +40,7 @@
# include <stddef.h>
#endif
#ifdef USE_SYSLOG
#ifdef HAVE_SYSLOG
# include <syslog.h>
# ifdef SYSSYSLOGH
# include <sys/syslog.h>
-3
View File
@@ -38,9 +38,6 @@ void addto_fdlist(int fd, fdlist * listp)
*/
--listp->last_entry;
ircd_log(LOG_ERROR, "fdlist.c list too big, must exit...");
#ifdef USE_SYSLOG
(void)syslog(LOG_CRIT, "fdlist.c list too big.. must exit");
#endif
abort();
}
else
+4 -24
View File
@@ -210,9 +210,6 @@ VOIDSIG s_die()
#ifdef _WIN32
int i;
aClient *cptr;
#endif
#ifdef USE_SYSLOG
(void)syslog(LOG_CRIT, "Server Killed By SIGTERM");
#endif
unload_all_modules();
#ifndef _WIN32
@@ -248,11 +245,7 @@ VOIDSIG s_rehash()
#endif
}
void restart(char *mesg)
{
#ifdef USE_SYSLOG
(void)syslog(LOG_WARNING, "Restarting Server because: %s", mesg);
#endif
void restart(char *mesg) {
server_reboot(mesg);
}
@@ -260,9 +253,6 @@ VOIDSIG s_restart()
{
static int restarting = 0;
#ifdef USE_SYSLOG
(void)syslog(LOG_WARNING, "Server Restarting on SIGINT");
#endif
if (restarting == 0)
{
/* Send (or attempt to) a dying scream to oper if present */
@@ -342,7 +332,7 @@ void server_reboot(char *mesg)
** fd 0 must be 'preserved' if either the -d or -i options have
** been passed to us before restarting.
*/
#ifdef USE_SYSLOG
#ifdef HAVE_SYSLOG
(void)closelog();
#endif
#ifndef _WIN32
@@ -359,13 +349,6 @@ void server_reboot(char *mesg)
CleanUp();
(void)execv(myargv[0], myargv);
#endif
#ifdef USE_SYSLOG
/* Have to reopen since it has been closed above */
openlog(myargv[0], LOG_PID | LOG_NDELAY, LOG_FACILITY);
syslog(LOG_CRIT, "execv(%s,%s) failed: %m\n", MYNAME, myargv[0]);
closelog();
#endif
#ifndef _WIN32
Debug((DEBUG_FATAL, "Couldn't restart server: %s", strerror(errno)));
#else
@@ -1137,8 +1120,8 @@ int InitwIRCD(int argc, char *argv[])
me.fd = -1;
SetMe(&me);
make_server(&me);
#ifdef USE_SYSLOG
openlog(myargv[0], LOG_PID | LOG_NDELAY, LOG_FACILITY);
#ifdef HAVE_SYSLOG
openlog("ircd", LOG_PID | LOG_NDELAY, LOG_DAEMON);
#endif
/* Put in our info */
strncpyzt(me.info, conf_me->info, sizeof(me.info));
@@ -1200,9 +1183,6 @@ int InitwIRCD(int argc, char *argv[])
R_fail_id = strlen(REPORT_FAIL_ID);
write_pidfile();
Debug((DEBUG_NOTICE, "Server ready..."));
#ifdef USE_SYSLOG
syslog(LOG_NOTICE, "Server Ready");
#endif
SetupEvents();
loop.ircd_booted = 1;
#if defined(HAVE_SETPROCTITLE)
-8
View File
@@ -65,10 +65,6 @@ void start_auth(aClient *cptr)
cptr, cptr->slot, cptr->fd, cptr->status));
if ((cptr->authfd = socket(AFINET, SOCK_STREAM, 0)) == -1)
{
#ifdef USE_SYSLOG
syslog(LOG_ERR, "Unable to create auth socket for %s:%m",
get_client_name(cptr, TRUE));
#endif
Debug((DEBUG_ERROR, "Unable to create auth socket for %s:%s",
get_client_name(cptr, TRUE), strerror(get_sockerr(cptr))));
if (!DoingDNS(cptr))
@@ -145,10 +141,6 @@ void send_authports(aClient *cptr)
if (getsockname(cptr->fd, (struct SOCKADDR *)&us, &ulen) ||
getpeername(cptr->fd, (struct SOCKADDR *)&them, &tlen))
{
#ifdef USE_SYSLOG
syslog(LOG_ERR, "auth get{sock,peer}name error for %s:%m",
get_client_name(cptr, TRUE));
#endif
goto authsenderr;
}
+1 -7
View File
@@ -282,9 +282,6 @@ void report_error(char *text, aClient *cptr)
#endif
sendto_snomask(SNO_JUNK, text, host, strerror(errtmp));
ircd_log(LOG_ERROR, text,host,strerror(errtmp));
#ifdef USE_SYSLOG
syslog(LOG_WARNING, text, host, strerror(errtmp));
#endif
return;
}
@@ -317,9 +314,6 @@ void report_baderror(char *text, aClient *cptr)
errtmp = err;
#endif
sendto_umode(UMODE_OPER, text, host, strerror(errtmp));
#ifdef USE_SYSLOG
syslog(LOG_WARNING, text, host, strerror(errtmp));
#endif
return;
}
@@ -985,7 +979,7 @@ void set_sock_opts(int fd, aClient *cptr)
#endif
#if defined(SO_DEBUG) && defined(DEBUGMODE) && 0
/* Solaris with SO_DEBUG writes to syslog by default */
#if !defined(_SOLARIS) || defined(USE_SYSLOG)
#if !defined(_SOLARIS) || defined(HAVE_SYSLOG)
opt = 1;
if (setsockopt(fd, SOL_SOCKET, SO_DEBUG, (OPT_TYPE *)&opt,
sizeof(opt)) < 0)
+11
View File
@@ -446,6 +446,17 @@ void ircd_log(int flags, char *format, ...)
strcat(buf, "\n");
sprintf(timebuf, "[%s] - ", myctime(TStime()));
for (logs = conf_log; logs; logs = (ConfigItem_log *) logs->next) {
#ifdef HAVE_SYSLOG
if (!stricmp(logs->file, "syslog") && logs->flags & flags) {
#ifdef HAVE_VSYSLOG
vsyslog(LOG_INFO, format, ap);
#else
/* %s just to be safe */
syslog(LOG_INFO, "%s", buf);
#endif
continue;
}
#endif
if (logs->flags & flags) {
if (stat(logs->file, &fstats) != -1 && logs->maxsize && fstats.st_size >= logs->maxsize) {
#ifndef _WIN32
-10
View File
@@ -442,13 +442,6 @@ int exit_client(aClient *cptr, aClient *sptr, aClient *from, char *comment)
MyFree(sptr->user->lopt);
}
on_for = TStime() - sptr->firsttime;
# if defined(USE_SYSLOG) && defined(SYSLOG_USERS)
syslog(LOG_NOTICE, "%s (%3d:%02d:%02d): %s@%s (%s)\n",
myctime(sptr->firsttime),
on_for / 3600, (on_for % 3600) / 60,
on_for % 60, sptr->user->username,
sptr->sockhost, sptr->name);
#endif
ircd_log(LOG_CLIENT, "Disconnect - (%d:%d:%d) %s!%s@%s",
on_for / 3600, (on_for % 3600) / 60, on_for % 60,
sptr->name, sptr->user->username, sptr->user->realhost);
@@ -696,9 +689,6 @@ void checklist(void)
j++;
if (!j)
{
#ifdef USE_SYSLOG
syslog(LOG_WARNING, "ircd exiting: autodie");
#endif
exit(0);
}
return;
-17
View File
@@ -266,10 +266,6 @@ CMD_FUNC(m_squit)
sendto_serv_butone(&me,
":%s GLOBOPS :Received SQUIT %s from %s (%s)", me.name,
server, get_client_name(sptr, FALSE), comment);
#if defined(USE_SYSLOG) && defined(SYSLOG_SQUIT)
syslog(LOG_DEBUG, "SQUIT From %s : %s (%s)",
parv[0], server, comment);
#endif
}
else if (MyConnect(acptr))
{
@@ -2824,10 +2820,6 @@ CMD_FUNC(m_connect)
":%s GLOBOPS :Remote CONNECT %s %s from %s",
me.name, parv[1], parv[2] ? parv[2] : "",
get_client_name(sptr, FALSE));
#if defined(USE_SYSLOG) && defined(SYSLOG_CONNECT)
syslog(LOG_DEBUG, "CONNECT From %s : %s %d", parv[0], parv[1],
parv[2] ? parv[2] : "");
#endif
}
/* Interesting */
aconf->port = port;
@@ -3439,9 +3431,6 @@ CMD_FUNC(m_rehash)
sendto_ops("%s is rehashing server config file", parv[0]);
sendto_one(sptr, rpl_str(RPL_REHASHING), me.name, parv[0], configfile);
#ifdef USE_SYSLOG
syslog(LOG_INFO, "REHASH From %s\n", get_client_name(sptr, FALSE));
#endif
return rehash(cptr, sptr, (parc > 1) ? ((*parv[1] == 'q') ? 2 : 0) : 0);
}
@@ -3524,12 +3513,6 @@ CMD_FUNC(m_restart)
}
#ifdef USE_SYSLOG
syslog(LOG_WARNING, "Server RESTART by %s - %s\n",
get_client_name(sptr, FALSE),
(!MyClient(sptr) ? (parc > 2 ? parv[3] : "No reason")
: (parc > 1 ? parv[2] : "No reason")));
#endif
sendto_ops("Server is Restarting by request of %s", parv[0]);
server_reboot((!MyClient(sptr) ? (parc > 2 ? parv[3] : "No reason")
: (parc > 1 ? parv[2] : "No reason")));