So I've written a script that allows you to update all of your jails in one swoop using pkg-ng. Here's the info you need to know:
[panel][root@FreeNASMini] /mnt/tank/# ./fnjailup.sh
Usage:
-A Audit all running jails with pkg-ng.
-C Cleanup old packages from the pkg-ng cache
-O Remove orphaned packages
-U Upgrade all running packages with pkg-ng.
-V Do a version comparison of pkg-ng itself.
-p Pause after each jail completes its task.
-y If done with -U will not prompt for confirmation
to download packages for installation.
Version 1.0 (June 4, 2014)
Reminder: Your jails must be running and you must run this script as root.
WARNING: It is always recommended you make a snapshot of your jail before doing
any updates to software as updates may cause packages installed to no longer
behave properly.
[/panel]
Keep in mind a few things:
1. The jail must be up and running to interact with this script. (ie start all of your jails before running this script to update all of your jails at once).
2. You may want to shutdown processes that require updates for packages that will need to be updated. For example, if you run Minecraft in a jail(which uses java) and the java package needs to be updated it would be wise to stop Minecraft.
3. You may want to restart the jail after installing updates just to make sure everything is properly applied for all of the processes inside the jails.
4. ZFS snapshots can be a real hero if things go badly for your jail when you update! So always do a manual zfs snapshot of your jail before doing updates. I haven't had a problem yet in my 3 months of testing, but that doesn't mean you won't.
5. If your pkg-ng version is older than 1.2.7 then your repositories are not set properly. See my thread here. You will get a warning if any of your jails aren't on 1.2.7 or newer and the script will abort. Since 1.2.7 has been out for over 2 months if you aren't on 1.2.7+ you are a bad boy and should be spanked.
6. If your jail has open access to the internet via port forwarding you absolutely should be keeping stuff up to date! Doing this regularly is a must!
7. Sometimes package conflicts will occur. This script will not be able to automatically handle those conflicts. You will have to resolve them on your own.
8. If you aren't using pkg-ng you are a bad boy/girl. This script won't work for you and you should seriously consider upgrading to a real pkg management system.
Basically you can throw this script anywhere you want, give it execute permissions and run it as root.
Current version: 1.0
- Special thanks to wedgie and YCNZ in IRC for a little help with the scripting.
[panel][root@FreeNASMini] /mnt/tank/# ./fnjailup.sh
Usage:
-A Audit all running jails with pkg-ng.
-C Cleanup old packages from the pkg-ng cache
-O Remove orphaned packages
-U Upgrade all running packages with pkg-ng.
-V Do a version comparison of pkg-ng itself.
-p Pause after each jail completes its task.
-y If done with -U will not prompt for confirmation
to download packages for installation.
Version 1.0 (June 4, 2014)
Reminder: Your jails must be running and you must run this script as root.
WARNING: It is always recommended you make a snapshot of your jail before doing
any updates to software as updates may cause packages installed to no longer
behave properly.
[/panel]
Keep in mind a few things:
1. The jail must be up and running to interact with this script. (ie start all of your jails before running this script to update all of your jails at once).
2. You may want to shutdown processes that require updates for packages that will need to be updated. For example, if you run Minecraft in a jail(which uses java) and the java package needs to be updated it would be wise to stop Minecraft.
3. You may want to restart the jail after installing updates just to make sure everything is properly applied for all of the processes inside the jails.
4. ZFS snapshots can be a real hero if things go badly for your jail when you update! So always do a manual zfs snapshot of your jail before doing updates. I haven't had a problem yet in my 3 months of testing, but that doesn't mean you won't.
5. If your pkg-ng version is older than 1.2.7 then your repositories are not set properly. See my thread here. You will get a warning if any of your jails aren't on 1.2.7 or newer and the script will abort. Since 1.2.7 has been out for over 2 months if you aren't on 1.2.7+ you are a bad boy and should be spanked.
6. If your jail has open access to the internet via port forwarding you absolutely should be keeping stuff up to date! Doing this regularly is a must!
7. Sometimes package conflicts will occur. This script will not be able to automatically handle those conflicts. You will have to resolve them on your own.
8. If you aren't using pkg-ng you are a bad boy/girl. This script won't work for you and you should seriously consider upgrading to a real pkg management system.
Basically you can throw this script anywhere you want, give it execute permissions and run it as root.
Current version: 1.0
- Special thanks to wedgie and YCNZ in IRC for a little help with the scripting.