New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Systemd unit file #23
Comments
I am having issues with this set-up. Eventually one of the processes started in the background (one for each mount ID) crashes.
When using the start script as above, this would happen regularly immediately after launching the script. I then added |
In case anyone cares, my work-around to the above issue consists in calling '/bin/systemctl restart' hourly on the service file from /etc/contab. No crashes have been observed as by journalctl. |
I just wanted to confirm that this work-around seems to be working, indeed! No crash has been observed over the 25 days that it has been in action. |
Here's my first poor man's version of a systemd file on my Arch Linux server:
I expect this to be more robust due to Restart=always. It should be possible to use systemd Unit templates, and some script to actually derive service instances for each external ID from that. |
I have been struggling literally for years with the Nextcloud client not recognizing changes in external storage. The first and only useful information about a working solution I found in the Nextcloud forum but it is lacking a systemd unit file for non-Docker set-ups. I have cobbled one together that I want to share. It is functional in Nextcloud 24 on Ubuntu 20.04. This is my first try at such a thing and comments as well as suggestions are welcome. I include the full source code here in order to facilitate the discussion.
The start script launches files_external:notify for each mount ID present. It does not change fs.inotify.max_user_watches which might be necessary if the total number of folders being watched is greater than 8192. That could be scripted as well but I do not have need for it now. A manual work-around is to set that value in /etc/sysctl.conf.
/etc/systemd/system/nextcloud-files-inotify.service (-rw-r--r-- 1 root root)
/usr/local/bin/nextcloud-files-external-notify.start (-rwxr--r-- 1 www-data www-data)
/usr/local/bin/nextcloud-files-external-notify.stop (-rwxr--r-- 1 www-data www-data)
The text was updated successfully, but these errors were encountered: