Systemd systemctl: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Thomas (Diskussion | Beiträge) |
Thomas (Diskussion | Beiträge) |
||
| Zeile 1: | Zeile 1: | ||
| − | = | + | =Example= |
*cat /etc/systemd/system/chat.service | *cat /etc/systemd/system/chat.service | ||
<pre> | <pre> | ||
| Zeile 7: | Zeile 7: | ||
[Service] | [Service] | ||
| − | + | Type=simple | |
| − | ExecStart= | + | ExecStart=/bin/bash -c "/bin/netcat -l -p 3333 > /tmp/chat.log" |
| − | |||
User=root | User=root | ||
| Zeile 15: | Zeile 14: | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
</pre> | </pre> | ||
| + | |||
| + | =Systemctl= | ||
| + | ==Reload== | ||
| + | *systemctl daemon-reload | ||
| + | ==Start== | ||
| + | *systemctl start chat.service | ||
| + | ==Stop== | ||
| + | *systemctl stop chat.service | ||
| + | ==Enable== | ||
| + | *systemctl enable chat.service | ||
| + | Created symlink from /etc/systemd/system/multi-user.target.wants/chat.service to /etc/systemd/system/chat.service. | ||
| + | ==Disable== | ||
| + | *systemctl disable chat.service | ||
| + | Removed symlink /etc/systemd/system/multi-user.target.wants/chat.service. | ||
| + | |||
Version vom 24. Oktober 2017, 14:18 Uhr
Example
- cat /etc/systemd/system/chat.service
[Unit] Description=chat service After=network.target syslog.target [Service] Type=simple ExecStart=/bin/bash -c "/bin/netcat -l -p 3333 > /tmp/chat.log" User=root [Install] WantedBy=multi-user.target
Systemctl
Reload
- systemctl daemon-reload
Start
- systemctl start chat.service
Stop
- systemctl stop chat.service
Enable
- systemctl enable chat.service
Created symlink from /etc/systemd/system/multi-user.target.wants/chat.service to /etc/systemd/system/chat.service.
Disable
- systemctl disable chat.service
Removed symlink /etc/systemd/system/multi-user.target.wants/chat.service.
aktivieren/deaktivieren systemstart
- systemctl enable
- systemctl disable
- systemctl is-enabled
service steuern
- systemctl start
- systemctl stop
- systemctl status
- systemctl reload
- systemctl restart
service files anzeigen
- systemctl list-units
- systemctl list-unit-files
- systemctl --failed
rechner herunterfahren
- systemctl isolate halt
- systemctl poweroff
- systemctl suspend
- systemctl hibernate