mkjail.sh

Check-in [e69a7bcc05]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Upgrade -a should skip if the jail has the same version installed
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:e69a7bcc053654e92f85dac78d1e0a31c81a1f43113dfb8c6c99856c9b64ff9f
User & Date: feld 2018-10-18 19:00:05
Context
2018-10-31
16:33
Ensure new jails get updated automatically upon creation check-in: 7ce5612c9e user: feld tags: master, trunk
2018-10-18
19:00
Upgrade -a should skip if the jail has the same version installed check-in: e69a7bcc05 user: feld tags: master, trunk
2018-10-11
14:06
Improve rollback check-in: 822ad6fc41 user: feld tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/share/mkjail/upgrade.sh.

23
24
25
26
27
28
29


30
31



32

33
34
35
36
37
38
39
    jexec ${JAILNAME} /usr/local/sbin/pkg-static install -fy pkg || _cleanup
    jexec ${JAILNAME} /usr/local/sbin/pkg-static upgrade -fy || _cleanup
    zfs set mkjail:version=${VERSION} ${ZPOOL}${JAILROOT}/${JAILNAME}
}

_alljails()
{


    for i in $(jls -q name); do
      JAILNAME=${i}



      _upgradejail

    done
}

_validate()
{
    # Check for valid parameters
    if [ "${VERSION}x" = "x" ]; then







>
>
|
<
>
>
>
|
>







23
24
25
26
27
28
29
30
31
32

33
34
35
36
37
38
39
40
41
42
43
44
    jexec ${JAILNAME} /usr/local/sbin/pkg-static install -fy pkg || _cleanup
    jexec ${JAILNAME} /usr/local/sbin/pkg-static upgrade -fy || _cleanup
    zfs set mkjail:version=${VERSION} ${ZPOOL}${JAILROOT}/${JAILNAME}
}

_alljails()
{
    local JAILVER
    local JAILPATH
    for JAILNAME in $(jls -q name); do

      JAILPATH=$(jls -j ${JAILNAME} -q path)
      JAILVER=$(zfs get -Hp mkjail:version ${JAILPATH} | awk '{print $3}')
      if [ "${VERSION}" != "${JAILVER}" ]; then
        _upgradejail
      fi
    done
}

_validate()
{
    # Check for valid parameters
    if [ "${VERSION}x" = "x" ]; then