Trivial Automatic Update

Description

Package mdvl-trivial-automatic-update supplies a systemd timer for periodically invoking unattended-upgrades and permits multiple mirrors where the first one to be online is chosen. This allows upgrading a server from a local mirror which is preferred if it is online but allows running on another mirror for fallback.

To use a mirror depending on which is online, /etc/apt/sources.list is temporarily replaced with a script-created one before invoking the actual unattended-upgrades.

Compilation and Installation

The package can be generated by calling ant package on a Debian system with the necessary tools to build packages and ant installed. Alternatively, the repository for megasync(32) includes a compiled version of this package: https://github.com/m7a/lo-megasync/blob/master/mdvl-trivial-automatic-update_1.0.3_all.deb?raw=true.

Installation can be performed with apt as follows:

# apt install ./mdvl-trivial-automatic-update*all.deb

Afterwards, the update process can be enabled by calling

# systemctl enable mdvl-trivial-automatic-update.timer

If you want to test how it runs before enabling the timer, run

# systemctl start mdvl-trivial-automatic-update.service

and then check the outputs of

# systemctl status mdvl-trivial-automatic-update.service
# journalctl -u mdvl-trivial-automatic-update.service

Configuration

The package is configured by file /etc/ma_trivial_automatic_update.conf which looks as follows:

# This configuration is sourced by
# /usr/local/bin/ma_trivial_automatic_update
# MIRRORLIST: space-separated list of mirror addresses to check.
MIRRORLIST="192.168.1.16 ftp.de.debian.org"
# USE_LTS: if 1 disable version-update line.
USE_LTS=0

Two settings are available:

MIRRORLIST
Lists all mirrors to consult. The first one listed is preferred. In the default configuration, a local mirror is expected to be present at 192.168.1.16 and if it is offline, ftp.de.debian.org is used instead.
USE_LTS
This setting can either be 0 or 1 and configures the sources.list to use for upgrading: Debian LTS does not include support for the RELEASENAME-updates repository and thus the corresponding lines is only generated if USE_LTS=0 is set.

Files

ma_trivial_automatic_update.conf Configuration
mdvl-trivial-automatic-update.service Systemd service unit
mdvl-trivail-automatic-update.timer Systemd timer
ma_trivial_automatic_update Checks mirror status and calls unattended-upgrades
build.xml and debian-changelog.txt Package metadata

Use cases

Automatic updates are always a little risky and not recommended for systems that see a large fluctuation in the types of software installed because there, updates may often introduce problems. For regular Debian stable systems, however, updates are often stable enough to permit automatic installation.

This package is intended to be used on small, single-purpose servers, virtual machines and inside containers.


Ma_Sys.ma Website 5 (1.0.0) – no Flash, no JavaScript, no Webfont, no Copy Protection, no Mobile First. No bullshit. No GUI needed. Works with any browser.

Created: 2020/08/21 22:24:45 | Revised: 2020/08/21 22:41:54 | Tags: mdvl, debian, update, automatic, package | Version: 1.0.0 | SRC (Pandoc MD) | GPL

Copyright (c) 2020 Ma_Sys.ma. For further info send an e-mail to Ma_Sys.ma@web.de.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.