This seems like such a straight forward process after reading the explanation, but I am out of ideas as to what to look at next. I am starting of my project with SABnzbd and will work out from there to CP, Headphones, Plex, etc. To test SAB I have downloaded an nzb for an album, uploaded it to SAB and have successfully downloaded the file, but cannot post process. The exact error is:
2016-03-17 13:00:36,213 ERROR: Post Processing Failed for The Weeknd - Beauty Behind the Madness (Cannot create final folder /complete/music/The Weeknd - Beauty Behind the Madness)
2016-03-17 13:00:36,213 ERROR: Failed making (/complete/music/The Weeknd - Beauty Behind the Madness)
SAB is configured to use /media/Downloads then /incomplete and /complete with the category music (which based on what I am seeing I believe uses a sub folder in complete for a full path of /media/Downloads/complete/music).
/media/Downloads is a dataset configured as 775 media (UID 816): Downloads (GID 1002) (The storage path is /mnt/ZFS-Vol-01/Downloads and is added to the jail as /media/Downloads)
I originally figured the group approach would be the most straight forward. This in my mind allows the actual service account user in the jail to only need to be added to the group versus a change in account. After the group yielded this error, I created the media user (UID 816) and added it as the owner user to the dataset and saw the same error. I have also tried setting the /media/Downloads folder to 777 with no change in ability to work with the files. Here is what the folder permissions look like now:
drwxrwxr-x 5 media Downloads 5 Mar 16 22:03 Downloads
then inside Downloads:
drwxrwxr-x 3 media Downloads 3 Mar 17 12:16 complete
drwxrwxr-x 3 media Downloads 3 Mar 17 10:26 incomplete
drwxrwxr-x 2 media Downloads 2 Mar 16 22:03 nzb
then inside complete:
drwxrwxr-x 2 media Downloads 2 Mar 17 12:57 music
if I id media, i see the proper group membership, so with user and group being rwx, the permissions look complete:
uid=816(media) gid=816(media) groups=816(media),1002(Downloads)
I also added a shell to the media user to allow me to test creating files as the media user in an attempt to get more information on the denial:
chsh -s /bin/csh media
su media
cd /media/Downloads/complete/music
mkdir test
The directory is created with no issues, and removing the dir with rm -r works as well.
The last thing I have done is to look at the started service with top and see two phython scripts running, one under root and the other under media, I would assume SAB is the media account.
PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
83412 root 6 52 0 176M 51468K usem 0 0:04 0.00% python2.7
87333 media 33 24 0 268M 67228K usem 1 0:03 0.00% python2.7
87209 root 1 20 0 17568K 3164K pause 1 0:00 0.00% tcsh
83119 root 1 20 0 12080K 1876K select 1 0:00 0.00% syslogd
83172 root 1 20 0 14184K 1852K nanslp 1 0:00 0.00% cron
88365 root 1 20 0 18668K 2420K CPU2 2 0:00 0.00% top
I feel like I am right on the edge of this working. I was trying to mess with auditing (no experience doing this in FreeBSD) but couldn't get the service to start.
****UPDATE****
Got it. This was a clear case of me being a bonehead. In the categories section of SAB I expected the path to be relative to that of the downloads folder. When opening my eyes I see that the path was relative to the original installation location, so I was trying to place the files in the wrong place. I hope that some of my troubleshooting with help others in how to test permissions in their folder structure. No amount of testing will help however when you set SAB to put things in places that don't exist!