Yorick
Wizard
- Joined
- Nov 4, 2018
- Messages
- 1,912
I have a workaround for the issue where we can't restart the jail without losing /dev/dri. My caution is that when I tested this "over and over again", I caused FreeNAS to crash and reboot. While this might allow you to restart the jail without losing /dev/dri, still use caution and don't restart Plex "just because", as you might crash FreeNAS in the process.
1) Change the plex-ruleset.sh script to use ruleset 110, not 5; and change the Plex jail to use ruleset 110. Rationale: Visibility. You will see the incorrect devfs behavior on iocage restart this way, but not when the ruleset is 5. With ruleset 5, in failure case, you get "+ Removing devfs_ruleset: 5 OK" on stop followed by "+ Using devfs_ruleset: 5" on start. With ruleset 110, in failure case, you get "+ Removing devfs_ruleset: 110 OK" on stop, followed by "+ Using devfs_ruleset: 5" on start. This makes it immediately obvious when something went wrong. You can then either reboot FreeNAS or manually edit /etc/devfs.rules and restart the devfs service to mimic what the script does. Either way, make sure ruleset 110 is present before starting the Plex jail again.
2) To restart the Plex jail, use a sequence of "iocage stop plex" followed by "service devfs restart" followed by "iocage start plex". Stick that into a script if you like.
You should see "+ Removing devfs_ruleset: 110 OK" on stop, followed by "+ Using devfs_ruleset: 110" on start.
Again, caveat that running this repeatedly may very well crash FreeNAS. It did for me on ruleset 5; I didn't hammer on it with ruleset 110. My backup is running and I don't want to crash FreeNAS again.
1) Change the plex-ruleset.sh script to use ruleset 110, not 5; and change the Plex jail to use ruleset 110. Rationale: Visibility. You will see the incorrect devfs behavior on iocage restart this way, but not when the ruleset is 5. With ruleset 5, in failure case, you get "+ Removing devfs_ruleset: 5 OK" on stop followed by "+ Using devfs_ruleset: 5" on start. With ruleset 110, in failure case, you get "+ Removing devfs_ruleset: 110 OK" on stop, followed by "+ Using devfs_ruleset: 5" on start. This makes it immediately obvious when something went wrong. You can then either reboot FreeNAS or manually edit /etc/devfs.rules and restart the devfs service to mimic what the script does. Either way, make sure ruleset 110 is present before starting the Plex jail again.
2) To restart the Plex jail, use a sequence of "iocage stop plex" followed by "service devfs restart" followed by "iocage start plex". Stick that into a script if you like.
You should see "+ Removing devfs_ruleset: 110 OK" on stop, followed by "+ Using devfs_ruleset: 110" on start.
Again, caveat that running this repeatedly may very well crash FreeNAS. It did for me on ruleset 5; I didn't hammer on it with ruleset 110. My backup is running and I don't want to crash FreeNAS again.