0

I have Python script, which use subprocess to run mosquitto.

Mosquitto is carrying out sucessfuly, but writes error in Syslog:

Warning: Unable to locate configuration directory, default config not loaded.

This error caused by Mosquitto bug and may be excluded only by version update, but that is not possible for me.

Are any possible ways to remove just that error from log?

As I understand that is possible to send stderr in null, but I don't know how to process stderr.

That is example, how I run mosquitto.

try:
    subprocess.check_call(args)
except subprocess.CalledProcessError as e:
    sys.stderr.write(
    'ERROR: call to mosquitto_pub failed with error code {}\n'.format(e.returncode))

1 Answer 1

1

Had the same problem, ended up adding a file /etc/rsyslog.d/publoop.conf

with this content

if ($programname contains "publoop") then {
   action(type="omfile" file="/dev/null")
   stop
}

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.