X

Servizi interrotti dopo aggiornamento Armbian su Orange Pi Plus 2E

Il presente articolo illustra la procedura di ripristino dei pacchetti di sistema in seguito ad un update che non permette più l’avvio di molti servizi tra cui l’SSH.

Introduzione

E’ risaputo che quando tutto funziona non ci si preoccupa di manutenere i sistemi, nonostante sia estremamente consigliato tenere aggiornati i software e gli apaprati. Per questa ragione pochi giorni fa ho deciso di aggiornare il mio piccolo grande server basato su Armbian (Ubuntu 16.04.5 LTS xenial) installato sulla fantastica Orange Pi Plus 2E.

Qui iniziano i problemi. Al login via ssh mi avvisa che ci sono degli aggiornamenti (l’immagine seguente è recente, ma si vedono comunque i 4 aggiornamenti incriminati).

Tutto entusiasta eseguo il comando:

apt-get upgrade

e come dovuto aggiorna tutto il sistema. Per altre necessità riavvio il sistema e mi accordo che il servizio SSH non mi risponde più. Tenta e ritenta ma nulla da fare.

Entrando in locale mi accorgo che il servizio SSH non sale più, e provando il comando

service sshd restart

ricevo il seguente errore:

Missing privilege separation directory: /var/run/sshd

In parole povere il servizio SSH non riesce a creare la cartella temporanea SSHD su /var/run/. Provando a crearla manualmente, il servizio si avvia tranquillamente, ma appena riavvio il sistema siamo punto e a capo. Smanettando mi sono accorto che non è un problema di Armbian, ma in generale di Debian e Ubuntu.

Procedura

Ho visto che molti hanno risolto creando uno script che crea all’avvio la directory mancante, ma non mi è sembrata una buona soluzione, in quanto i servizi che non riuscivano ad avviarsi erano circa una decina.

L’unico modo che ha risolto questo problema è stato effettuare il downgrade degli aggiornamenti incriminati, in particolare ho eseguito i seguenti comandi:

apt list |grep systemd | grep "\["

per visualizzare i pacchetti di sistema aggiornati e ho ricevuto questo output:

libpam-systemd/xenial-security,xenial-updates,now 229-4ubuntu21.15 armhf [installed]
libsystemd0/xenial-security,xenial-updates,now 229-4ubuntu21.15 armhf [installed]
systemd/xenial-security,xenial-updates,now 229-4ubuntu21.15 armhf [installed]
systemd-sysv/xenial-security,xenial-updates,now 229-4ubuntu21.15 armhf [installed]

Per visualizzare la versione precedente dei pacchetti da ripristinare ho usato il comando:

apt list -a systemd

che mi ha dato

Listing... Done
systemd/xenial-security,xenial-updates,now 229-4ubuntu21.15 armhf [installed]
systemd/xenial 229-4ubuntu4 armhf

L’ultimo rigo mi ha indicato che il sistema fosse alla versione 4 e non 21.15, quindi per ripristinare i pacchetti di sistema mi è bastato eseguire il comando

apt-get install libpam-systemd=229-4ubuntu4 libsystemd0=229-4ubuntu4 systemd=229-4ubuntu4 systemd-sysv=229-4ubuntu4

per ottenere il seguente output che mi ha effettuato il downgrade riportando il tutto alla normalità

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
bcrelay ipsec-tools
Use 'apt autoremove' to remove them.
Suggested packages:
systemd-ui systemd-container
The following packages will be DOWNGRADED:
libpam-systemd libsystemd0 systemd systemd-sysv
0 upgraded, 0 newly installed, 4 downgraded, 0 to remove and 0 not upgraded.
Need to get 3,491 kB of archives.
After this operation, 89.1 kB disk space will be freed.
Do you want to continue? [Y/n] Y
Get:1 http://ports.ubuntu.com xenial/main armhf systemd-sysv armhf 229-4ubuntu4 [16.4 kB]
Get:2 http://ports.ubuntu.com xenial/main armhf libpam-systemd armhf 229-4ubuntu4 [104 kB]
Get:3 http://ports.ubuntu.com xenial/main armhf libsystemd0 armhf 229-4ubuntu4 [192 kB]
Get:4 http://ports.ubuntu.com xenial/main armhf systemd armhf 229-4ubuntu4 [3,178 kB]
Fetched 3,491 kB in 1s (2,353 kB/s)
dpkg: warning: downgrading systemd-sysv from 229-4ubuntu21.15 to 229-4ubuntu4
(Reading database ... 79668 files and directories currently installed.)
Preparing to unpack .../systemd-sysv_229-4ubuntu4_armhf.deb ...
Unpacking systemd-sysv (229-4ubuntu4) over (229-4ubuntu21.15) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up systemd-sysv (229-4ubuntu4) ...
dpkg: warning: downgrading libpam-systemd:armhf from 229-4ubuntu21.15 to 229-4ubuntu4
(Reading database ... 79668 files and directories currently installed.)
Preparing to unpack .../libpam-systemd_229-4ubuntu4_armhf.deb ...
Unpacking libpam-systemd:armhf (229-4ubuntu4) over (229-4ubuntu21.15) ...
dpkg: warning: downgrading libsystemd0:armhf from 229-4ubuntu21.15 to 229-4ubuntu4
Preparing to unpack .../libsystemd0_229-4ubuntu4_armhf.deb ...
Unpacking libsystemd0:armhf (229-4ubuntu4) over (229-4ubuntu21.15) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
Setting up libsystemd0:armhf (229-4ubuntu4) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...
dpkg: warning: downgrading systemd from 229-4ubuntu21.15 to 229-4ubuntu4
(Reading database ... 79668 files and directories currently installed.)
Preparing to unpack .../systemd_229-4ubuntu4_armhf.deb ...
Unpacking systemd (229-4ubuntu4) over (229-4ubuntu21.15) ...
Processing triggers for dbus (1.10.6-1ubuntu3.3) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up systemd (229-4ubuntu4) ...
Installing new version of config file /etc/systemd/system.conf ...
addgroup: The group `systemd-journal' already exists as a system group. Exiting.
Setting up libpam-systemd:armhf (229-4ubuntu4) ...

Conclusioni

Gli aggiornamenti sono sempre importanti, ma magari prima di farli, è sempre bene informarsi sulle vulnerabilità che vanno a correggere e i problemi noti circa le nuove versioni.

Per stavolta mi è andata bene e con questo articolo spero di aiutare qualcuno che può incappare nel mio stesso problema.

 

Categories: news
admin:
Related Post