Systemctl kurz und knapp: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
| Zeile 5: | Zeile 5: | ||
=Logging eines Dienstes fortlaufend= | =Logging eines Dienstes fortlaufend= | ||
*journalctl -f -u ssh | *journalctl -f -u ssh | ||
| − | |||
=Starten eines Service= | =Starten eines Service= | ||
*systemctl start dienst | *systemctl start dienst | ||
| − | = | + | =Stoppen eines Service= |
*systemctl stop dienst | *systemctl stop dienst | ||
=Restarten eines Service= | =Restarten eines Service= | ||
| Zeile 17: | Zeile 16: | ||
*systemctl disable dienst | *systemctl disable dienst | ||
=Status eines Service= | =Status eines Service= | ||
| − | *systemctl status dienst | + | *systemctl status dienst= |
| + | =Eigne Service Unit erstelle | ||
| + | ;Service Datei | ||
| + | *vi /etc/systemd/system/simple-http.service | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
<pre> | <pre> | ||
[Unit] | [Unit] | ||
| − | Description= | + | Description=My Miscellaneous Service |
| − | After=network | + | After=network.target |
[Service] | [Service] | ||
| − | + | Type=simple | |
| − | + | User=xinux | |
| − | + | WorkingDirectory=/home/xinux/share | |
| − | + | ExecStart=/bin/python3 -m http.server | |
| + | Restart=on-abort | ||
[Install] | [Install] | ||
| Zeile 39: | Zeile 37: | ||
</pre> | </pre> | ||
| − | + | ;Aktivieren | |
*systemctl daemon-reload | *systemctl daemon-reload | ||
| − | *systemctl enable | + | *systemctl enable simple-http.service |
| − | *systemctl start | + | *systemctl start simple-http.service |
| − | + | ;Logs lesen | |
| + | ;journalctl -fu simple-http | ||
| + | |||
| + | =Set Target= | ||
*systemctl -f enable multi-user.target | *systemctl -f enable multi-user.target | ||
*systemctl -f enable graphical.target | *systemctl -f enable graphical.target | ||
| − | + | =Get Default Target= | |
*systemctl get-default | *systemctl get-default | ||
graphical.target | graphical.target | ||
| − | + | =Changing Target= | |
*systemctl isolate multi-user.target | *systemctl isolate multi-user.target | ||
| − | + | =Set Default Target= | |
*systemctl set-default multi-user.target | *systemctl set-default multi-user.target | ||
| − | + | =Show Targets= | |
*systemctl list-units --type target | *systemctl list-units --type target | ||
<pre> | <pre> | ||
Version vom 12. November 2025, 16:05 Uhr
Listing aller Services
- systemctl --type=service
Logging eines Dienstes
- journalctl -u ssh
Logging eines Dienstes fortlaufend
- journalctl -f -u ssh
Starten eines Service
- systemctl start dienst
Stoppen eines Service
- systemctl stop dienst
Restarten eines Service
- systemctl restart dienst
Aktivieren eines Service
- systemctl enable dienst
Deaktivieren eines Service
- systemctl disable dienst
Status eines Service
- systemctl status dienst=
=Eigne Service Unit erstelle
- Service Datei
- vi /etc/systemd/system/simple-http.service
[Unit] Description=My Miscellaneous Service After=network.target [Service] Type=simple User=xinux WorkingDirectory=/home/xinux/share ExecStart=/bin/python3 -m http.server Restart=on-abort [Install] WantedBy=multi-user.target
- Aktivieren
- systemctl daemon-reload
- systemctl enable simple-http.service
- systemctl start simple-http.service
- Logs lesen
- journalctl -fu simple-http
Set Target
- systemctl -f enable multi-user.target
- systemctl -f enable graphical.target
Get Default Target
- systemctl get-default
graphical.target
Changing Target
- systemctl isolate multi-user.target
Set Default Target
- systemctl set-default multi-user.target
Show Targets
- systemctl list-units --type target
UNIT LOAD ACTIVE SUB DESCRIPTION basic.target loaded active active Basic System bluetooth.target loaded active active Bluetooth ceph-mds.target loaded active active ceph target allowing to start/stop all ceph-mds@.service instances at once ceph-mon.target loaded active active ceph target allowing to start/stop all ceph-mon@.service instances at once ...