Procd_set_param stdout/stderr 1 not functioning

If it's startup, the /dev/log connection refused error could be caused by your service starting earlier than logd. The START number of your service can play a role. But generally procd does not guarantee that services are started in the order they were submitted.

As for the connection refused error not being reported, it output to stderr. I guess it's still about the stdio buffer thing.

I didn't make it clear in my earlier message but this program

import socket
s = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
s.connect('/dev/log')
s.send(b"test from test.py\n")

was started while log was aready running. (Also tested stand alone not under procd harness).

As for the connection refused error not being reported, it output to stderr. I guess it's still about the stdio buffer thing.

When procd is doing redirect, doesn't procd open the socket to /dev/log, so wouldn't the error be handled on the outside of Python's i/o buffering?

Good question :wink: procd does not check return value of openlog() call. No need to I may say. The openlog() call will be tried each time there arrives something on instance stdio.

Some pseudo code. It's like syslog context switching.

if (instance_stdio_has_sth) {
    closelog()

    openlog(instance.name)
    syslog(instance_stio_content)
    closelog()

    openlog("procd")
}

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.