Services - GradedJestRisk/linux-training GitHub Wiki
Get all services: sudo systemctl status
Search service: systemctl status | grep <SERVICE_NAME> , will give you .service
Eg. systemctl status | grep clam
├─clamav-daemon.service
│ └─1646 /usr/sbin/clamd --foreground=true
├─clamav-freshclam.service
│ └─2301 /usr/bin/freshclam -d --foreground=true
You have 2 services:
- clamav-clamd
- clamav-freshclam
systemctl status <SERVICE_NAME>
Get log:
- get service log:
journalctl -u <SERVICE_NAME> -b, eg.journalctl -u snap.docker.dockerd.service -b - get list on fs:
/etc/systemd/system/multi-user.target.wants/<SERVICE-NAME>, eg.snap.docker.dockerd.service
Deactivate:
- in this session:
sudo systemctl stop <SERVICE_NAME>, egsudo systemctl stop postgresql@12-main - on next startup:
sudo systemctl disable <SERVICE_NAME> - forever:
start.conf file, so you need to alter this one instead
of using systemctl see here
Activate:
- in this session:
sudo systemctl start <SERVICE_NAME> - on next startup:
sudo systemctl enable <SERVICE-NAME>