En primer lugar, systemdno es un unix tradicional init. Systemd es mucho más, por lo que es un poco injusto comparar los dos.
Para responder la pregunta, lo que parece ser necesario son algunos binarios y los siguientes archivos de configuración:
/usr/lib/systemd/system/default.target
/usr/lib/systemd/system/basic.target
/usr/lib/systemd/system/sysinit.target
/usr/lib/systemd/system/getty.target
/usr/lib/systemd/system/getty@.service
/usr/lib/systemd/system/console-getty.service
la emisión systemctl enable console-getty.service getty@tty2.servicecrea estos enlaces simbólicos:
/etc/systemd/system/default.target.wants/getty@tty2.service -> / lib / systemd / system / getty @ service
/etc/systemd/system/getty.target.wants/console-getty.service -> /lib/systemd/system/console-getty.service
NOTA : Para utilizar systemdlas funciones especiales de inicio agettydinámico, bajo demanda al presionar Alt+ F3y así sucesivamente, parece que también debe tener al menos estos dos archivos:
/etc/systemd/logind.conf
/lib/systemd/system/autovt@.service
donde autovt@.servicees un enlace simbólico a getty@.service.
Contenido de los archivos de configuración:
El default.target, getty.target, sysinit.targetarchivos puede estar vacía a excepción de la [Unit]etiqueta y (probablemente) Description=xxx.
basic.target también contiene información de dependencia:
[Unidad]
Descripción = Sistema básico
Requiere = sysinit.target
Desea = sockets.target timers.target paths.target slices.target
Después = sysinit.target sockets.target timers.target paths.target slices.target
No estoy seguro de si las referencias a destinos que no existen como archivos son necesarias o no. Se describen en la systemd.special(7)página del manual.
console-getty.service: (Caso especial para agetty en la consola)
[Unidad]
Descripción = Consola Getty
Después = systemd-user-sessions.service plymouth-quit-wait.service
Antes = getty.target
[Servicio]
ExecStart = - / sbin / agetty --noclear --keep-baud console 115200,38400,9600 $ TERM
Tipo = inactivo
Reiniciar = siempre
RestartSec = 0
UtmpIdentifier = cons
TTYPath = / dev / console
TTYReset = yes
TTYVHangup = yes
KillMode = proceso
IgnoreSIGPIPE = no
SendSIGHUP = yes
[Instalar en pc]
WantedBy = getty.target
getty@.service: (configuración genérica para todos los servicios getty excepto la consola)
[Unidad]
Descripción = Getty en% I
Después = systemd-user-sessions.service plymouth-quit-wait.service
Antes = getty.target
IgnoreOnIsolate = yes
ConditionPathExists = / dev / tty0
[Servicio]
ExecStart = - / sbin / agetty --noclear% I $ TERM
Tipo = inactivo
Reiniciar = siempre
RestartSec = 0
UtmpIdentifier =% I
TTYPath = / dev /% I
TTYReset = yes
TTYVHangup = yes
TTYVTDisallocate = no
KillMode = proceso
IgnoreSIGPIPE = no
SendSIGHUP = yes
[Instalar en pc]
WantedBy = getty.target
DefaultInstance = tty1
Finalmente, probablemente necesite algunos de estos binarios especiales (no he probado cuáles son cruciales):
/ lib / systemd / systemd (/ sbin / init generalmente apunta a esto)
/ lib / systemd / systemd-logind
/ lib / systemd / systemd-cgroups-agent
/ lib / systemd / systemd-user-sessions
/ lib / systemd / systemd-vconsole-setup
/ lib / systemd / systemd-update-utmp
/ lib / systemd / systemd-sleep
/ lib / systemd / systemd-sysctl
/ lib / systemd / systemd-initctl
/ lib / systemd / systemd-reply-password
/ lib / systemd / systemd-ac-power
/ lib / systemd / systemd-enable
/ lib / systemd / systemd-backlight
/ lib / systemd / systemd-binfmt
/ lib / systemd / systemd-bootchart
/ lib / systemd / systemd-bus-proxyd
/ lib / systemd / systemd-coredump
/ lib / systemd / systemd-cryptsetup
/ lib / systemd / systemd-fsck
/ lib / systemd / systemd-hostnamed
/ lib / systemd / systemd-journald
/ lib / systemd / systemd-journal-gatewayd
/ lib / systemd / systemd-journal-remote
/ lib / systemd / systemd-localed
/ lib / systemd / systemd-machined
/ lib / systemd / systemd-modules-load
/ lib / systemd / systemd-multi-seat-x
/ lib / systemd / systemd-networkd
/ lib / systemd / systemd-networkd-wait-online
/ lib / systemd / systemd-quotacheck
/ lib / systemd / systemd-random-seed
/ lib / systemd / systemd-readahead
/ lib / systemd / systemd-remount-fs
/ lib / systemd / systemd-resolve
/ lib / systemd / systemd-rfkill
/ lib / systemd / systemd-shutdown
/ lib / systemd / systemd-shutdownd
/ lib / systemd / systemd-socket-proxyd
/ lib / systemd / systemd-timedated
/ lib / systemd / systemd-timesyncd
/ lib / systemd / systemd-udevd
/ lib / systemd / systemd-update-done
Para resumir el proceso de inicio de systemd, creo que funciona más o menos así:
- systemd localiza
basic.target(¿o todos los *.targetarchivos?)
- se resuelvan las dependencias basan en
WantedBy=, Wants=, Before=, After=... directivas en el [Install]sector de las *.servicey *.targetlos archivos de configuración.
*.services que deberían comenzar (que no son servicios "especiales"), tienen una [Service]sección con una ExecStart=directiva, que señala el ejecutable para comenzar.