Closed zoeeer closed 2 years ago
That seems to be more a function of your webdav client - http://sabre.io/dav/locks/
The creations are indeed related to client side operations, as I observed. But I still think it's creating way too many locks.
According to the code, bootstrap/server.php is loaded and executed each time index.php is visited. So it creates a new lock file each time a client makes a request, and never releases them?
bootstrap/server.php
// Set up WebDAV locks.
$lockBackend = new \Sabre\DAV\Locks\Backend\File(
tempnam(sys_get_temp_dir(), 'webdav')
);
$lockPlugin = new \Sabre\DAV\Locks\Plugin($lockBackend);
// Add plugins.
$server->addPlugin($lockPlugin);
public/index.php:
<?php
$server = require_once __DIR__ . '/../bootstrap/server.php';
$server->exec();
For now, I made a cron job to remove lock files older than 24 hours.
Can I change server.php to use a single lock file in /tmp instead of creating random-named ones? But I'm not sure how the lock files are used.
No idea. I don't use webdav or sabre-dav. And since this is sabre-dav code, it really isn't the plugin either. I have been recommending people use webdav dockers instead of this plugin since I'm not going to maintain it anymore.
I've tried docker. Everything seems good except the user mapping between host and container. I prefer setting up using nginx directly if not using this plugin. Thanks anyway.
You can change the user id and group id mappings in a container.
great... I'll look into this later. Thanks!
I find that webdav is constantly creating /tmp/webdav#### files. Around 110~140 files are created a minute.
I checked the code /var/www/webdav, and it seems those are lock files created in the /tmp folder.
As to the frequency of creations, I don't think it's normal behavior. Is there anything I can do about this?