Felhasználói eszközök

Eszközök a webhelyen


systemd

Különbségek

A kiválasztott változat és az aktuális verzió közötti különbségek a következők.

Összehasonlító nézet linkje

Előző változat mindkét oldalonElőző változat
Következő változat
Előző változat
systemd [2018/04/24 07:05] daevidtsystemd [2022/02/23 13:17] (aktuális) daevidt
Sor 1: Sor 1:
-=== tmpfiles.d, /var/run persistency ===+==== Basic usage ==== 
 + 
 +<code bash> 
 + systemctl start apache2 
 + systemctl stop apache2 
 + systemctl enable apache2 
 + systemctl disable apache2 
 + systemctl status apache2 
 +</code> 
 + 
 +==== networkd ==== 
 + 
 +Config files: 
 + 
 +  /etc/systemd/network 
 + 
 +  DNS=... 
 +  DHCP=.. 
 +  Gateway=.. 
 +  Address=.. 
 +  Domains=.. 
 +  ... 
 + 
 +Check **man systemd.network** 
 + 
 +==== tmpfiles.d, /var/run persistency ====
  
 With the adoption of systemd, there is now a centralized mechanism for the creation of temporary files and directories. A service wishing to use this method can remove mkdir commands in its own startup script and instead place a .conf file in **/etc/tmpfiles.d**, **/run/tmpfiles.d**, or **/usr/lib/tmpfiles.d**, with Ubuntu services seeming to prefer the last option. With the adoption of systemd, there is now a centralized mechanism for the creation of temporary files and directories. A service wishing to use this method can remove mkdir commands in its own startup script and instead place a .conf file in **/etc/tmpfiles.d**, **/run/tmpfiles.d**, or **/usr/lib/tmpfiles.d**, with Ubuntu services seeming to prefer the last option.
Sor 12: Sor 37:
  
 Further information can be found using **man tmpfiles.d** Further information can be found using **man tmpfiles.d**
 +
 +==== Init scripts ====
 +
 +Init scripts are located here:
 +
 +  /etc/systemd/system/
 +  /lib/systemd/system/
 +  ...
 +
 +Example init scripts:
 +
 +<code bash>
 +[Unit]
 +Description=Calibre Server
 +After=network.target
 +
 +StartLimitIntervalSec=500
 +StartLimitBurst=5
 +
 +[Service]
 +Type=forking
 +PIDFile=/var/run/calibre-server.pid
 +Restart=on-failure
 +RestartSec=5s
 +ExecStart=/usr/bin/calibre-server \
 +        --daemonize \
 +        --port 32452 \
 +        --pidfile /run/calibre-server.pid \
 +    --enable-local-write \
 +    --log=/var/log/calibre.log \
 +        /home/calibre/db \
 +        /home/calibre/en \
 +        /home/calibre/romantikus \
 +        /home/calibre/paperbooks
 +
 +[Install]
 +WantedBy=multi-user.target
 +
 +</code>
 +
 +<code bash>
 +[Unit]
 +Description=Calibre Book Importer
 +After=network.target calibre.service
 +
 +[Service]
 +Type=oneshot
 +ExecStart=/home/calibre/import-books.sh
 +KillMode=mixed
 +
 +[Install]
 +WantedBy=multi-user.target
 +
 +</code>
 +=== Types ===
 +  * forking
 +  * oneshot
 +  * ...
 +
 +  # TODO!!!
 +
 +=== Reload init scripts config ===
 +
 +  systemctl daemon-reload
systemd.1524553509.txt.gz · Utolsó módosítás: 2018/10/03 13:31 (külső szerkesztés)