Vipul,

I want Razor to log to syslog, but *not* using the network (I don't let my
mailhost's syslog listen on the net at all -- just on the Unix socket).
I patched my copy of razor-agents-2.36 to add a LogType and LogTo
of "sys-syslog", which solved my problem.  I append my installation
transcript, in case you'd like to make the same patch to your version,
since it might help others in the same situation.  There are also a few
more minor fixes that may be of interest to you.

Thanks for making Razor2 available; it's most appreciated!


Anne.
-- 
Ms. Anne Bennett, Senior Sysadmin, ENCS, Concordia University, Montreal H3G 1M8
[EMAIL PROTECTED]                                    +1 514 848-2424 x2285
# -----------------------------------------------------------------------
# Install module razor-agents-2.36
# 2003/09/03 Anne Bennett (incl. logging tweaks)
# 2003/09/10 Anne Bennett: force use of "real" (not Razor) syslog

umask 022
cd /local/pkg/perl/perl-5.8.0/ext
zcat /local/pkg/perl/DIST/razor-agents-2.36.tar.gz | tar xpvf -
chown -Rh 0                 /local/pkg/perl/perl-5.8.0/ext/razor-agents-2.36
chgrp -Rh 0                 /local/pkg/perl/perl-5.8.0/ext/razor-agents-2.36
cd                          /local/pkg/perl/perl-5.8.0/ext/razor-agents-2.36
/local/pkg/perl/root-perl-5.8.0/bin/perl Makefile.PL


# 2003/09/10 Anne Bennett: force use of "real" (not Razor) syslog
cp -p   lib/Razor2/Client/Agent.pm lib/Razor2/Client/Agent.pm.original
vi      lib/Razor2/Client/Agent.pm
diff -u lib/Razor2/Client/Agent.pm.original lib/Razor2/Client/Agent.pm
#   --- lib/Razor2/Client/Agent.pm.original     2003-05-06 20:00:38.000000000 -0400
#   +++ lib/Razor2/Client/Agent.pm      2003-09-10 14:46:56.000000000 -0400
#   @@ -118,8 +118,12 @@
#            my $debuglevel = exists $self->{conf}->{debuglevel} ? 
$self->{conf}->{debuglevel} : 9;
#            my $logger = new Razor2::Logger ( 
#                            LogDebugLevel => $debuglevel,
#   -                        LogTo         => $logto,
#   -                        LogPrefix     => $self->{breed},
#   +                        # 2003/09/10 Anne Bennett: use syslog of our choice
#   +                      # LogTo         => $logto,
#   +                        LogTo         => "sys-syslog",
#   +                        LogFacility   => "mail",
#   +                        # 2002/11/27 Anne Bennett: better identifier
#   +                        LogPrefix     => "razor2-".$self->{breed},
#                            LogTimestamp  => 1,
#                            DontDie       => 1,
#                            Log2FileDir   => defined($self->{conf}->{tmp_dir}) ? 
$self->{conf}->{tmp_dir} : "/tmp",

# 2002/11/27 Anne Bennett: downgrade level of boot message
# 2003/09/10 Anne Bennett: user "real" syslog
cp -p   lib/Razor2/Logger.pm lib/Razor2/Logger.pm.original
vi      lib/Razor2/Logger.pm
diff -u lib/Razor2/Logger.pm.original lib/Razor2/Logger.pm
#   --- lib/Razor2/Logger.pm.original   2002-09-27 14:08:13.000000000 -0400
#   +++ lib/Razor2/Logger.pm    2003-09-10 15:08:35.000000000 -0400
#   @@ -7,6 +7,9 @@
#    use Time::HiRes qw(gettimeofday);
#    use POSIX qw(strftime);
#    use IO::File;
#   +# 2003/09/10 Anne Bennett: syslog of our choice (uses socket,
#   +# does not assume network listener).
#   +use Sys::Syslog;
#    
#    # designed to be inherited module
#    # but can stand alone. 
#   @@ -38,6 +41,11 @@
#            };
#            LOGF->autoflush(1);
#            $self->{fd} = *LOGF{IO};
#   +    } elsif ($self->{LogTo} eq 'sys-syslog') { 
#   +        # 2003/09/10 Anne Bennett: syslog of our choice (uses socket,
#   +        # does not assume network listener).
#   +        $self->{LogType} = 'sys-syslog';
#   +        openlog($prefix,"pid",$facility);
#        } elsif ($self->{LogTo} eq 'stdout') { 
#            $self->{LogType} = 'file';
#            $self->{fd} = *STDOUT{IO};
#   @@ -53,7 +61,9 @@
#        $self->{LogDebugLevel}   = exists $self->{LogDebugLevel} ? 
$self->{LogDebugLevel} : 5;
#        $self->{Log2FileDir}   ||= "/tmp";
#    
#   -    $self->log(1,"[bootup] Logging initiated LogDebugLevel=$self->{LogDebugLevel} 
to $self->{LogTo}");
#   +    # 2002/11/27 Anne Bennett: log this at level 2 so we can set level
#   +    #   1 (to get errors only) and avoid this unneeded line.
#   +    $self->log(2,"[bootup] Logging initiated LogDebugLevel=$self->{LogDebugLevel} 
to $self->{LogTo}");
#    
#        return $self;
#    
#   @@ -75,6 +85,13 @@
#            $logstr =~ s/\n+\n$/\n/;
#            $self->{syslog}->send($logstr, Priority => 'debug');
#    
#   +    } elsif ($self->{LogType} eq 'sys-syslog') { 
#   +        # 2003/09/10 Anne Bennett: syslog of our choice (uses socket,
#   +        # does not assume network listener).
#   +        my $logstr = sprintf("[%2d] %s\n", $prio, $message);
#   +        $logstr =~ s/\n+$//g;
#   +        syslog("debug",$logstr);
#   +
#        } elsif ($self->{LogType} eq 'file') { 
#    
#            my $now_string;


# Fix a pointer mismatch warning:
cp -p   Razor2-Preproc-deHTMLxs/deHTMLxs.xs \
        Razor2-Preproc-deHTMLxs/deHTMLxs.xs.original
vi      Razor2-Preproc-deHTMLxs/deHTMLxs.xs
diff -u Razor2-Preproc-deHTMLxs/deHTMLxs.xs.original \
        Razor2-Preproc-deHTMLxs/deHTMLxs.xs
#   --- Razor2-Preproc-deHTMLxs/deHTMLxs.xs.original    2002-06-24 01:01:35.000000000 
-0400
#   +++ Razor2-Preproc-deHTMLxs/deHTMLxs.xs     2002-12-19 15:41:19.000000000 -0500
#   @@ -64,7 +64,8 @@
#        SV *   scalarref;
#        CODE:
#        {
#   -        int size;
#   +        /* 2002/11/21 Anne Bennett: use the right type def: */
#   +        STRLEN size;
#            char * raw;
#            SV *  text;
#            const char mynull = 0;
#   @@ -101,7 +102,8 @@
#        CODE:
#        {
#            char * cleaned, * raw, * res;
#   -        int size;
#   +        /* 2002/11/21 Anne Bennett: use the right type def: */
#   +        STRLEN size;
#            SV *       text;
#            SV *       newtext;
#            SV *       newref;


make
make test
make install
# Also, these symlinks are required for these programs to be available:
ln -s razor-client /local/pkg/perl/root-perl-5.8.0/bin/razor-check
ln -s razor-client /local/pkg/perl/root-perl-5.8.0/bin/razor-report
ln -s razor-client /local/pkg/perl/root-perl-5.8.0/bin/razor-revoke
ln -s razor-client /local/pkg/perl/root-perl-5.8.0/bin/razor-admin

make clean
republish perl-5.8.0

# Razor configuration is done in the mimedefang pkg.


# -----------------------------------------------------------------------


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Razor-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/razor-users

Reply via email to