# NAME

safe-kernel-upgrade - upgrade packages only when a compatible AuriStor kernel module is available

# SYNOPSIS

**safe-kernel-upgrade** \[**--mail-to** _address_\] \[**--verbose**|**-v**\]

# DESCRIPTION

**safe-kernel-upgrade** guards an **apt-get upgrade** behind a
pre-flight check that ensures a pre-built AuriStor kernel module is
available for the latest kernel.  This prevents the system from
upgrading to a kernel that would lack AuriStor filesystem support.

The script performs the following steps:

1. Runs **auristor-client-installable -v** to verify that an
**auristorfs-modules3-\*** package exists for the latest kernel.
If the check fails the script sends a notification email (if
**--mail-to** was specified) and exits without upgrading.
2. Runs **apt-get -y upgrade** with **DEBIAN\_FRONTEND** set to
`noninteractive`.
3. Sends a notification email (if **--mail-to** was specified) with the
output of **apt-get upgrade** as the message body.
4. If `/var/run/reboot-required` exists after the upgrade, the
system is rebooted immediately.

All progress messages are written to syslog (facility `user`, tag
`upgrade-kernel`).  With **--verbose**, messages are also written to
standard output.

# OPTIONS

- **--mail-to** _address_

    Send a notification email to _address_ after each run.  The subject
    line begins with `safe-kernel-upgrade:` followed by a short summary.
    The message body contains the output of **apt-get -y upgrade** (or, if
    the AuriStor pre-flight check failed, the output of
    **auristor-client-installable**).  If this option is not specified, no
    email is sent and a message is logged to that effect.

- **--verbose**, **-v**

    Print progress messages to standard output in addition to syslog.

# EXIT STATUS

- **0**

    The upgrade completed successfully and no reboot was required.

- **1**

    The AuriStor module check failed and no upgrade was performed.

# FILES

- `/var/run/reboot-required`

    Checked after the upgrade to decide whether to reboot.

# DEPENDENCIES

**auristor-client-installable**(1), **apt-get**(8), **logger**(1),
**mail**(1), **reboot**(8).

# SEE ALSO

**auristor-client-installable**(1), **apt-get**(8), **mail**(1),
**reboot**(8)
