Oracle Linux / Redhat : systemd change /dev/null permissions

Pour fixer le problème des changements de permission sur /dev/null par systemd j’ai fait la commande suivante :

# grep -riL "ExecStartPost" /usr/lib/systemd/system/*service | xargs grep "TTYPath=/dev/tty" | sed 's/:/ /g' | awk '{print $1}' | xargs sed -i '/^ExecStart.*/i ExecStartPost = -/usr/bin/xset -display :0 -dpms s off'

# systemctl daemon-reload

Pour tous les types TTY j’ai ajouté :

ExecStartPost = -/usr/bin/xset -display :0 -dpms s off

J’ai l’impression que le problème est fixé.

Asterisk : Fichier asterisk.service pour Oracle Linux 8.6

Voici le fichier que j’utilise dans /usr/lib/systemd/system/asterisk.service :

[Unit]
Description=Asterisk PBX and telephony daemon.
After=network.target

[Service]
ExecReload=/usr/sbin/asterisk -rx "core reload"
ExecStart=/usr/sbin/asterisk -mqf -C  /etc/asterisk/asterisk.conf
ExecStop=/usr/sbin/asterisk -rx "core stop now"
PIDFile=/var/run/asterisk/asterisk.pid
Restart=on-failure
RestartSec=10
Type=simple
TimeoutStartSec=300

Environment=HOME=/var/lib/asterisk
LimitCORE=infinity
LimitNOFILE=65536
WorkingDirectory=/var/lib/asterisk
User=asterisk
Group=asterisk
PrivateTmp=false
NoNewPrivileges=yes
ProtectHome=no

[Install]
WantedBy=multi-user.target

J’ai pas fini avec le fichier /etc/asterisk/modules.conf , j’ai quelques problèmes dans le build :

;
; Asterisk configuration file
;
; Module Loader configuration file
;

[modules]
autoload=yes
;
; Any modules that need to be loaded before the Asterisk core has been
; initialized (just after the logger initialization) can be loaded
; using 'preload'.  'preload' forces a module and the modules it
; is known to depend upon to be loaded earlier than they normally get
; loaded.
;
; NOTE: There is no good reason left to use 'preload' anymore.  It was
; historically required to preload realtime driver modules so you could
; map Asterisk core configuration files to Realtime storage.
; This is no longer needed.
;
;preload = your_special_module.so
;
; If you want Asterisk to fail if a module does not load, then use
; the "require" keyword. Asterisk will exit with a status code of 2
; if a required module does not load.
;
;require = chan_pjsip.so
;
; If you want you can combine with preload
; preload-require = your_special_module.so
;
;load = res_musiconhold.so
;
; Load one of: alsa, or console (portaudio).
; By default, load chan_console only (automatically).
;
noload = chan_alsa.so
;noload = chan_console.so
;
; Do not load res_hep and kin unless you are using HEP monitoring
; http://sipcapture.org in your network.
;
noload = res_hep.so
noload = res_hep_pjsip.so
noload = res_hep_rtcp.so
;
; Do not load chan_sip by default, it may conflict with res_pjsip.
noload = chan_sip.so
;
; Load one of the voicemail modules as they are mutually exclusive.
; By default, load app_voicemail only (automatically).
;
;noload = app_voicemail.so
noload = app_voicemail_imap.so
noload = app_voicemail_odbc.so

; FARIAS
noload = res_config_ldap.so
noload = app_jack.so
noload = res_config_pgsql.so
noload = res_phoneprov.so
noload = res_smdi.so
noload = res_pjsip_phoneprov_provider.so
noload = cdr_csv.so
noload = cdr_sqlite3_custom.so
noload = cdr_manager.so
noload = cdr_pgsql.so
noload = cdr_tds.so
noload = cdr_odbc.so
noload = cel_sqlite3_custom.so
noload = cel_tds.so
noload = app_alarmreceiver.so
noload = cel_pgsql.so
noload = res_pjsip_transport_websocket.so
noload = res_config_sqlite3.so
noload = res_config_pgsql.so
noload = chan_oss.so
noload = chan_alsa.so
noload = app_minivm.so

Oracle Linux 8.3 : Module yaml error: Unexpected key in data: static_context [line 9 col 3]

J’ai pu voir l’erreur suivante :

Module yaml error: Unexpected key in data: static_context [line 9 col 3]

Pour fixer le problème :

# yum update libmodulemd
rabbitmq_erlang                                                                                        315  B/s | 833  B     00:02    
rabbitmq_erlang-source                                                                                 489  B/s | 819  B     00:01    
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Dépendances résolues.
=======================================================================================================================================
 Paquet                         Architecture              Version                           Dépôt                                Taille
=======================================================================================================================================
Mise à jour:
 libmodulemd                    x86_64                    2.13.0-1.el8                      ol8_baseos_latest                    233 k

Résumé de la transaction
=======================================================================================================================================
Mettre à niveau  1 Paquet

Taille totale des téléchargements : 233 k
Voulez-vous continuer ? [o/N] : o
Téléchargement des paquets :
libmodulemd-2.13.0-1.el8.x86_64.rpm                                                                    3.4 MB/s | 233 kB     00:00    
---------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                  3.2 MB/s | 233 kB     00:00     
Test de la transaction
La vérification de la transaction a réussi.
Lancement de la transaction de test
Transaction de test réussie.
Exécution de la transaction
  Préparation           :                                                                                                          1/1 
  Mise à jour           : libmodulemd-2.13.0-1.el8.x86_64                                                                          1/2 
  Nettoyage de          : libmodulemd-2.9.4-2.el8.x86_64                                                                           2/2 
  Exécution du scriptlet: libmodulemd-2.9.4-2.el8.x86_64                                                                           2/2 
  Vérification de       : libmodulemd-2.13.0-1.el8.x86_64                                                                          1/2 
  Vérification de       : libmodulemd-2.9.4-2.el8.x86_64                                                                           2/2 

Mis à niveau:
  libmodulemd-2.13.0-1.el8.x86_64                                                                                                      

Terminé !

Ma version de Oracle Linux 8.3 :

# cat /etc/os-release 
NAME="Oracle Linux Server"
VERSION="8.3"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.3"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.3"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:8:3:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"

ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8"
ORACLE_BUGZILLA_PRODUCT_VERSION=8.3
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=8.3

Migration de Oracle Linux 7.x vers Oracle Linux 8.x avec leapp : Echec complet

J’ai essayé une migration avec Leapp mais sans succès, pourtant je pense bien avoir suivi la procédure.

Etape 1 : Mise en place de la dernier version de la Oracle Linux 7.x :

 

# sudo yum upgrade
... reboot ...
# cat /etc/system-release
Oracle Linux Server release 7.9
# yum repolist
Modules complémentaires chargés : ulninfo
id du dépôt                                                             nom du dépôt                                                                                                                           statut
ol7_UEKR5/x86_64                                                        Latest Unbreakable Enterprise Kernel Release 5 for Oracle Linux 7Server (x86_64)                                                          702
ol7_latest/x86_64                                                       Oracle Linux 7Server Latest (x86_64)                                                                                                   24 259
repolist: 24 961

Etape 2 : Suppression des anciens Kernel :

# rpm -q kernel
kernel-3.10.0-1160.49.1.el7.x86_64
kernel-3.10.0-1160.53.1.el7.x86_64
kernel-3.10.0-1160.62.1.el7.x86_64
# package-cleanup --oldkernels --count=1 
# uname -sr
Linux 4.14.35-2047.513.2.el7uek.x86_64
# rpm -q kernel
kernel-3.10.0-1160.62.1.el7.x86_64

Etape 3 : Ajout du repo :

# curl https://copr.fedorainfracloud.org/coprs/g/leapp/leapp-devel/repo/epel-7/group_leapp-leapp-devel-epel-7.repo -o /etc/yum.repos.d/group_leapp-leapp-devel-epel-7.repo
# sudo yum install -y leapp

Etape 4 : Pre-upgrade :

# leapp preupgrade --oraclelinux

A noter que dans mon yum.repos.d j’ai :

yum.repos.d]# ls -ltr
total 40
-rw-r--r--. 1 root root 13093  2 nov.   2018 public-yum-ol7.repo.sav
-rw-r--r--  1 root root   226  9 juin   2021 virt-ol7.repo
-rw-r--r--  1 root root  4586 20 déc.  15:17 oracle-linux-ol7.repo
-rw-r--r--  1 root root  2587 20 déc.  15:18 uek-ol7.repo
-rw-r--r--  1 root root  2575 10 févr. 17:09 leapp-upgrade-repos-ol8.repo
-rw-r--r--  1 root root   381 12 mai   15:52 group_leapp-leapp-devel-epel-7.repo

# cat leapp-upgrade-repos-ol8.repo | grep "^\["
[ol8_baseos_latest]
[ol8_appstream]
[ol8_codeready_builder]
[ol8_addons]
[ol8_UEKR6]
[ol8_ksplice]
[ol8_oci_included]
[ol8_MySQL80]
[ol8_UEKR6_RDMA]
[ol8_oraclelinuxmanager210_client]
[ol8_kvm_appstream]

Etape 5 : Réponse aux questions :

# cat /var/log/leapp/answerfile
[remove_pam_pkcs11_module_check]
# Title:              None
# Reason:             Confirmation
# =================== remove_pam_pkcs11_module_check.confirm ==================
# Label:              Disable pam_pkcs11 module in PAM configuration? If no, the upgrade process will be interrupted.
# Description:        PAM module pam_pkcs11 is no longer available in OL-8 since it was replaced by SSSD.
# Type:               bool
# Default:            None
# Available choices: True/False
# Unanswered question. Uncomment the following line with your answer
# confirm =

# leapp answer --section remove_pam_pkcs11_module_check.confirm=True

Etape 6 : Finalisation :

– Test 1 :

leapp upgrade --oraclelinux

– Test 2 :

leapp upgrade --oraclelinux  --enablerepo ol8_codeready_builder

– Test 3 :

leapp upgrade --oraclelinux --enablerepo ol8_baseos_latest

Je me retrouve toujours avec l’erreur suivante :

============================================================
                           ERRORS                           
============================================================
 
2022-05-12 16:33:30.411911 [ERROR] Actor: target_userspace_creator
Message: Unable to install OL 8 userspace packages.
Summary:
    Details: Command ['systemd-nspawn', '--register=no', '--quiet', '-D', '/var/lib/leapp/scratch/mounts/root_/system_overlay', '--bind=/etc/hosts:/etc/hosts', '--setenv=LEAPP_EXPERIMENTAL=0', '--setenv=LEAPP_COMMON_TOOLS=:/etc/leapp/repos.d/system_upgrade/el7toel8/tools', '--setenv=LEAPP_COMMON_FILES=:/etc/leapp/repos.d/system_upgrade/el7toel8/files', '--setenv=LEAPP_ENABLE_REPOS=ol8_baseos_latest,ol8_appstream,ol8_UEKR6,ol8_codeready_builder', '--setenv=LEAPP_UNSUPPORTED=0', '--setenv=LEAPP_EXECUTION_ID=12546ba8-da78-496b-8489-f39686b2a838', '--setenv=LEAPP_HOSTNAME=PeDevOracle7.6', 'dnf', 'install', '-y', '--nogpgcheck', '--setopt=module_platform_id=platform:el8', '--setopt=keepcache=1', '--releasever', u'8.4', '--installroot', '/el8target', '--disablerepo', '*', '--enablerepo', u'ol8_baseos_latest', '--enablerepo', u'ol8_codeready_builder', '--enablerepo', u'ol8_UEKR6', '--enablerepo', u'ol8_appstream', 'dnf', '--disableplugin', 'subscription-manager'] failed with exit code 1.
    Stderr: Failed to create directory /var/lib/leapp/scratch/mounts/root_/system_overlay//sys/fs/selinux: Read-only file system
            Failed to create directory /var/lib/leapp/scratch/mounts/root_/system_overlay//sys/fs/selinux: Read-only file system
            Host and machine ids are equal (b947571a5b6f4b4485914d6b5da8c598): refusing to link journals
            Failed to synchronize cache for repo 'ol8_UEKR6', ignoring this repo.
            Failed to synchronize cache for repo 'ol8_appstream', ignoring this repo.
            Failed to synchronize cache for repo 'ol8_codeready_builder', ignoring this repo.
            Failed to synchronize cache for repo 'ol8_baseos_latest', ignoring this repo.
            Error: Unable to find a match: dnf
 
============================================================
                       END OF ERRORS                        
============================================================

Misère.