Skip to content

Knowledge Base

Managing services and reading logs on supported Linux images

Inspect a service before changing it:

systemctl status nginx
systemctl is-enabled nginx
journalctl -u nginx --since "30 minutes ago"

Use start or stop for the current boot, and enable or disable for boot-time policy. enable --now performs both operations. Prefer reload after validating an application configuration; use restart when a reload cannot apply the change.

nginx -t && systemctl reload nginx
journalctl -p warning..alert --since today
journalctl -b -1

The last command reads the previous boot when persistent journal storage is available. Alpine uses OpenRC rather than systemd: inspect or restart a service with rc-service NAME status and rc-service NAME restart, and manage boot activation with rc-update add NAME default. Its logs may be in files under /var/log depending on the installed logger.

Please rate this article to help us improve our Knowledge Base.

0 0