On Tue, May 12, 2009 at 04:08:17PM +0800, Mathias Koerber wrote:
> 
> > [pid 4508] stat("/chroot/dev/log", 0x7ffffe2baf10) = -1 ENOENT (No such 
> > file or directory)

This is expected as it doesn't exist yet

> > [pid 4508] unlink("/chroot/dev/log") = -1 ENOENT (No such file or directory)

Syslog-ng apparently being happily paranoid

> > [pid 4508] bind(3, {sa_family=AF_FILE, path="/chroot/dev/log"}, 22) = -1 
> > EPERM (Operation not permitted)

We need to disambiguate here... Either syslog-ng doesn't have perms to
do this (dropped root early?), or something wacky is occurring. 

In your syslog-ng.conf you want to use unix-stream("/chroot/dev/log");

If it still fails on that, run the following python program to see
whether root can establish sockets there:

Running it without an argument starts the server. Start another shell
and run it with an argument, you should see that appear in the first
shell. 

If something's horribly wrong, it'll explode and provide a bunch of
debugging. ;)


Patrick


#!/usr/bin/env python
import socket, os, sys

def connections(sock, filename):
    try: os.unlink(filename)
    except: pass
    sock.bind(filename)
    sock.listen(1)
    while True:
        conn, addr = sock.accept()
        yield conn

def packets(connection):
    while True:
        data = connection.recv(1024)
        if not data:
            break
        yield data

sock_file = "/chroot/dev/log"
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)

# if client
if len(sys.argv) > 1:
    sock.connect(sock_file)
    sock.send( ' '.join(sys.argv) )
    sock.close
    sys.exit(0)

# if server
for conn in connections(sock, sock_file):
    for packet in packets(conn):
        print packet

_______________________________________________
Slugnet mailing list
[email protected]
http://wiki.lugs.org.sg/LugsMailingListFaq
http://www.lugs.org.sg/mailman/listinfo/slugnet

Reply via email to