Tiny Tiny RSS: Community

[Solved] Lock directory on NFS


#1

This is not really a support request anymore since I figured it out myself but I think this might be good knowledge if anyone else is ignorant/stupid enough to do what I did.

Describe the problem you’re having:
Update daemon would not start. An empty lockfile was created but then the script died with “error: Can’t create lockfile ($lock_filename). Maybe another update process is already running.” Same issue with both update.php and update_daemon2.php.

If possible include steps to reproduce the problem:
Install tt-rss on NFS share…

tt-rss version (including git commit id):
7c4d7bce3f15afbdab0487e101cd2f85afed8bd5

Platform (i.e. Linux distro, PHP, PostgreSQL, etc) versions:
FreeBSD 11.1
Nginx 1.12.1
Postgresql 9.5.10
PHP 5.6

Please provide any additional information below:
I fixed this by putting the lock directory on local storage. It appears that flock in include/functions.php/make_lockfile fails if the lock files are on NFS storage. Not being an NFS expert, the best solution for me is to put the lock directory elsewhere.


#2

flock() syscall works just fine on nfs on linux btw

(something about freebsd always being inferior and stuck in the past)


#3

@greatgoran needs to enable the lock daemon on his NFS server by adding this line to /etc/rc.conf:
rpc_lockd_enable=“YES”

It’s easy to say that this is user error but I think FreeBSD is to blame as well for having a stupid default in which lockd doesn’t run by default when you’re an NFS server. See the default settings in the /etc/defaults directory:

$ grep rpc_lockd_enable /etc/defaults/rc.conf
rpc_lockd_enable=“NO” # Run NFS rpc.lockd needed for client/server.


#4

Thanks @Kapowee, I kind of figured it was something like that. In my case, it is FreeNAS serving this share, so will need to check how to get lockd going there.

It’s a bit weird but it says lockd is running:

[[email protected] /etc/defaults]$ sudo service lockd status
lockd is running as pid 1894.

Anyway, this is clearly not a tt-rss problem, like so many others, but still might be useful for someone else. Maybe there could be a note in config.php or in the UpdatingFeeds information that you may have trouble if the lock directory is on (broken) NFS.


#5

adding notes about every broken platform under the sun to the wiki and config files would make them completely incomprehensible. niche stuff like that is why we have this forum.


#6

Yup, you’re right. I’m off to the BSD forums to get to the bottom with this.