finished debugging services
Build, Test & Publish / Build (push) Successful in 45s
Build, Test & Publish / Build and Publish Container Image (push) Successful in 1m2s
Build, Test & Publish / Deploy to Infrastructure (push) Successful in 30s

This commit is contained in:
2026-08-27 17:22:37 +10:00
parent 05c76deba2
commit 1713fb498c
3 changed files with 74 additions and 1 deletions
+1
View File
@@ -132,6 +132,7 @@ export default defineConfig({
collapsed: true,
items: [
{ text: 'Add User to Linux', link: '/linux/add-user' },
{ text: 'Debugging Services', link: '/linux/debugging-services' }
]
},
{
+71
View File
@@ -0,0 +1,71 @@
# Debugging Services
The below are a bunch of commands that can be used to debug services on a Linux system (e.g. Java App / .NET App and so on)
#### Finding the process
```bash
# Generic
ps aux | grep <process_name>
# Java
ps aux | grep java
```
#### Find the service if a systemd service is running
```bash
# Generic
sudo systemctl status <service_name>
# Specific service
sudo systemctl status myapp
# Find service
sudo systemctl list-units --type=service | grep <service_name>
```
#### View logs for a systemd service
```bash
# Generic
sudo journalctl -u <service_name> -n 100 --no-pager
# Specific service
sudo journalctl -u myapp -n 100 --no-pager
```
#### Check port for a service
```bash
# Generic
sudo ss -tulpn | grep <port_number>
# Specific port
sudo ss -tulpn | grep 8080
```
#### Search for OOM (Out of Memory) errors in logs
```bash
# Generic
sudo journalctl -k | grep -i "out of memory|kill|oom" | tail -n 100
sudo dmesg | grep -i "out of memory|kill|oom" | tail -n 100
```
#### System resource usage
```bash
# Display memory usage
free -h
# Disc usage
df -h
# Usage on a specific directory
du -sh /path/to/directory | sort -rh
# CPU
top
htop
```
+2 -1
View File
@@ -1,3 +1,4 @@
# Linux Snippets and Musings
#### [Add User to Linux](./add-user.md)
#### [Add User to Linux](./add-user.md)
#### [Debugging Services](./debugging-services.md)