1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvmdbusd: create dirs for lock file

Create leading dirs for lvmdbusd lock file, otherwise it fails to start:

| systemd[1]: Starting LVM2 D-Bus service...
| lvmdbusd[1602]: [1602]: Error during creation of lock file(/var/lock/lvm/lvmdbusd): errno(2), exiting!

Signed-off-by: Kai Kang <kai.kang@windriver.com>
This commit is contained in:
Kai Kang 2023-12-05 15:50:21 +08:00 committed by Zdenek Kabelac
parent 6e985f553b
commit b3189d9b15

View File

@ -778,6 +778,7 @@ class LockFile(object):
def __enter__(self):
try:
os.makedirs(os.path.dirname(self.lock_file))
self.fd = os.open(self.lock_file, os.O_CREAT | os.O_RDWR, stat.S_IRUSR | stat.S_IWUSR)
# Get and set the close on exec and lock the file