User Tools

Site Tools


doc:appunti:linux:sa:systemd

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:linux:sa:systemd [2018/05/23 12:02] – [Riferimenti web] niccolodoc:appunti:linux:sa:systemd [2023/12/13 12:37] (current) – [Alternatriva allo script rc.local] niccolo
Line 149: Line 149:
  
 <file> <file>
-x-systemd.device-timeout=300s+/dev/sda3  /home  ext4  defaults,x-systemd.device-timeout=300s   2
 </file> </file>
  
 +===== Verifica Servizi =====
 +
 +Alcuni comandi utili per **verificare il funzionamento** dei servizi gestiti da **systemd**.
 +
 +Mostra lo stato di tutti i **servizi** e di tutte le **unit**:
 +
 +<code>
 +systemctl --all --full status
 +</code>
 +
 +Mostra le **unit** //required// e //wanted// dalla unit specificata:
 +
 +<code>
 +systemctl --all list-dependencies ntp.service
 +</code>
 +
 +===== Alternativa allo script rc.local =====
 +
 +Come eseguire uno script all'avvio di un sisetma Systemd.
 +
 +Creare una unit Systemd **/etc/systemd/system/my-startup.service**:
 +
 +<file>
 +# /etc/systemd/system/my-startup.service
 +#
 +# Service executed once the system has reached the multi-user status.
 +#
 +#  Type=oneshot         The unit is up after the main process exits.
 +#  RemainAfterExit=yes  The service shall be considered active even
 +#                       when all its processes exited.
 +#
 +# Eanble the service with:
 +#   systemctl enable my-startup.service
 +
 +[Service]
 +Type=oneshot
 +RemainAfterExit=yes
 +ExecStart=/usr/local/sbin/my-startup-script
 +
 +[Install]
 +WantedBy=multi-user.target
 +</file>
 +
 +Abilitare la unit e predisporre lo script **/usr/local/sbin/my-startup-script**.
  
 ===== Riferimenti web ===== ===== Riferimenti web =====
doc/appunti/linux/sa/systemd.1527069758.txt.gz · Last modified: 2018/05/23 12:02 by niccolo