47
I need to manage services like starting, stopping, and enabling at boot. How?
Loading...
Q&A · Answered
I need to manage services like starting, stopping, and enabling at boot. How?
Accepted answer
# Start/stop service
sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl restart nginx
sudo systemctl reload nginx
# Enable/disable at boot
sudo systemctl enable nginx
sudo systemctl disable nginx
# Check status
sudo systemctl status nginx
# List all services
sudo systemctl list-units --type=service
# Check logs
sudo journalctl -u nginx -fSay what you tried, not only what worked — the next person needs the reasoning. Code goes in a fenced block.