summaryrefslogtreecommitdiffstats
path: root/server/util
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2009-09-22 13:11:29 -0400
committerSimo Sorce <ssorce@redhat.com>2009-09-23 07:33:31 -0400
commit87b8670b2749d02ffdc6c06506ac692b09db5be2 (patch)
treeead3f62f72c3522d3dc7703cd9f009aabc86a023 /server/util
parent091df02f920b5f5a658962d3add6f965d84375ac (diff)
downloadsssd-87b8670b2749d02ffdc6c06506ac692b09db5be2.tar.gz
sssd-87b8670b2749d02ffdc6c06506ac692b09db5be2.tar.xz
sssd-87b8670b2749d02ffdc6c06506ac692b09db5be2.zip
Revert "Use syslog for logging error conditions in SSSD"
This reverts commit 8c50bd085c0efe5fde354deee2c8118887aae29d. Amended: commit 1016af2b1b97ad4290ccce8fa462cc7e3c191b2e also made use of the SYSLOG_ERROR() macro, so those portions of that code also needed to be reverted.
Diffstat (limited to 'server/util')
-rw-r--r--server/util/debug.c1
-rw-r--r--server/util/server.c34
-rw-r--r--server/util/util.h16
3 files changed, 17 insertions, 34 deletions
diff --git a/server/util/debug.c b/server/util/debug.c
index f0b5865e1..a7b3a0916 100644
--- a/server/util/debug.c
+++ b/server/util/debug.c
@@ -29,7 +29,6 @@
const char *debug_prg_name = "sssd";
int debug_level = 0;
int debug_timestamps = 0;
-int send_syslog = 1;
void debug_fn(const char *format, ...)
{
diff --git a/server/util/server.c b/server/util/server.c
index c195864ff..0760e60f2 100644
--- a/server/util/server.c
+++ b/server/util/server.c
@@ -62,11 +62,11 @@ static void close_low_fds(bool stderr_too)
if (fd < 0)
fd = open("/dev/null",O_WRONLY,0);
if (fd < 0) {
- SYSLOG_ERROR("Can't open /dev/null\n");
+ DEBUG(0,("Can't open /dev/null\n"));
return;
}
if (fd != i) {
- SYSLOG_ERROR("Didn't get file descriptor %d\n",i);
+ DEBUG(0,("Didn't get file descriptor %d\n",i));
return;
}
}
@@ -94,8 +94,8 @@ void become_daemon(bool Fork)
errno = 0;
if(chdir("/") == -1) {
ret = errno;
- SYSLOG_ERROR("Cannot change directory (%d [%s])\n",
- ret, strerror(ret));
+ DEBUG(0, ("Cannot change directory (%d [%s])\n",
+ ret, strerror(ret)));
return;
}
@@ -187,7 +187,7 @@ static void sig_term(int sig)
#if HAVE_GETPGRP
static int done_sigterm;
if (done_sigterm == 0 && getpgrp() == getpid()) {
- SYSLOG_NOTICE("SIGTERM: killing children\n");
+ DEBUG(0,("SIGTERM: killing children\n"));
done_sigterm = 1;
kill(-getpgrp(), SIGTERM);
}
@@ -201,7 +201,7 @@ static void sig_segv_abrt(int sig)
#if HAVE_GETPGRP
static int done;
if (done == 0 && getpgrp() == getpid()) {
- SYSLOG_NOTICE("%s: killing children\n", strsignal(sig));
+ DEBUG(0,("%s: killing children\n", strsignal(sig)));
done = 1;
kill(-getpgrp(), SIGTERM);
}
@@ -258,7 +258,7 @@ static void server_stdin_handler(struct tevent_context *event_ctx,
const char *binary_name = (const char *)private;
uint8_t c;
if (read(0, &c, 1) == 0) {
- SYSLOG_NOTICE("%s: EOF on stdin - terminating\n", binary_name);
+ DEBUG(0,("%s: EOF on stdin - terminating\n", binary_name));
#if HAVE_GETPGRP
if (getpgrp() == getpid()) {
kill(-getpgrp(), SIGTERM);
@@ -320,8 +320,8 @@ int server_setup(const char *name, int flags,
if (flags & FLAGS_PID_FILE) {
ret = pidfile(PID_PATH, name);
if (ret != EOK) {
- SYSLOG_ERROR("Error creating pidfile! (%d [%s])\n",
- ret, strerror(ret));
+ DEBUG(0, ("Error creating pidfile! (%d [%s])\n",
+ ret, strerror(ret)));
return ret;
}
}
@@ -335,13 +335,13 @@ int server_setup(const char *name, int flags,
* Everything else should hang off that */
event_ctx = tevent_context_init(talloc_autofree_context());
if (event_ctx == NULL) {
- SYSLOG_ERROR("The event context initialiaziton failed\n");
+ DEBUG(0,("The event context initialiaziton failed\n"));
return 1;
}
ctx = talloc(event_ctx, struct main_context);
if (ctx == NULL) {
- SYSLOG_ERROR("Out of memory, aborting!\n");
+ DEBUG(0,("Out of memory, aborting!\n"));
return ENOMEM;
}
@@ -349,14 +349,14 @@ int server_setup(const char *name, int flags,
conf_db = talloc_asprintf(ctx, "%s/%s", DB_PATH, CONFDB_FILE);
if (conf_db == NULL) {
- SYSLOG_ERROR("Out of memory, aborting!\n");
+ DEBUG(0,("Out of memory, aborting!\n"));
return ENOMEM;
}
DEBUG(3, ("CONFDB: %s\n", conf_db));
ret = confdb_init(ctx, &ctx->confdb_ctx, conf_db);
if (ret != EOK) {
- SYSLOG_ERROR("The confdb initialization failed\n");
+ DEBUG(0,("The confdb initialization failed\n"));
return ret;
}
@@ -364,8 +364,8 @@ int server_setup(const char *name, int flags,
ret = confdb_get_int(ctx->confdb_ctx, ctx, conf_entry,
"debug-level", debug_level, &debug_level);
if (ret != EOK) {
- SYSLOG_ERROR("Error reading from confdb (%d) [%s]\n",
- ret, strerror(ret));
+ DEBUG(0, ("Error reading from confdb (%d) [%s]\n",
+ ret, strerror(ret)));
return ret;
}
@@ -374,8 +374,8 @@ int server_setup(const char *name, int flags,
ret = confdb_get_bool(ctx->confdb_ctx, ctx, conf_entry,
"debug-timestamps", dt, &dt);
if (ret != EOK) {
- SYSLOG_ERROR("Error reading from confdb (%d) [%s]\n",
- ret, strerror(ret));
+ DEBUG(0, ("Error reading from confdb (%d) [%s]\n",
+ ret, strerror(ret)));
return ret;
}
if (dt) debug_timestamps = 1;
diff --git a/server/util/util.h b/server/util/util.h
index 1b039637f..ea7f44e83 100644
--- a/server/util/util.h
+++ b/server/util/util.h
@@ -30,7 +30,6 @@
#include <limits.h>
#include <time.h>
#include <pcre.h>
-#include <syslog.h>
#include "config.h"
#include "talloc.h"
#include "tevent.h"
@@ -44,7 +43,6 @@ typedef int errno_t;
extern const char *debug_prg_name;
extern int debug_level;
extern int debug_timestamps;
-extern int send_syslog;
void debug_fn(const char *format, ...);
#define SSSD_DEBUG_OPTS \
@@ -83,20 +81,6 @@ void debug_fn(const char *format, ...);
#define PRINT(fmt, ...) fprintf(stdout, gettext(fmt), ##__VA_ARGS__)
#define ERROR(fmt, ...) fprintf(stderr, gettext(fmt), ##__VA_ARGS__)
-#define SYSLOG_ERROR(...) do { \
- DEBUG(0, (__VA_ARGS__)); \
- if (send_syslog) { \
- syslog(LOG_ERR, __VA_ARGS__); \
- } \
-} while(0);
-
-#define SYSLOG_NOTICE(...) do { \
- DEBUG(0, (__VA_ARGS__)); \
- if (send_syslog) { \
- syslog(LOG_NOTICE, __VA_ARGS__); \
- } \
-} while(0);
-
#ifndef discard_const
#define discard_const(ptr) ((void *)((uintptr_t)(ptr)))
#endif