Fix logs collection on systems where SELinux is enforced

On LeapMicro there is SELinux which is preventing journalctl to write logs on /opt/dump directory. Two options here:

  • run those commands only for cloud-config based systems, basically debug will run only on Ubuntu and openSUSE
  • store logs on /var/log/ (we already have create_link_to_opt_dump /var/log "dir" "system" in place which makes them available without any other change)

Option 2 is a convenient fix because can be used even if SELinux is present or not and can run on all systems.

Added ||true and ||echo to avoid rke2-install.sh script being blocked by debug commands.

Tested on sylva-projects/sylva-core!9400

Related to sylva-projects/sylva-core#4758

Edited by Cristian Manda

Merge request reports

Loading
Loading