detail file locking
Thor Spruyt
thor.spruyt at telenet.be
Wed Nov 24 18:40:56 CET 2021
On Nov 24, 2021, at 5:53 PM, aland aland at deployingradius.com wrote:
> Yes.
Ok.
With strace I found out the following:
Here the .work file is tried but doesn't exist:
[pid 14198] open("/opt/radius/var/queue/queue_000/detail.work", O_RDWR <unfinished ...>
[pid 14198] <... open resumed>) = -1 ENOENT (No such file or directory)
Next a new file was detected, which is opened (not sure if it's locked):
[pid 14198] openat(AT_FDCWD, "/opt/radius/var/queue/queue_000/detail-000", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY <unfinished ...>
[pid 14198] <... openat resumed>) = 183
[pid 14198] getdents(183 <unfinished ...>
[pid 14198] <... getdents resumed>, /* 3 entries */, 32768) = 96
[pid 14198] getdents(183 <unfinished ...>
[pid 14198] <... getdents resumed>, /* 0 entries */, 32768) = 0
Here is the file is closed:
[pid 14198] close(183 <unfinished ...>
[pid 14198] <... close resumed>) = 0
[pid 14198] stat("/opt/radius/var/queue/queue_000/detail-000", <unfinished ...>
[pid 14198] <... stat resumed>{st_mode=S_IFREG|0644, st_size=12294, ...}) = 0
And here the rename happens, but isn't the lock gone due to the close ?
[pid 14198] rename("/opt/radius/var/queue/queue_000/detail-000", "/opt/radius/var/queue/queue_000/detail.work" <unfinished ...>
[pid 14198] <... rename resumed>) = 0
Here it starts prossing the .work file:
[pid 14198] open("/opt/radius/var/queue/queue_000/detail.work", O_RDWR <unfinished ...>
[pid 14198] <... open resumed>) = 199
--
Thor
More information about the Freeradius-Users
mailing list