In the wiki guidance, it states under "Revise mount_shares_locally":
It seems that the change "mysql -u root -p -e "select comment from shares" hda_production | grep -v "^comment$" | xargs -d "\n" mkdir -p" has already been done.Since Greyhole uses Samba as a layer between the user and itself we would like to keep our writes and deletes to the shares and not the actual landing zone. But since apps (most of them) run as the user apache it will not be able to access /mnt/samba, which is the default mount point if you set up mount_shares_locally. This following script retains the function of the original script but also adds a second mount point under /mnt/apache where the apache user will have read and write access. I have kept it simple and it will use the same credentials as the main mount. So only shares available to that user will be available for apache.
By doing this apache will now have a place where it is allowed to read and write files to your shares and SickBeard can thus be configured to place the new episode in /mnt/apache/TV which is then instantly picked up by Greyhole and file copies distributed to the discs in your pool as configured.
Note that this script is based of the Greyhole original one and uses /etc/samba/smb.conf as the source of your shares and does not load the shares from the database like the old HDA version of the script did. If that behaviour is desired that can be easily added by replacing the lines
testparm -s /etc/samba/smb.conf 2>/dev/null | grep "^\[" | grep -v "\[global\]" | grep -v "\[homes\]" | awk -F'[' '{print $2}' | awk -F']' '{print $1}' | xargs -d "\n" mkdir -p
with
mysql -u root -p -e "select comment from shares" hda_production | grep -v "^comment$" | xargs -d "\n" mkdir -p
I'm not quite sure how to best proceed if I want my apache things to be running as expected.
Note: I've set my sab directory to /mnt/samba/Downloads/
But I'm (understandably) getting the errors:
2018-11-11 23:34:09,228 ERROR: Cannot change permissions of /mnt/samba/Downloads/_UNPACK_<file>.mp4
2018-11-11 23:34:09,226 ERROR: Cannot change permissions of /mnt/samba/Downloads/_UNPACK_<folder>
Any ideas?
Thanks!