Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Iocage upgrade problem

adrianwi

FreeNAS Guru
Joined
Oct 15, 2013
Messages
1,002
I managed to build myself a jail to run LimeSurvey in, which appears to be working remarkably well :) If I can do it again, I might even make a 'How to...' guide!

I mistakenly created the jail using 11.1-RELEASE so after creating thought I'd upgrade it using

Code:
iocage upgrade -r 11.2-RELEASE limesurvey


It was taking some time, but eventually completed and said I needed to reboot and then install a file it had created in /tmp (can't remember the name)

I rebooted FreeNAS but when I looked in the /tmp folder the tmp file had gone. Everything started up OK, so thought I'd try again.

Seemed to take less time, but then I got this:

Code:
Preparing to download files... done.
/tmp/tmp4m16fxr0: cannot open files/.gz: No such file or directory (about 50 times)

Attempting to automatically merge changes in files... done.

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /boot/device.hints
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/amd.map
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/apmd.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/auto_master
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/autofs/include_ldap
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/autofs/include_nis
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/autofs/include_nis_nullfs
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/autofs/special_hosts
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/autofs/special_media
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/autofs/special_noauto
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/autofs/special_null
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/blacklistd.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/bluetooth/hcsecd.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/bluetooth/hosts
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/bluetooth/protocols
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/crontab
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/csh.cshrc
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/csh.login
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/csh.logout
Does this look reasonable (y/n)? yy

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/ddb.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/defaults/bluetooth.device.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/defaults/devfs.rules
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/defaults/periodic.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/defaults/rc.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/devd.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/devd/asus.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/devd/hyperv.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/devd/uath.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/devd/ulpt.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/devd/usb.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/devd/zfs.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/devfs.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/dhclient.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/disktab
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/dma/dma.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/fbtab
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/ftpusers
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/gettytab
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/gss/mech
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/gss/qop
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/hosts.allow
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/hosts.equiv
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/hosts.lpd
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/inetd.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/libalias.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/libmap.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/locate.rc
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/login.access
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/login.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mac.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mail/Makefile
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mail/README
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mail/access.sample
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mail/aliases
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mail/freebsd.cf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mail/freebsd.mc
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mail/freebsd.submit.cf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mail/freebsd.submit.mc
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mail/mailer.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mail/mailertable.sample
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mail/sendmail.cf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mail/submit.cf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mail/virtusertable.sample
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mtree/BSD.debug.dist
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mtree/BSD.include.dist
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mtree/BSD.lib32.dist
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mtree/BSD.root.dist
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mtree/BSD.sendmail.dist
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mtree/BSD.tests.dist
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mtree/BSD.usr.dist
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/mtree/BSD.var.dist
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/netconfig
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/netstart
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/network.subr
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/networks
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/newsyslog.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/nscd.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/nsmb.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/nsswitch.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/ntp.conf
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/opieaccess
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pam.d/README
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pam.d/atrun
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pam.d/cron
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pam.d/ftp
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pam.d/ftpd
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pam.d/imap
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pam.d/login
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pam.d/other
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pam.d/passwd
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pam.d/pop3
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pam.d/rsh
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pam.d/sshd
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pam.d/su
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pam.d/system
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pam.d/telnetd
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pam.d/xdm
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/pccard_ether
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/periodic/daily/100.clean-disks
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/periodic/daily/110.clean-tmps
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/periodic/daily/120.clean-preserve
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/periodic/daily/130.clean-msgs
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/periodic/daily/140.clean-rwho
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/periodic/daily/150.clean-hoststat
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/periodic/daily/200.backup-passwd
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/periodic/daily/210.backup-aliases
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/periodic/daily/300.calendar
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/periodic/daily/310.accounting
Does this look reasonable (y/n)? yy

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/periodic/daily/330.news
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/periodic/daily/400.status-disks
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/periodic/daily/401.status-graid
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/periodic/daily/404.status-zfs
Does this look reasonable (y/n)? y

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/periodic/daily/406.status-gmirror
Does this look reasonable (y/n)? yy

The following file will be removed, as it no longer exists in
FreeBSD 11.2-RELEASE: /etc/periodic/daily/407.status-graid3
Does this look reasonable (y/n)? n
Traceback (most recent call last):
  File "/usr/local/bin/iocage", line 10, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/iocage_cli/upgrade.py", line 39, in cli
    ioc.IOCage(jail=jail, skip_jails=True).upgrade(release)
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/iocage.py", line 1838, in upgrade
    root_path).upgrade_jail()
  File "/usr/local/lib/python3.6/site-packages/iocage_lib/ioc_upgrade.py", line 116, in upgrade_jail
    raise RuntimeError("Error occured, jail not upgraded!")
RuntimeError: Error occured, jail not upgraded!
root@freenas1:~ #


After so many 'y' responses, I was beginning to think maybe this wasn't a great idea so selected 'n' and then got the traceback.

Any ideas what's gone wrong as I'd upgraded jails in the past (from 11.1 to 11.2) and all my others are running 11.2?

Thanks
 

dlavigne

Storage Engineering
Administrator
Moderator
iXsystems
Joined
May 24, 2011
Messages
11,859
Is this on 11.2-U3 (in your sig) or 11.2-U6?
 

adrianwi

FreeNAS Guru
Joined
Oct 15, 2013
Messages
1,002
11.2-U3. I did think I might get advised to upgrade :D

I'll update to U6 and give it another go.
 
Last edited:

adrianwi

FreeNAS Guru
Joined
Oct 15, 2013
Messages
1,002
No, it's still not having it.

Pretty similar to OP but persisted and answered 'y' to about another 100 files. It then gave me a big long list of files to be updated, before the message:

Code:
To install the downloaded upgrades, run "/tmp/tmp_liab2xf install".


I ran that and get:

Code:
No updates are available to install.
Run '/tmp/tmp_liab2xf fetch' first.


Running /tmp/tmp_lia2xf fetch gets me:

Code:
tmp_liab2xf: SERVERNAME must be given via command line or configuration file.


Not sure what else to try?
 

adrianwi

FreeNAS Guru
Joined
Oct 15, 2013
Messages
1,002
Do I need to log this as a bug?
 

fracai

FreeNAS Guru
Joined
Aug 22, 2012
Messages
1,184
What state is your jail in right now? For what it's worth, I upgraded several from 11.1 to 11.2 a while back and though I remember seeing the message about running the "tmp" file, I figured it was a message that the upgrade was handling for me. You're upgrading the jail so the reboot message applies to the jail not FreeNAS itself. I'm pretty sure the only steps I took were to upgrade the release (iocage upgrade -r 11.2-RELEASE jail_name and then a command, that I forget, to automate updating all the packages. I put together a script for this for when I upgrade the release again. I can post that later today.

It's possible you got your jail in to an odd state by re-running a script that didn't need to be run a second time.
 

adrianwi

FreeNAS Guru
Joined
Oct 15, 2013
Messages
1,002
The jail is still working fine, but didn't upgrade and is still on 11.1-10
 

fracai

FreeNAS Guru
Joined
Aug 22, 2012
Messages
1,184
First, sorry I forgot to post my upgrade script. I'll try to get it here soon.

If I read the history here correctly, it looks like you've tried the upgrade a second time and that's when you get the multiple confirmation prompts?
How was the jail created? I try to create mine with automated scripts so I can easily destroy and recreate if necessary. Is that an option?
 

adrianwi

FreeNAS Guru
Joined
Oct 15, 2013
Messages
1,002
Firstly, thanks for your help.

No, I got the multiple confirmation prompts the first time I tried to upgrade, but answered 'n' after several attempts.

Jail was created manually from the CLI with something like:

Code:
iocage create --name 'limesurvey' -r 11.1-RELEASE ip4_addr='vnet0|192.168.n.n/24' defaultrouter='192.168.n.n' vnet='on' allow_raw_sockets='1' boot='on'


I've upgraded a number of jails before, when moving from FreeNAS 11.1 to 11.2, and don't remember any problems, but not this one for some reason.
 

fracai

FreeNAS Guru
Joined
Aug 22, 2012
Messages
1,184
hmmm.

Only thing I can think of is to suggest trying the upgrade again.

The scripts that I use to upgrade my jails and packages are:


Code:
#!/usr/bin/env bash

# upgrade.sh -- upgrade a jail to a new release, upgrade all packages, then restart the jail
# invoke as: upgrade.sh jail-name release-version
# ie: upgrade.sh plex 11.1-RELEASE

set -e

JAIL=$1
RELEASE=$2

# echo the jail-name and print the current release version
echo $JAIL
iocage get release $JAIL

# upgrade the release
iocage upgrade $JAIL -r $RELEASE
# upgrade the packages
iocage update $JAIL
# the above doesn't seem to always upgrade everything
iocage exec $JAIL 'ASSUME_ALWAYS_YES=yes pkg upgrade'
# restart the jail
iocage restart $JAIL


Code:
#!/usr/bin/env bash

# upgrade all packages in each of the given jails, offering to reboot the jail or abort along the way
# the second prompt is to allow checking that the jail is functional before continuing
# invoke as: upgrade-pkg.sh jail-1 jail-2 jail-3 ...
# ie: upgrade-pkg.sh plex gitea

set -e

for JAIL in $@
do
    echo $JAIL
    iocage exec $JAIL 'ASSUME_ALWAYS_YES=yes pkg upgrade'
    read -p "Updated: $JAIL. Restart, Abort, _Continue_? [RAC]" -n 1 -r
    echo
    if [[ $REPLY =~ ^[Rr]$ ]]
    then
        iocage restart $JAIL
        read -p "restarted: $JAIL. Abort, _Continue_? [AC]" -n 1 -r
        echo
        if [[ $REPLY =~ ^[Aa]$ ]]
        then
            break
        fi
    elif [[ $REPLY =~ ^[Aa]$ ]]
    then
        break
    fi
done
 

gt2416

FreeNAS Experienced
Joined
Feb 4, 2018
Messages
191
I like that update package script. Anyway to automate it for all your jails instead of specifying them?
 

colmconn

FreeNAS Experienced
Joined
Jul 28, 2015
Messages
110
Something like this should do the trick. I leave it to you to fill in the actual jail upgrade instructions in the last loop.

Code:
#!/usr/bin/env bash                                                                                                                          
                                                                                                                                             
active_iocage_pool=$( iocage get -p 2>/dev/null )                                                                                            
if [[ -z "${active_iocage_pool}" ]] ; then                                                                                                    
   echo "It looks like iocage has not been activated on a pool yet. Cannot continue."                                                        
   echo "active_iocage_pool = ${active_iocage_pool}"                                                                                        
   exit 1                                                                                                                                    
fi                                                                                                                                          
                                                                                                                                             
if [[ -z "$*" ]] ; then                                                                                                                      
        echo "No jails to upgrade specified on the command line. Querying iocage."                                                            
        jails=$( iocage list -hq | awk '{print $1}' |tr '\n' ' ' 2> /dev/null )                                                              
        if [[ ! -z ${jails} ]] ; then                                                                                                        
                echo "The following jails will be upgraded:"                                                                                
                echo "${jails}"                                                                                                              
        else                                                                                                                                
                echo "Got no list of jails form iocage. Nothing to upgrade. Exiting."                                                        
                exit                                                                                                                        
        fi                                                                                                                                  
else                                                                                                                                        
        jails="$*"                                                                                                                          
        echo "The following jails provided on the command line will be upgraded:"                                                            
        echo "${jails}"                                                                                                                      
                                                                                                                                             
fi                                                                                                                                          
                                                                                                                                             
for jail in ${jails} ; do                                                                                                                    
        echo "${jail}: upgrade jail instructions go here"                                                                                    
done                                                                                                                                        
 

fracai

FreeNAS Guru
Joined
Aug 22, 2012
Messages
1,184
Nice. I usually just grep the output of iocage list, but that script is nicely comprehensive.
 
Top