Menu

#93 Let the barman user stop "barman -q cron" without being root

2.x
open
nobody
None
2018-06-15
2018-06-15
Greg Clough
No

PROBLEM

When barman is installed on CentOS v7, it creates this root owned file:

barman@postgres01 ~$ ls -al /etc/cron.d/barman
-rw-r--r--. 1 root root 120 Jun 15 17:25 /etc/cron.d/barman

barman@postgres01 ~$ cat /etc/cron.d/barman
# m h  dom mon dow   user     command

  * *    *   *   *   barman   [ -x /usr/bin/barman ] && /usr/bin/barman -q cron

This means that barman -q cron is running every minute, but is not in control of the barman user, because the file is root owned. It's also a little confusing. I was trying to stop barman streaming from my databases so that I could do some filesystem maintenance, but it kept restarting.

SOLUTION

Instead, could you create a cron job in the barman users crontab? This would put it under control of the "barman" user, as some of us don't get to have root privileges on the boxes we manage.

ENVIRONMENT

barman@postgres01 ~$ barman --version
2.3

Barman by 2ndQuadrant (www.2ndQuadrant.com)
barman@postgres01 ~$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
barman@postgres01 ~$ uname -a
Linux postgres01 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Discussion


Log in to post a comment.

MongoDB Logo MongoDB