install from a hand-written oci-compose; Log2RAM journal fix

OCI manager Apps
- "Install an image that is not in the catalog" reads an oci-compose from a file of the host or from an address.
- A file written by hand states the image, its ports, variables and volumes, and what the installation asks; the rest is completed when it is read. A complete file, or the record of an installation, is installed as it is, and of a record only the template is used.
- Errors name the field they are in, also on a host without python3-jsonschema.
- oci/README.md describes the engine and the oci-compose block by block, with two examples in oci/examples/.
- The documentation page of the option covers it, in English and Spanish.

Log2RAM (reported by @f3rs3n)
- The sync removes the old active journal file from the disk copy, so a boot no longer restores it and journald deletes its oldest archives first. Log2RAM optimization 1.7; it takes effect from the next reboot.

Translations
- The bot keeps "oci-compose" as written.
- Spanish texts for the new option and for the Log2RAM notice.
This commit is contained in:
MacRimi
2026-10-12 22:29:08 +02:00
parent 9089f79342
commit cc12c625a6
15 changed files with 1560 additions and 45 deletions
+15
View File
@@ -401,3 +401,18 @@ pmx_rebuild_dkms_after_kernel() {
fi
return 0
}
# Log2RAM syncs only the archived journal files, so the active file it found
# on disk when it was installed stays there. Restored at every boot, it makes
# journald continue an old sequence and delete its newest archives first.
# The sync removes that file from the disk copy. Returns 0 when it changes
# the given Log2RAM script.
pmx_log2ram_drop_stale_journal() {
local log2ram_bin="$1"
[[ -f "$log2ram_bin" ]] || return 1
grep -q -- '--exclude=journal/\*/\*' "$log2ram_bin" 2>/dev/null || return 1
grep -q -- '--delete-excluded' "$log2ram_bin" 2>/dev/null && return 1
[[ -e "${log2ram_bin}.proxmenux.bak" ]] || cp -a "$log2ram_bin" "${log2ram_bin}.proxmenux.bak"
sed '/optional_params+=("--exclude=journal\/\*\/\*")/a\ optional_params+=("--delete-excluded")' "$log2ram_bin" \
| pmx_write_file "$log2ram_bin"
}
+7 -1
View File
@@ -887,6 +887,11 @@ _update_existing_log2ram_auto() {
sed 's/rsync -aAXv /rsync -aXv --no-acls /g' "$log2ram_bin" | pmx_write_file "$log2ram_bin"
fi
if pmx_log2ram_drop_stale_journal "$log2ram_bin"; then
NECESSARY_REBOOT=1
msg_ok "$(translate "Log2RAM keeps the journal in order from the next reboot")"
fi
if dpkg-query -W -f='${Status}' proxmox-backup-server 2>/dev/null \
| grep -q 'install ok installed'; then
tmp_file="$(mktemp /etc/logrotate.d/.proxmox-backup-api.XXXXXX)" || return 1
@@ -995,7 +1000,7 @@ EOF
install_log2ram_auto() {
local FUNC_VERSION="1.6"
local FUNC_VERSION="1.7"
local existing_log2ram_bin=""
pmx_journal_context "install_log2ram_auto" "$FUNC_VERSION"
@@ -1113,6 +1118,7 @@ install_log2ram_auto() {
cp -a "$_l2r_bin" "${_l2r_bin}.proxmenux.bak"
pmx_edit_file "$_l2r_bin" 's/rsync -aAXv /rsync -aXv --no-acls /g'
fi
pmx_log2ram_drop_stale_journal "$_l2r_bin" || true
break
done
@@ -3026,6 +3026,11 @@ _update_existing_log2ram_custom() {
sed 's/rsync -aAXv /rsync -aXv --no-acls /g' "$log2ram_bin" | pmx_write_file "$log2ram_bin"
fi
if pmx_log2ram_drop_stale_journal "$log2ram_bin"; then
NECESSARY_REBOOT=1
msg_ok "$(translate "Log2RAM keeps the journal in order from the next reboot")"
fi
if dpkg-query -W -f='${Status}' proxmox-backup-server 2>/dev/null \
| grep -q 'install ok installed'; then
tmp_file="$(mktemp /etc/logrotate.d/.proxmox-backup-api.XXXXXX)" || return 1
@@ -3119,7 +3124,7 @@ EOF
configure_log2ram() {
local FUNC_VERSION="1.6"
local FUNC_VERSION="1.7"
local existing_log2ram_bin=""
pmx_journal_context "configure_log2ram" "$FUNC_VERSION"
# description: Install Log2RAM with user-chosen RAM size; prompts for size and SSD/M.2 awareness before applying.
@@ -3242,6 +3247,7 @@ configure_log2ram() {
cp -a "$_l2r_bin" "${_l2r_bin}.proxmenux.bak"
pmx_edit_file "$_l2r_bin" 's/rsync -aAXv /rsync -aXv --no-acls /g'
fi
pmx_log2ram_drop_stale_journal "$_l2r_bin" || true
break
done