[systemd-devel] [HEADSUP] /var/lock and /var/lock/lockdev

Ludwig Nussel ludwig.nussel at suse.de
Fri Apr 1 02:37:22 PDT 2011

Lennart Poettering wrote:
> I'd like to see this cleaned up and standardized in a secure way among
> the distros, so here's what I propose for adoption:
>     /var/lock should be root:root 0755 and the place for various system
>     service lock directories such as /var/lock/subsys or /var/lock/lvm.
>     /var/lock/lockdev should be root:lock 0775 and the place for
>     LCK..xxx style device lock files.

Those strangely named lock files in /var/lock only exist because of
legacy programs. If they are no longer put in /var/lock you're
throwing away the legacy compatibility and you don't actually need
to create those files at all anymore.
So if legacy compat isn't needed one could just use fcntl for
locking the devices (maybe time to fix the kernel in case that
doesn't work already). Programs using liblockdev would transparently
use the new method, we'd have one less ugly setgid program, the stale
lock file problem wouldn't exist anymore and locking would work for
chroots too. 


 (o_   Ludwig Nussel
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)

More information about the systemd-devel mailing list