From 3c047583a192b6dad0938e4c7fbefcb92755b727 Mon Sep 17 00:00:00 2001 From: Frank Lahm Date: Wed, 10 Aug 2011 11:02:59 +0200 Subject: [PATCH] Correct logger setup in afpd and reduce log clutter by reducing loglevel of logger syslog setup --- etc/afpd/afp_options.c | 9 +++------ etc/afpd/auth.c | 4 ---- etc/afpd/main.c | 1 + libatalk/util/logger.c | 2 +- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/etc/afpd/afp_options.c b/etc/afpd/afp_options.c index 22ab58d6..43992ed7 100644 --- a/etc/afpd/afp_options.c +++ b/etc/afpd/afp_options.c @@ -700,11 +700,14 @@ int afp_options_parse(int ac, char **av, struct afp_options *options) *p = '\0'; } +#ifdef ultrix if (NULL == ( p = strrchr( av[ 0 ], '/' )) ) { p = av[ 0 ]; } else { p++; } + openlog( p, LOG_PID ); /* ultrix only */ +#endif /* ultrix */ while (EOF != ( c = getopt( ac, av, OPTIONS )) ) { switch ( c ) { @@ -796,11 +799,5 @@ int afp_options_parse(int ac, char **av, struct afp_options *options) exit( 2 ); } -#ifdef ultrix - openlog( p, LOG_PID ); /* ultrix only */ -#else - set_processname(p); -#endif /* ultrix */ - return 1; } diff --git a/etc/afpd/auth.c b/etc/afpd/auth.c index 372d7deb..b7f5aa5d 100644 --- a/etc/afpd/auth.c +++ b/etc/afpd/auth.c @@ -273,10 +273,6 @@ static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void), int expi int admin = 0; #endif /* ADMIN_GRP */ -#if 0 - set_processname("afpd"); -#endif - if ( pwd->pw_uid == 0 ) { /* don't allow root login */ LOG(log_error, logtype_afpd, "login: root login denied!" ); return AFPERR_NOTAUTH; diff --git a/etc/afpd/main.c b/etc/afpd/main.c index f9b56ed6..b29510ba 100644 --- a/etc/afpd/main.c +++ b/etc/afpd/main.c @@ -262,6 +262,7 @@ int main(int ac, char **av) fault_setup(NULL); /* Default log setup: log to syslog */ + set_processname("afpd"); setuplog("default log_note"); afp_options_init(&default_options); diff --git a/libatalk/util/logger.c b/libatalk/util/logger.c index eb98f45b..9ce83c4d 100644 --- a/libatalk/util/logger.c +++ b/libatalk/util/logger.c @@ -437,7 +437,7 @@ void syslog_setup(int loglevel, enum logtypes logtype, int display_options, int log_config.inited = 1; - LOG(log_note, logtype_logger, "Set syslog logging to level: %s", + LOG(log_info, logtype_logger, "Set syslog logging to level: %s", arr_loglevel_strings[loglevel]); } -- 2.39.2