How do I set the dataset permission manually? I think this is my first step before I attempt at updating the data ownership within the dataset. Otherwise I'd have to create a new dataset with Unix permission and copy TB of data to it from the old dataset. Would this method be a more "safe" way to do it without potential command line screw ups?
First off this can be done via the GUI. In the storage tab where the pools are listed if you click the key at the bottom after the dataset is highlighted the owner and permissions can be switched to whoever. For me this user is JBD. I say to be careful here, because if your jails dataset resides in the same pool and you go willy nilly and switch the entire pool to this user recursively, it will also switch the jails files to be owned by this user-or at least the bulk of them, then you have opened up a can of worms. Jails wont start and you are basically screwed. So avoid this by going to each dataset that holds media, or other files--documents, photos, whatever they may be and change the permissions on ONLY THOSE DATASETS--one at a time. I think we are both dealing with media of sorts, so basically can switch only the media datasets to this "JBD" user. Alternatively one user can own the root of the dataset, then another user can own files that reside in this dataset. This would be done via SSH and using the chown command. A simple example "chown -R JBD:media /mnt/TANK/movies" I have and do do it this way from time to time but for the most part you can just use the GUI. It is the recommended and safest way. Chowning files comes in handy when you need only modify one folder or file.
Did you manually add the user/group lines in the rc.conf file? Is that what sysrc lines in your buddies blog are for? From what I can tell, I only have sabnzbd set as media user/group when I view the rc.conf file in my jail.
Yes I can add them manually using nano, but sysrc does the same thing. If it makes sense for you to use media as a user on all plugins that are dealing with media, that is totally fine. In my case my user is JBD but for you it can be anything.
Before I add a user, is there a way I can list users in the jail? I would hate to add a user if it already exists.
The system would certainly tell you if you try to add a user that already exists. The easy way to see what users you have already in any *nix system is
cat /etc/passwd
Are you referring to this path in the jail or FreeNAS root directory? How did you pull the permissions of the users/groups as you've done below
This path is within the jail. Use jexec to get into the jail in question example: Find jail number by doing
jls
then using YOUR jail number (or simply the jail name)
jexec 1 csh
So once in your SAB jail do
cd /usr/local
Then do simply
and you will get a printout like I have shown. Then as I stated before this is where chown comes in handy because we only want to do one or a few directories and not everything. The directories that correspond to your plugins you would do (EXAMPLE-you will vary)
chown -R media:media sabnzbd/
your chosen user/group will possibly vary. Repeat for each plugin that you want to run as this user. In the end running
ll
again will produce a similar printout to the one I have shown where your plugin directories will be owned by the user that the plugin is running as. Now when you start all the plugins, they will start and run as this user. Example:
service sabnzbd start
Repeat this command for each program. If there are any hiccups or things fail to start this is where you will find out about it. The programs might complain about who knows what, but if done as I have highlighted everything will start no problems. You can check this is the case by doing a
top
to verify this.
Make sure the datasets in questions are added as storage to this jail in the FreeNAS GUI. I mount things to "/media or /mnt" personally. Now whenever these programs want to access data either they read, write, move, execute, there are no more problems because the programs own all the data in question. One last thing. When you do mount these storages to the jail tick the box that asks if directories should be created. For example. I mount my movies to sabs media jail like this. Choose your main movie folder to mount to /media. In the GUI storage section when you mount choose /mnt/TANK/movies as source, and /media as destination, with the create directory option ticked, the folder will be mounted automatically to /media/movies. Repeat for each dataset that you need mounted to the jail. Then they all file nicely into /media.
I hope this helps you. Sorry I have been out of town on business the last few days. Let me know if I can help you any further.