diff --git a/docs/config/microshift-starter.ks b/docs/config/microshift-starter.ks index 3697a1e453..4de738d54d 100644 --- a/docs/config/microshift-starter.ks +++ b/docs/config/microshift-starter.ks @@ -53,9 +53,12 @@ if ! subscription-manager status >& /dev/null ; then fi # Configure systemd journal service to persist logs between boots and limit their size to 1G -mkdir -p /var/log/journal/ -sed -i 's/.*Storage=.*/Storage=auto/g' /etc/systemd/journald.conf -sed -i 's/.*SystemMaxUse=.*/SystemMaxUse=1G/g' /etc/systemd/journald.conf -sed -i 's/.*RuntimeMaxUse=.*/RuntimeMaxUse=1G/g' /etc/systemd/journald.conf +sudo mkdir -p /etc/systemd/journald.conf.d +cat </dev/null +[Journal] +Storage=persistent +SystemMaxUse=1G +RuntimeMaxUse=1G +EOF %end diff --git a/docs/greenboot.md b/docs/greenboot.md index 80c4a876fd..c0285c40d9 100644 --- a/docs/greenboot.md +++ b/docs/greenboot.md @@ -4,7 +4,7 @@ Serviceability of Edge Devices is often limited or non-existent, which makes it challenging to troubleshoot device problems following a failed software or -operating system upgrade. +operating system upgrade. To mitigate these problems, MicroShift uses [greenboot](https://github.com/fedora-iot/greenboot), the Generic Health Check Framework for `systemd` on `rpm-ostree` based systems. @@ -105,8 +105,11 @@ and setting limits on the maximal journal data size. Run the following commands to configure the journal data persistency and limits. ```bash -sudo mkdir -p /var/log/journal/ -sudo sed -i 's/.*Storage=.*/Storage=auto/g' /etc/systemd/journald.conf -sudo sed -i 's/.*SystemMaxUse=.*/SystemMaxUse=1G/g' /etc/systemd/journald.conf -sudo sed -i 's/.*RuntimeMaxUse=.*/RuntimeMaxUse=1G/g' /etc/systemd/journald.conf +sudo mkdir -p /etc/systemd/journald.conf.d +cat </dev/null +[Journal] +Storage=persistent +SystemMaxUse=1G +RuntimeMaxUse=1G +EOF ``` diff --git a/scripts/image-builder/config/kickstart.ks.template b/scripts/image-builder/config/kickstart.ks.template index 5b1ebccb14..36339ff104 100644 --- a/scripts/image-builder/config/kickstart.ks.template +++ b/scripts/image-builder/config/kickstart.ks.template @@ -13,10 +13,10 @@ network --bootproto=dhcp --device=link --activate --onboot=on # For example, a 20GB disk would be partitioned in the following way: # # NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT -# sda 8:0 0 20G 0 disk +# sda 8:0 0 20G 0 disk # ├─sda1 8:1 0 200M 0 part /boot/efi # ├─sda1 8:1 0 800M 0 part /boot -# └─sda2 8:2 0 19G 0 part +# └─sda2 8:2 0 19G 0 part # └─rhel-root 253:0 0 10G 0 lvm /sysroot # zerombr @@ -66,10 +66,13 @@ firewall-offline-cmd --zone=trusted --add-source=169.254.169.1 echo -e 'export KUBECONFIG=/var/lib/microshift/resources/kubeadmin/kubeconfig' >> /root/.profile # Configure systemd journal service to persist logs between boots and limit their size to 1G -mkdir -p /var/log/journal/ -sed -i 's/.*Storage=.*/Storage=auto/g' /etc/systemd/journald.conf -sed -i 's/.*SystemMaxUse=.*/SystemMaxUse=1G/g' /etc/systemd/journald.conf -sed -i 's/.*RuntimeMaxUse=.*/RuntimeMaxUse=1G/g' /etc/systemd/journald.conf +sudo mkdir -p /etc/systemd/journald.conf.d +cat </dev/null +[Journal] +Storage=persistent +SystemMaxUse=1G +RuntimeMaxUse=1G +EOF # Make sure all the Ethernet network interfaces are connected automatically for uuid in $(nmcli -f uuid,type,autoconnect connection | awk '$2 == "ethernet" && $3 == "no" {print $1}') ; do