[pve-devel] [PATCH pve-client 1/2] Lock the config file in /var/lock

Dietmar Maurer dietmar at proxmox.com
Tue Jun 19 16:45:12 CEST 2018


> > diff --git a/PVE/APIClient/Config.pm b/PVE/APIClient/Config.pm
> > index a4aa4c6..6f9f332 100644
> > --- a/PVE/APIClient/Config.pm
> > +++ b/PVE/APIClient/Config.pm
> > @@ -64,10 +64,18 @@ sub config_filename {
> >      return "$dir/config";
> >  }
> >  
> > +sub config_lock_filename {
> > +    my ($class) = @_;
> > +
> > +    return "/var/lock/pveclient/config.lck";
> After a short offlist-talk I checked various OS installs for their take
> at /var/lock - and in most (Arch, Alpine(container from pveam),
> Free/OpenBSD) the directory is only writable by root (and by group
> uucp on alpine...), if it exists at all (does not on BSD).
> IMHO it may be more portable to create the lockfile next to the actual
> configfile.

Yes, maybe just use the same directory. But I would prefer to hide the file
by default (".config.lck")?




More information about the pve-devel mailing list