From Fedora Project Wiki

< Features‎ | systemd

Revision as of 11:19, 25 January 2011 by Lewis41 (talk | contribs)

Clear.png
The content appearing below may require cleanup
Please improve this article if you can, and move or remove this notice if appropriate.

systemd Gestore di sistema e di sessione

Sommario

systemd è un rimpiazzo per SysVinit e Upstart ed agisce come un gestore di sistema e di sessione.

Manutentore

Stato corrente

  • Targeted release: Fedora 15
  • Ultimo aggiornamento: 2010-10-19
  • Percentuale di completamento: 100%
  • Systemd attualmente è in Rawhide, e per impostazione predefinita
  • Patch a vari pacchetti sono state applicate in upstream già nella F14 (dbus, udev, avahi, rtkit). Supporto all'attivazione dei socket che sarebbe interessante avere, è tuttora mancante per rsyslog (stato merged), rcpbind (stato trasmesso in upstream, merge parziale), e cups(non ancora trasmesso in upstream).

Descrizione dettagliata

  • Cos'è systemd? Per citare dalla homepage: "systemd è un gestore di sistema e di sessione per Linux, compatibile con gli scrpit di initi di SysV e di LSB. systemd offre grintose capacità di parallelizazione, usa l'attivazione di socket e D-Bus per l'avvio dei servizi, offre avvio su richiesta di daemoni, tiene traccia dei processi tramite Linux cgroups, supporta snapshotting e ripristino dello stato di sistema, gestisce i punti di mount e di automount ed implementa una elaborata logica di controllo sulla transazione dei servizi e loro dipendenze".
  • Il programma prevede di testare appieno il sistema e di renderlo predefinito in Fedora 15, in sostituzione del sistema attuale, upstart. Maggiori demoni si riuscirà ad aggiornare ai nuovi file di servizio tanto meglio. Per il software rimanente si continuerà ad includere gli script init di SysV essendo systemd compatibile con essi.
  • In alternativa agli script bash, systemd usa file .service.
  • systemd ordina tutti i demoni nei propri cgroups di Linux, esplorabili all'interno della directory /cgroup/systemd del file system.
  • l'obiettivo di systemd è di rendere il miglior Linux e di rendere fruibile le sue caratteristiche nel migiore possibile. systemd non è progettato per essere portabile. Ciò apre nuove possibilità.

Vantaggi per Fedora

Fedora <=14 usa Upstart in modalità compatibile con SysV. systemd è un progetto complessivamente migliore come descritto in http://0pointer.de/blog/projects/systemd.html. Si spera di raccogliere i suoi benefici aprendo l'integrazione nella distribuzione e includendola per impostazione.

Notare che nel lungo termine, systemd permetterà un boot (avvio) più rapido, ma ciò richiederà del lavoro, in quanto occorre effettuare ulteriori modifiche al processo di boot, come la separazione di rc.sysinit. Ad ogni modo l'obiettivo di systemd è innanzitutto far funzionare bene le cose, e non soltanto più velocemente.

Piano di Test

  1. Avviare il sistema, verificando l'avvio di tutti i servizi.
  2. Spegnere il sistema, verificando che tutto si interrompa regolarmente.
  3. Controllare i vari strumenti di amministrazione come systemctl, systemd-cgls, systemadm, ps e così via.
  4. Verificare che i servizi siano propriamente disposti in control group distinti (systemd-cgls è il tuo compagno fedele)
  5. Verificare con il comando systemctl list-units che tutte le unità siano in uno stato ragionevole dopo il boot-up (ossia, non ci siano colori rossi nell'output!)
  6. Sperimentare le opzioni kernel systemd.unit=emergency.target, systemd.unit=rescue.target, systemd.unit=multi-user.target e similari, e spostarsi tra i vari target via systemctl isolate.
  7. Provare le seguenti opzioni kernel:
    1. systemd.unit=emergency.target (opzione che da un risultato simile al passaggio di init=/bin/sh, con la differenza di poter avviare il sistema completo a partire da questo stato)
    2. systemd.unit=rescue.target (opzione simile al precedente, ma più equivalente al boot in modalità single user su SysV)
    3. systemd.unit=multi-user.target (per l'avvio senza supporto grafico)
    4. systemd.unit=graphical.target (per il normale avvio con supporto grafico, pedefinito)


Esperienza Utente

L'utente dovrebbe notare un boot-up più rapido, particolarmente su unità SSD.

Le funzionalità di amministrazione del sistema di init sono notevolmente estese (per maggiori dettagli vedere il link citato blog post, in particolare la parte A short list of other features.

I file di configurazione dei servizi sono più semplici da capire e configurare rispetto agli script di SysV.

Dependencies

  • Successful Fedora Package review and addition to rawhide: DONE
  • systemd upstream currently lacks three features that we need before Fedora 15:
    • proper support for selinux (needs policy changes, and we want to move the policy setup in systemd, not in the initrd). DONE: Latest selinux policy update include changes for systemd.
    • We need sysv compatible implementations for /bin/reboot, /bin/shutdown and friends. We currently simply use the implementations upstart provides which work fine, but of course are suboptimal as soon as we want to replace upstart completely. DONE
    • complete set of man pages (parts are already documented, this is far from complete however). DONE
  • The readahead packages need to be adapted for systemd. readahead is currently one of the very few packages using upstart specific features and hence is not activated when booting with systemd. However, due to the more aggressive parallelization, disk access is much more random when systemd is used and hence the effect of readahead considerable. Or to put it the other way round: unless we have readahead systemd won't perform any better than upstart/sysv during bootup on rotating media. On SSD systemd is considerably faster though in every case as readahead is not necessary there. DONE: systemd now includes its own minimal readahead implementation
  • A number of daemons should provide native systemd .service files in addition to sysv init scripts. I have service files for almost all standard F14 services ready, which just need to be added to the rpms. (MOSTLY DONE)
  • A number of daemons should be patched for socket activation: rsyslog (UPSTREAM MERGED), dbus (DONE), portmap (PENDING), avahi (DONE), cups. These patches exist (and are public) and should have upstreamable quality, but they need to be reviewed and added to the rpms.
  • A number of daemons should ship changed bus activation files to hook them up to systemd for activation (single-line change per package)

Contingency Plan

  • Revert back to ship the current Upstart package, and offer systemd just as an alternative.

Documentazione

Release Notes

Fedora 15 has replaced Upstart with systemd. systemd uses services files located in /lib/systemd/system for services, and /etc/systemd/system for configuration. A dozen desktop daemons [list them] have been initially converted to use systemd service files and small number of programs have been patched to take advantage of it. systemd is compatible with legacy SysV init scripts and rest of the migration will happen incrementally over time.