4

I'm wondering if is there any way to change log directory for keepalived daemon. I couldn't find any answer on my question. Maybe it's possible using tools like syslog, rsyslog?

The reason why I'm asking is that I need to run keepalived as user with sudo privileges to run script and without read privileges to messages log file in /var/log.

A.B.
  • 3,442
widget
  • 71

1 Answers1

3

There's nothing special about keepalived logging, it's done through syslog, so syslogd, rsyslog or whatever syslog daemon you have installed is responsible for writing the log data.

You can instruct keepalived to log to another facility instead of "daemon" using the --log-facility option, and configure rsyslog or whatever to write those messages into a separate log file; use chmod on that file to allow reading that file. You may need to also modify the log rotation procedure to preserve that mode.

wurtel
  • 16,115
  • thank You for answering, but changing log facility for keepalived and configuring rsyslog to use another file will redirect all processes using that facility to that file ? – widget Apr 21 '15 at 09:52
  • 1
    Yes, but using that option you tell keepalived to use one of local0-local7; those are usually unused so you should be able to pick one that's free on your system. – wurtel Apr 21 '15 at 10:12