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.

1 Answer 1


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.

  • 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, 2015 at 9: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, 2015 at 10:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .