Useful Commands/Service Management: Difference between revisions

From Fundamental Ramen
Jump to navigation Jump to search
Line 1: Line 1:
== systemctl ==
== systemctl ==
{| class="wikitable"
{| class="wikitable"
! Purpose || Command  
! Purpose || Command
|-
|-
| List ||
| Monitor ||
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
systemctl -t service
journalctl -u llama-swap --since "10:20"
journalctl -u llama-swap --since "10 minutes ago"
journalctl -u llama-swap --since today
 
systemctl status llama-swap
</syntaxhighlight>
</syntaxhighlight>
|-
|-
Line 16: Line 20:
sudo systemctl enable llama-swap
sudo systemctl enable llama-swap
sudo systemctl daemon-reload
sudo systemctl daemon-reload
</syntaxhighlight>
|-
| Monitor ||
<syntaxhighlight lang="bash">
journalctl -u llama-swap --since "10:20"
journalctl -u llama-swap --since "10 minutes ago"
journalctl -u llama-swap --since today
systemctl status llama-swap
</syntaxhighlight>
</syntaxhighlight>
|-
|-
Line 33: Line 28:
systemctl reload nginx
systemctl reload nginx
systemctl reload systemd-networkd
systemctl reload systemd-networkd
</syntaxhighlight>
|-
| List ||
<syntaxhighlight lang="bash">
systemctl -t service
</syntaxhighlight>
</syntaxhighlight>
|}
|}

Revision as of 02:36, 10 September 2026

systemctl

Purpose Command
Monitor
journalctl -u llama-swap --since "10:20"
journalctl -u llama-swap --since "10 minutes ago"
journalctl -u llama-swap --since today

systemctl status llama-swap
Setup
sudo systemctl disable llama-swap
sudo systemctl daemon-reload

sudo ln -s /home/xxx/yyy/llama-swap.service llama.service
sudo systemctl enable llama-swap
sudo systemctl daemon-reload
Control
systemctl start  nginx
systemctl stop   nginx
systemctl reload nginx
systemctl reload systemd-networkd
List
systemctl -t service

Run Level

Run Level Description
0 halt
1 single user mode
2 Multi-user, without NFS
3 Full multi-user mode
4 unused
5 X11
6 reboot