[syslog-ng]running swatch as a different user from syslog-ng

Mika S. Marjamaki ext-mika.s.marjamaki@nokia.com
23 Dec 2002 14:24:27 +0200


Hi,

I'm using syslog-ng 1.5.23 on RedHat 8.0.

I'm running swatch 3.0.4 from syslog-ng with a destination configuration
like this:

- - - syslog-ng.conf
destination d_swatch {
    program("/usr/bin/swatch
        --config-file=3D/etc/swatchrc.alerts
        --read-pipe=3D\"cat /dev/fd/0\"
        ");
    };
- - -

However, I don't like running swatch as root. Central loghost Mini-HOWTO
<http://www.campin.net/newlogcheck.html> suggests that I could run
swatch as a different user with a configuration like this:

- - - syslog-ng.conf
destination swatch {
    program("su syslog -c
        '/usr/bin/swatch
        --config-file=3D/etc/swatchrc
        --read-pipe=3D"cat /dev/fd/0"'
        ");
        };
- - -

That kind of configuration does not work for me, though. I noticed that
I had to put backslashes in front of "-signs around "cat /dev/fd/0".

Ideas, anyone?

Best Regards,

  Mika

--=20
# Mika S. Marjam=E4ki <ext-Mika.S.Marjamaki@nokia.com> +358-40-536-9514
# Unix System Specialist, NRC Unix Team