barman icon indicating copy to clipboard operation
barman copied to clipboard

barman_lock_directory on debian doesn't create /var/run/barman

Open flibustenet opened this issue 6 years ago • 3 comments

Hi,

On the Debian install, barman.conf suggest barman_lock_directory = /var/run/barman which is a good idea but then it fails because /var/run/barman doesn't exist. The trap is that if one create it like that it will removed at next reboot.

I suggest that debian package create an entry in tmpfiles.d (not sure it's the right place) or at least mention it in barman.conf and in the documentation.

Or maybe i missed something ?

Thanks to share this wonderful tools !

flibustenet avatar Feb 08 '18 17:02 flibustenet

It also doesn't do this on Centos 7, I created a systemd service to create this directory on startup.

jwashington104 avatar Sep 27 '18 10:09 jwashington104

Up this one! And adding to it the infamous barman cron each minute which run for "nothing" except popping errors....

What about switching from the cronjob to a systemd unit to manage the work done by barman cron ?

What about making barman a deamon so it can register the streaming processes, restart them if needed ?

At a bare minimum the solution proposed by @jwashington104 makes sense....

klando avatar Sep 17 '21 14:09 klando

I came up with a tmpfiles entry like this one to handle the rundir with ansible:

# /etc/tmpfiles.d/barman.conf
#Type   Path        Mode    User    Group   Age Argument
d {{ barman_lock_directory }} 0750 {{ barman_user }} {{ barman_group }}

# cleanup of the lockfiles during boot
r! {{ barman_lock_directory }}/*.lock

And it's possible to ask systemd for immediate directory creation with sudo systemd-tmpfiles --create

Note that barman_lock_directory is often defined as /var/run/barman (per suggestion in the barman doc) but /var/run is deprecated in favor of /run, see https://www.man7.org/linux/man-pages/man5/tmpfiles.d.5.html#/RUN/AND/VAR/RUN/ .

klando avatar Sep 19 '21 16:09 klando