SOLVED Migrating from Warden to Iocage, Permission Problems

Status
Not open for further replies.

Chris Dill

Contributor
Joined
Jan 1, 2014
Messages
116

Chris Dill

Contributor
Joined
Jan 1, 2014
Messages
116
Code:
2018-11-01 16:55:20,371::INFO::[SABnzbd:412] SABYenc module (v3.3.5)... found!
2018-11-01 16:55:20,371::INFO::[SABnzbd:429] Cryptography module (v2.3)... found!
2018-11-01 16:55:20,372::INFO::[SABnzbd:434] par2 binary... found (/usr/local/bin/par2)
2018-11-01 16:55:20,372::INFO::[SABnzbd:444] UNRAR binary... found (/usr/local/bin/unrar)
2018-11-01 16:55:20,372::INFO::[SABnzbd:452] UNRAR binary version 5.60
2018-11-01 16:55:20,372::INFO::[SABnzbd:457] unzip binary... found (/usr/bin/unzip)
2018-11-01 16:55:20,372::INFO::[SABnzbd:462] 7za binary... found (/usr/local/bin/7za)
2018-11-01 16:55:20,372::INFO::[SABnzbd:468] nice binary... found (/usr/bin/nice)
2018-11-01 16:55:20,372::INFO::[SABnzbd:474] ionice binary... NOT found!
2018-11-01 16:55:20,374::INFO::[SABnzbd:1397] Starting web-interface on 0.0.0.0:8080
2018-11-01 16:55:20,374::INFO::[_cplogging:219] [01/Nov/2018:16:55:20] ENGINE Bus STARTING
2018-11-01 16:55:20,513::INFO::[_cplogging:219] [01/Nov/2018:16:55:20] ENGINE Serving on http://0.0.0.0:8080
2018-11-01 16:55:20,513::INFO::[_cplogging:219] [01/Nov/2018:16:55:20] ENGINE Bus STARTED
2018-11-01 16:55:20,514::INFO::[SABnzbd:1435] Starting SABnzbd.py-2.3.4
2018-11-01 16:55:20,514::INFO::[postproc:187] Completed Download Folder /media/Download-Source is not on FAT
2018-11-01 16:55:20,515::INFO::[dirscanner:330] Dirscanner starting up
2018-11-01 16:55:20,515::INFO::[urlgrabber:82] URLGrabber starting up
2018-11-01 16:55:20,660::INFO::[zconfig:64] No Bonjour/ZeroConfig support installed
2018-11-01 16:55:20,953::INFO::[notifier:520] Successfully sent to Pushbullet
2018-11-01 16:55:24,207::INFO::[interface:726] Successful login from 192.168.2.110
2018-11-01 16:55:24,597::INFO::[notifier:520] Successfully sent to Pushbullet
2018-11-01 16:55:30,448::INFO::[downloader:279] Pausing
2018-11-01 16:55:31,108::INFO::[downloader:270] Resuming
2018-11-01 16:55:53,798::ERROR::[config:847] Cannot create backup file for /config/sabnzbd.ini.bak
2018-11-01 16:55:53,798::INFO::[config:848] Traceback:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/sabnzbd/config.py", line 844, in save_config
	shutil.copymode(filename, bakname)
  File "/usr/local/lib/python2.7/shutil.py", line 105, in copymode
	os.chmod(dst, mode)
OSError: [Errno 1] Operation not permitted: '/config/sabnzbd.ini.bak'
2018-11-01 16:56:27,004::ERROR::[config:847] Cannot create backup file for /config/sabnzbd.ini.bak
2018-11-01 16:56:27,004::INFO::[config:848] Traceback:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/sabnzbd/config.py", line 844, in save_config
	shutil.copymode(filename, bakname)
  File "/usr/local/lib/python2.7/shutil.py", line 105, in copymode
	os.chmod(dst, mode)
OSError: [Errno 1] Operation not permitted: '/config/sabnzbd.ini.bak'
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
you could try chmod 777 /config/sabnzbd.ini.bak and chmod 777 /config/sabnzbd.ini Seems the delete permission is missing on them.
 

Chris Dill

Contributor
Joined
Jan 1, 2014
Messages
116
you could try chmod 777 /config/sabnzbd.ini.bak and chmod 777 /config/sabnzbd.ini Seems the delete permission is missing on them.

I wish!

root@POOL2:~ # iocage exec sab chmod 777 /config/sabnzbd.ini.bak
chmod: /config/sabnzbd.ini.bak: Operation not permitted

Nothing I can do can change those files. I have even copied them elsewhere and tried.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Can you get to the files via the path you mounted to the jail /config ? chmod should work even from outside (with the jail stopped)
 

Chris Dill

Contributor
Joined
Jan 1, 2014
Messages
116
Can you get to the files via the path you mounted to the jail /config ? chmod should work even from outside (with the jail stopped)

While the jail is active, I cannot modify the files. While the jail is stopped, I cannot access the files:

Code:
root@POOL2:/mnt/iocage/jails/sab/root/config # iocage exec sab tcsh
root@sab:/ # cd /config
root@sab:/config # ls
admin		   conf			Downloads	   logs			sabnzbd.ini	 sabnzbd.ini.bak
root@sab:/config # exit
exit

root@POOL2:/mnt/iocage/jails/sab/root/config # ls
admin		   conf			Downloads	   logs			sabnzbd.ini	 sabnzbd.ini.bak
root@POOL2:/mnt/iocage/jails/sab/root/config # ls -la
total 74
drwxrwxr-x+  6 _sabnzbd  _sabnzbd	 8 Nov  1 15:50 .
drwxr-xr-x  19 root	  wheel	   23 Nov  1 14:29 ..
drwxrwxr-x+  2 _sabnzbd  _sabnzbd	 8 Nov  2 10:30 admin
drwxrwxr-x+  2 _sabnzbd  _sabnzbd	 2 Nov  1 15:38 conf
drwxrwxr-x+  3 _sabnzbd  _sabnzbd	 3 Nov  1 14:39 Downloads
drwxrwxr-x+  2 _sabnzbd  _sabnzbd	 4 Nov  1 14:39 logs
-rwxrwxr-x+  1 _sabnzbd  _sabnzbd  8243 Nov  1 15:35 sabnzbd.ini
-rwxrwxr-x+  1 _sabnzbd  _sabnzbd  8243 Nov  2 10:30 sabnzbd.ini.bak
root@POOL2:/mnt/iocage/jails/sab/root/config # chmod 777 sabnzbd.ini
chmod: sabnzbd.ini: Operation not permitted
root@POOL2:/mnt/iocage/jails/sab/root/config # chmod 777 sabnzbd.ini.bak
chmod: sabnzbd.ini.bak: Operation not permitted
root@POOL2:/mnt/iocage/jails/sab/root/config # iocage stop sab
* Stopping sab
  + Running prestop OK
  + Stopping services OK
  + Tearing down VNET OK
  + Removing jail process OK
  + Running poststop OK
root@POOL2:/mnt/iocage/jails/sab/root/config # ls
root@POOL2:/mnt/iocage/jails/sab/root/config #
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
With the jail stopped, you should have access from the FreeNAS host directly to the location you mount to /config in the jail (I don’t know where you put that so can’t help with the path).

With the jail running, you would find it in /mnt/iocage/jails/sab/root/config from the host (don’t use iocage exec)
 

Chris Dill

Contributor
Joined
Jan 1, 2014
Messages
116
With the jail stopped, you should have access from the FreeNAS host directly to the location you mount to /config in the jail (I don’t know where you put that so can’t help with the path).

With the jail running, you would find it in /mnt/iocage/jails/sab/root/config from the host (don’t use iocage exec)

Yeah my last command:
root@POOL2:/mnt/iocage/jails/sab/root/config # ls

That is inside of the host Freenas, in the path where the files exist when the jail is started. not sure why the files go away when the jail is stopped. Here are my jail mount points: http://prntscr.com/ldleut
 

Chris Dill

Contributor
Joined
Jan 1, 2014
Messages
116
As you can see I fought with this a while and copied the file all over trying to fix it:

Code:
root@POOL2:/mnt/iocage/jails/sab/root/config # find / -name sabnzbd.ini
/mnt/iocage/jails/sonarr/root/media/Download-Source/sabnzbd.ini
/mnt/iocage/jails/sab/root/tmp/sabnzbd.ini
/mnt/POOL2/apps/sabnzbd/sabnzbd.ini
/mnt/POOL2/apps/sab/sabnzbd.ini
/mnt/POOL2/jails/transmission_1/media/Incomplete/sabnzbd.ini
/mnt/POOL2/jails/transmission_1/media/Download/sabnzbd.ini
/mnt/POOL2/jails/sabnzbd_2/var/db/sabnzbd/sabnzbd.ini
/mnt/POOL2/jails/sabnzbd_2/media/Incomplete/sabnzbd.ini
/mnt/POOL2/jails/sabnzbd_2/media/Download-Source/sabnzbd.ini


Here is the path:

Code:
root@POOL2:/mnt/iocage/jails/sab/root/config # cd /mnt/POOL2/apps/sab/
root@POOL2:/mnt/POOL2/apps/sab # ls
sabnzbd.ini	 sabnzbd.ini.bak
root@POOL2:/mnt/POOL2/apps/sab # ls -la
total 44
drwxrwxr-x+ 2 _sabnzbd  _sabnzbd					4 Nov  1 15:36 .
drwxrwxr-x+ 8 root	  DILLDESIGN\domain users	 8 Nov  2 10:12 ..
-rwxrwxr-x+ 1 _sabnzbd  _sabnzbd				 8243 Nov  1 15:03 sabnzbd.ini
-rwxrwxr-x+ 1 _sabnzbd  _sabnzbd				 8243 Nov  1 15:33 sabnzbd.ini.bak
root@POOL2:/mnt/POOL2/apps/sab # chmod 777 sabnzbd.ini
chmod: sabnzbd.ini: Operation not permitted
root@POOL2:/mnt/POOL2/apps/sab #


Still not editable with the jail off.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
And if you change owner? chown root:wheel ...
 

Chris Dill

Contributor
Joined
Jan 1, 2014
Messages
116
And if you change owner? chown root:wheel ...

Still wont let me chmod. No clue why!

Code:
root@POOL2:/mnt/POOL2/apps/sabnzbd # chown root:wheel sabnzbd.ini
root@POOL2:/mnt/POOL2/apps/sabnzbd # ls -la
total 74
drwxrwxr-x+ 6 _sabnzbd  _sabnzbd					8 Nov  1 15:50 .
drwxrwxr-x+ 8 root	  DILLDESIGN\domain users	 8 Nov  2 10:12 ..
drwxrwxr-x+ 2 _sabnzbd  _sabnzbd					8 Nov  2 11:18 admin
drwxrwxr-x+ 2 _sabnzbd  _sabnzbd					2 Nov  1 15:38 conf
drwxrwxr-x+ 3 _sabnzbd  _sabnzbd					3 Nov  1 14:39 Downloads
drwxrwxr-x+ 2 _sabnzbd  _sabnzbd					4 Nov  1 14:39 logs
-rwxrwxr-x+ 1 root	  wheel					8243 Nov  1 15:35 sabnzbd.ini
-rwxrwxr-x+ 1 _sabnzbd  _sabnzbd				 8243 Nov  2 11:23 sabnzbd.ini.bak
root@POOL2:/mnt/POOL2/apps/sabnzbd # chmod 777 sabnzbd.ini
chmod: sabnzbd.ini: Operation not permitted
root@POOL2:/mnt/POOL2/apps/sabnzbd # chmod 0777 sabnzbd.ini
chmod: sabnzbd.ini: Operation not permitted
root@POOL2:/mnt/POOL2/apps/sabnzbd # chmod 664 sabnzbd.ini
chmod: sabnzbd.ini: Operation not permitted
root@POOL2:/mnt/POOL2/apps/sabnzbd #
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
You might want to create an entire new app folder and create the files again (with the right permissions), then redo the mount in the jail.
 

Chris Dill

Contributor
Joined
Jan 1, 2014
Messages
116
I dont think the d attribute is the issue, here is what I tried:

Delete app folders and recreated manually from freenas base, same chmod problem.
Copied the file under /tmp on freenas base, same chmod problem.
Deleted file altogether, and created a new plank file with vi, copy pasted contents, and it saved with -rwxrwxrwx 1 root wheel 8243 Nov 2 12:08 sabnzbd.ini
Made a new file sabnzbd.txt, same issue as above.
These newly created files I can chmod 777 but it doesnt change anything.

Code:
root@POOL2:/tmp # chmod 777 sabnzbd.txt
root@POOL2:/tmp # ls -la sabnzbd.txt
-rwxrwxrwx  1 root  wheel  8237 Nov  2 12:11 sabnzbd.txt
root@POOL2:/tmp #
 

Chris Dill

Contributor
Joined
Jan 1, 2014
Messages
116
Something is changing the permissions. I manually created everything:

Code:
root@POOL2:/mnt/iocage/jails/sab/root/config # chmod 777 sabnzbd.ini
root@POOL2:/mnt/iocage/jails/sab/root/config # ls -la
total 30
drwxr-xr-x   2 root  wheel	 3 Nov  2 12:20 .
drwxr-xr-x  19 root  wheel	23 Nov  1 14:29 ..
-rwxrwxrwx   1 root  wheel  8243 Nov  2 12:20 sabnzbd.ini
root@POOL2:/mnt/iocage/jails/sab/root/config # iocage start sab


Then I started Sabnzbd and:

Code:
-rwxrwxr-x+  1 _sabnzbd  _sabnzbd  8243 Nov  2 12:07 sabnzbd.ini
-rwxrwxr-x+  1 _sabnzbd  _sabnzbd  8243 Nov  2 12:23 sabnzbd.ini.bak


Could it be something with my filesystem? Created like this: iocage fstab -a sab /mnt/POOL2/apps/sab /config nullfs rw 0 0
 

Chris Dill

Contributor
Joined
Jan 1, 2014
Messages
116
I deleted all files, folders, jail, and plugins. started fresh. Once done building, problem is the same. This is my full install- see any problems with it?

Code:
echo '{"pkgs":["sabnzbdplus","ca_root_nss"]}' > /tmp/pkg.json
iocage create -n "sabnzbd" -p /tmp/pkg.json -r 11.2-RELEASE ip4_addr="192.168.2.66" defaultrouter="192.168.2.1" vnet="on" allow_raw_sockets="1" boot="on"
rm /tmp/pkg.json

mkdir /mnt/POOL2/apps/sabnzbd
mkdir /mnt/POOL2/torrents

iocage fstab -a sabnzbd /mnt/POOL2/apps/sabnzbd /config nullfs rw 0 0
iocage fstab -a sabnzbd /mnt/POOL2/torrents /mnt/torrents nullfs rw 0 0

iocage exec sabnzbd mkdir -p /mnt/torrents/sabnzbd/incomplete
iocage exec sabnzbd mkdir -p /mnt/torrents/sabnzbd/complete

iocage exec sabnzbd ln -s /usr/local/bin/python2.7 /usr/bin/python
iocage exec sabnzbd ln -s /usr/local/bin/python2.7 /usr/bin/python2

iocage exec sabnzbd chown -R _sabnzbd:_sabnzbd /mnt/torrents/sabnzbd /config
iocage exec sabnzbd sysrc sabnzbd_enable=YES
iocage exec sabnzbd sysrc sabnzbd_conf_dir="/config"

iocage exec sabnzbd service sabnzbd start
iocage exec sabnzbd service sabnzbd stop

iocage exec sabnzbd sed -i '' -e 's?host = 127.0.0.1?host = 0.0.0.0?g' /config/sabnzbd.ini
iocage exec sabnzbd sed -i '' -e 's?download_dir = Downloads/incomplete?download_dir = /mnt/torrents/sabnzbd/incomplete?g' /config/sabnzbd.ini
iocage exec sabnzbd sed -i '' -e 's?complete_dir = Downloads/complete?complete_dir = /mnt/torrents/sabnzbd/complete?g' /config/sabnzbd.ini

iocage exec sabnzbd service sabnzbd start
http://<>:8080/sabnzbd/
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Could it be something with my filesystem? Created like this: iocage fstab -a sab /mnt/POOL2/apps/sab /config nullfs rw 0 0
It's unlikely to be that since you can't get to it from the host either with the jail stopped.

I don't think it's the jail at all, since you can't work on the files properly even with the jail stopped... what are the permissions on your apps dataset?
 

Chris Dill

Contributor
Joined
Jan 1, 2014
Messages
116
It's unlikely to be that since you can't get to it from the host either with the jail stopped.

I don't think it's the jail at all, since you can't work on the files properly even with the jail stopped... what are the permissions on your apps dataset?

As a side note, this is how ALL of my jails act- even ones created with the plugin installed. When the jail is stopped, those mounted folders do not show up. Also of note, I now have Transmissions, Sonarr, Radarr, Jackett, and Organizr working correctly, all using the same design- only Sabnzbd gives me a hard time.

I run a Windows domain at home, and all of my shares are CIFS with domain permissions such as domain\Domain Users.

My main POOL2, which is my only active volume: http://prntscr.com/ldqlyy
This looks to have been created by the system at some point: http://prntscr.com/ldqmhz
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Please stop hosting your screenshots externally--you can just paste them into your messages.

Your problem is that the dataset where you're storing the configuration is using Windows permissions (i.e., ACLs), and the standard Unix chmod command doesn't work with them.
 

Chris Dill

Contributor
Joined
Jan 1, 2014
Messages
116
Please stop hosting your screenshots externally--you can just paste them into your messages.

Your problem is that the dataset where you're storing the configuration is using Windows permissions (i.e., ACLs), and the standard Unix chmod command doesn't work with them.

Sorry, to paste those screenshots I only have to Crtl+D... versus Ctrl+C, Open up Photoshop, New file, Paste, Save, Upload, Embed.

Do you have advice on how to set the ACL? I vaguely remember years ago having to use sacl commands I think. I will dig and see if I can find something.
 

Chris Dill

Contributor
Joined
Jan 1, 2014
Messages
116
I found it:

find . -type d -exec setfacl -m everyone@:full_set:fd:allow {} \;
find . -type f -exec setfacl -m everyone@:full_set::allow {} \;

That changed the permissions to wide open. Still seeing the same error for the time being, will continue to plug at it.
 
Status
Not open for further replies.
Top